--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<buildpath>
+</buildpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="JasperServerCustom/apache-tomcat/webapps/jasperserver/WEB-INF/lib/cas-client-core-3.1.3.jar"/>
+ <classpathentry kind="lib" path="JasperServerCustom/apache-tomcat/webapps/jasperserver/WEB-INF/lib/casclient-2.0.11.jar"/>
+ <classpathentry kind="lib" path="JasperServerCustom/apache-tomcat/webapps/jasperserver/WEB-INF/lib/jasperreports-3.6.0.jar"/>
+ <classpathentry kind="lib" path="JasperServerCustom/apache-tomcat/webapps/jasperserver/WEB-INF/lib/LdapUserDetailsService.jar"/>
+ <classpathentry kind="lib" path="lib/antlr-2.7.6.jar"/>
+ <classpathentry kind="lib" path="lib/c3p0-0.9.1.2.jar"/>
+ <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang.jar"/>
+ <classpathentry kind="lib" path="lib/commons-logging.jar"/>
+ <classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/ejb3-persistence.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate-annotations.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate-commons-annotations.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate3.jar"/>
+ <classpathentry kind="lib" path="lib/javassist-3.9.0.GA.jar"/>
+ <classpathentry kind="lib" path="lib/jta-1.1.jar"/>
+ <classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
+ <classpathentry kind="lib" path="lib/mysql-connector-java-5.1.6-bin.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.5.8.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-log4j12-1.5.6.jar"/>
+ <classpathentry kind="lib" path="lib/spring-ldap-core-1.3.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-ldap-core-tiger-1.3.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="lib/spring-security-core-2.0.4.jar"/>
+ <classpathentry kind="lib" path="lib/spring.jar"/>
+ <classpathentry kind="lib" path="lib/xstream-1.3.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ImportENT</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+initialized_project_from_v4classpath=true
--- /dev/null
+##
+#
+# Customisation de JasperServer 3.5.0
+# Auteur : Eric Brun
+# Date : 28/09/2009
+#
+##
+
+> tar xzf JasperServerCustom-3.5.0.tgz
+> cd apache-tomcat/webapps/jasperserver/WEB-INF/
+
+- Editer cas.properties
+
+- Supprimer jasperreport-3.5.0.jar dans lib/
+
+- Cette archive ecrase le fichier decoratiors/main.jsp (suppression du top head)
+
--- /dev/null
+<?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:sec="http://www.springframework.org/schema/security"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
+
+
+<bean id="place1" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>/WEB-INF/cas.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders" value="true"/>
+
+ </bean>
+
+
+<bean id="serviceProperties" class="org.acegisecurity.ui.cas.ServiceProperties">
+ <property name="service"><value>https://${SERVICE_HOST}:${SERVICE_PORT}/${WEBAPP_CONTAINER}/j_acegi_cas_security_check</value></property>
+ <property name="sendRenew"><value>false</value></property>
+</bean>
+
+<bean id="casProcessingFilter" class="org.acegisecurity.ui.cas.CasProcessingFilter">
+ <property name="authenticationManager"><ref bean="authenticationManager"/></property>
+ <property name="authenticationFailureUrl"><value>/casfailed.jsp</value></property>
+ <property name="defaultTargetUrl"><value>/</value></property>
+ <property name="filterProcessesUrl"><value>/j_acegi_cas_security_check</value></property>
+</bean>
+<!--
+<bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
+ <property name="authenticationEntryPoint"><ref local="casProcessingFilterEntryPoint"/></property>
+</bean>
+-->
+<bean id="casProcessingFilterEntryPoint" class="org.acegisecurity.ui.cas.CasProcessingFilterEntryPoint">
+ <property name="loginUrl"><value>https://${CAS_HOST}:${CAS_PORT}/cas/login</value></property>
+ <property name="serviceProperties"><ref bean="serviceProperties"/></property>
+
+</bean>
+<!--
+<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
+ <property name="providers">
+ <list>
+ <ref bean="casAuthenticationProvider"/>
+ </list>
+ </property>
+</bean>
+-->
+<bean id="casAuthenticationProvider" class="org.acegisecurity.providers.cas.CasAuthenticationProvider">
+ <property name="casAuthoritiesPopulator"><ref bean="casAuthoritiesPopulator"/></property>
+ <property name="casProxyDecider"><ref bean="casProxyDecider"/></property>
+ <property name="ticketValidator"><ref bean="casProxyTicketValidator"/></property>
+ <property name="statelessTicketCache"><ref bean="statelessTicketCache"/></property>
+ <property name="key"><value>my_password_for_this_auth_provider_only</value></property>
+</bean>
+
+<bean id="casProxyTicketValidator" class="org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator">
+ <property name="casValidate"><value>https://${CAS_PROXY_HOST}:${CAS_PROXY_PORT}/cas/proxyValidate</value></property>
+ <property name="proxyCallbackUrl"><value>https://${CAS_PROXY_HOST}:${CAS_PROXY_PORT}/casProxy/receptor</value></property>
+ <property name="serviceProperties"><ref bean="serviceProperties"/></property>
+ <!-- <property name="trustStore"><value>/some/path/to/your/lib/security/cacerts</value></property> -->
+</bean>
+
+<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
+ <property name="configLocation">
+ <value>classpath:/ehcache-failsafe.xml</value>
+ </property>
+</bean>
+
+<bean id="ticketCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+ <property name="cacheManager">
+ <ref local="cacheManager"/>
+ </property>
+ <property name="cacheName">
+ <value>ticketCache</value>
+ </property>
+</bean>
+
+<bean id="statelessTicketCache" class="org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache">
+ <property name="cache"><ref local="ticketCacheBackend"/></property>
+</bean>
+
+<bean id="casAuthoritiesPopulator" class="org.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator">
+ <property name="userDetailsService"><ref bean="ldapDaoImpl"/></property>
+</bean>
+
+<bean id="casProxyDecider" class="org.acegisecurity.providers.cas.proxy.AcceptAnyCasProxy"/>
+
+
+<bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
+ <constructor-arg value="ldap://${ldap.host}:${ldap.port}/${ldap.basesuffix}"/>
+
+ <property name="managerDn"><value>${ldap.managerDn}</value></property>
+ <property name="managerPassword"><value>${ldap.managerPwd}</value></property>
+ </bean>
+
+
+
+<bean id="ldapAuthoritiesPopulator" class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator">
+ <constructor-arg ref="initialDirContextFactory" />
+ <constructor-arg value="${ldap.groupbase}"/>
+ <property name="groupRoleAttribute" value="${ldap.groupId}"/>
+ <property name="groupSearchFilter" value="(${ldap.memberStyle}={0})" />
+ <property name="rolePrefix" value="ROLE_"/>
+ <property name="convertToUpperCase" value="true" />
+ <property name="searchSubtree" value="true" />
+</bean>
+
+
+ <bean id="ldapUserSearch" class="org.acegisecurity.ldap.search.FilterBasedLdapUserSearch">
+ <constructor-arg index="0" value="${ldap.userbase}" />
+ <constructor-arg index="1" value="${ldap.loginAttr}={0}" />
+ <constructor-arg index="2" ref="initialDirContextFactory" />
+ <property name="searchSubtree" value="true" />
+ </bean>
+
+<bean id="ldapDaoImpl" class="com.pentila.acegisecurity.userdetails.ldap.LdapUserDetailsService">
+ <property name="ldapUserSearch" ref="ldapUserSearch" />
+ <property name="ldapAuthoritiesPopulator" ref="ldapAuthoritiesPopulator" />
+ </bean>
+
+
+
+</beans>
--- /dev/null
+<?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:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+ <!-- ======================== FILTER CHAIN =======================
+ ACLs later: requestMethodsFilter
+ Not in 1.0-RC1: exceptionTranslationFilter,
+ Later: ,rememberMeProcessingFilter
+
+ Web services currently can't use the filter chain because Axis instantiates
+ the web service handler classes, not Spring. However, we can do the context integration
+ filter, which associates a security context with the http session, and call
+ into the Acegi beans from the service handler
+ -->
+ <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
+ <property name="filterInvocationDefinitionSource">
+ <value>
+ CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
+ PATTERN_TYPE_APACHE_ANT
+ /xmla=httpSessionContextIntegrationFilter,basicProcessingFilter,JIAuthenticationSynchronizer,anonymousProcessingFilter,basicAuthExceptionTranslationFilter,filterInvocationInterceptor
+ /services/**=httpSessionContextIntegrationFilter,portletAuthenticationProcessingFilter,basicProcessingFilter,passwordExpirationProcessingFilter,JIAuthenticationSynchronizer,anonymousProcessingFilter,basicAuthExceptionTranslationFilter,filterInvocationInterceptor
+ /**=httpSessionContextIntegrationFilter,casProcessingFilter,userPreferencesFilter,basicProcessingFilter,requestParameterAuthenticationFilter,JIAuthenticationSynchronizer,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor,switchUserProcessingFilter
+ </value>
+ </property>
+ </bean>
+
+ <!-- updater bean to insert a filter -->
+ <bean id="insertFilter" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="filterChainProxy"/>
+ <property name="propertyName" value="filterInvocationDefinitionSource"/>
+ <property name="operation" value="insert"/>
+ </bean>
+
+ <!-- ======================== AUTHENTICATION ======================= -->
+ <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
+ <property name="providers">
+ <list>
+ <!-- not on by default <ref local="ldapAuthenticationProvider"/> -->
+ <ref bean="casAuthenticationProvider" />
+ <ref local="daoAuthenticationProvider"/>
+ <ref local="anonymousAuthenticationProvider"/>
+ <!--ref local="jaasAuthenticationProvider"/-->
+ </list>
+ </property>
+ </bean>
+
+ <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
+ <!-- jdbcDaoImpl -->
+ <!-- <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property> -->
+ <property name="userDetailsService"><ref bean="internalUserAuthorityService"/></property>
+ <property name="passwordEncoder"><ref local="passwordEncoder"/></property>
+ </bean>
+
+ <bean id="passwordEncoder" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.PasswordCipherer" lazy-init="false">
+ <property name="allowEncoding"><value>true</value></property>
+ <property name="keyInPlainText"><value>false</value></property>
+ <property name="secretKey"><value>0xC8 0x43 0x29 0x49 0xAE 0x25 0x2F 0xA1 0xC1 0xF2 0xC8 0xD9 0x31 0x01 0x2C 0x52 0x54 0x0B 0x5E 0xEA 0x9E 0x37 0xA8 0x61</value></property>
+ <property name="secretKeyAlgorithm"><value>DESede</value></property>
+ <property name="cipherTransformation"><value>DESede/CBC/PKCS5Padding</value></property>
+ </bean>
+
+ <!--
+ <bean id="jaasAuthenticationProvider" class="org.acegisecurity.providers.jaas.JaasAuthenticationProvider">
+ <property name="loginConfig">
+ <value>/WEB-INF/login.conf</value>
+ </property>
+ <property name="loginContextName">
+ <value>FileLogin</value>
+ </property>
+ <property name="callbackHandlers">
+ <list>
+ <bean class="org.acegisecurity.providers.jaas.JaasNameCallbackHandler"/>
+ <bean class="org.acegisecurity.providers.jaas.JaasPasswordCallbackHandler"/>
+ </list>
+ </property>
+ <property name="authorityGranters">
+ <list>
+ <bean class="org.appfuse.web.JaasAuthorityGranter"/>
+ </list>
+ </property>
+ </bean>
+ -->
+ <bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
+ <property name="key"><value>foobar</value></property>
+ <property name="userAttribute"><value>anonymousUser,ROLE_ANONYMOUS</value></property>
+ </bean>
+
+ <bean id="anonymousAuthenticationProvider" class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
+ <property name="key"><value>foobar</value></property>
+ </bean>
+
+
+ <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
+ <property name="userMap">
+ <value>
+ tomcat=536c0b339345616c1b33caf454454d8b8a190d6c,ROLE_USER
+ springlive=2a9152cff1d25b5bbaa3e5fbc7acdc6905c9f251,ROLE_USER
+ </value>
+ </property>
+ </bean>
+
+
+ <!--
+
+ For LDAP authentication
+
+ <bean id="initialDirContextFactory" class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
+ <constructor-arg value="ldap://scopeserv1:389/dc=panscopic,dc=com"/>
+ -->
+ <!--
+ You may not need the next properties
+ <property name="managerDn"><value>cn=manager,dc=acegisecurity,dc=org</value></property>
+ <property name="managerPassword"><value>acegisecurity</value></property>
+ -->
+ <!--
+ </bean>
+ -->
+
+ <!--
+ For LDAP authentication
+ This bean is not used by default
+
+ <bean id="userSearch"
+ class="org.acegisecurity.ldap.search.FilterBasedLdapUserSearch">
+ <constructor-arg index="0">
+ <value></value>
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>(uid={0})</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <ref local="initialDirContextFactory" />
+ </constructor-arg>
+ <property name="searchSubtree">
+ <value>true</value>
+ </property>
+ </bean>
+
+ -->
+
+ <!--
+ For LDAP authentication
+
+ <bean id="ldapAuthenticationProvider" class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider">
+ <constructor-arg>
+ <bean class="org.acegisecurity.providers.ldap.authenticator.BindAuthenticator">
+ <constructor-arg><ref local="initialDirContextFactory"/></constructor-arg>
+ <!- -property name="userDnPatterns"><list><value>uid={0}</value></list></property- ->
+ <property name="userSearch" ref="userSearch"/>
+ </bean>
+ </constructor-arg>
+ <constructor-arg>
+ <bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator">
+ <constructor-arg index="0"><ref local="initialDirContextFactory"/></constructor-arg>
+ <constructor-arg index="1"><value></value></constructor-arg>
+ <property name="groupRoleAttribute"><value>cn</value></property>
+ <property name="groupSearchFilter"><value>(&(uniqueMember={0})(objectclass=groupofuniquenames))</value></property>
+ <property name="searchSubtree"><value>true</value></property>
+ </bean>
+ </constructor-arg>
+ </bean>
+ -->
+
+ <bean id="JIAuthenticationSynchronizer" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.MetadataAuthenticationProcessingFilter">
+ <property name="externalUserService"><ref bean="internalUserAuthorityService"/></property>
+ </bean>
+
+
+ <!-- Automatically receives AuthenticationEvent messages -->
+ <bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
+
+ <bean id="userLocalesList" class="com.jaspersoft.jasperserver.war.common.LocalesListImpl">
+ <property name="locales">
+ <list>
+ <value type="java.util.Locale">en</value>
+ <value type="java.util.Locale">fr</value>
+ <value type="java.util.Locale">it</value>
+ <value type="java.util.Locale">es</value>
+ <value type="java.util.Locale">de</value>
+ <value type="java.util.Locale">ro</value>
+ <value type="java.util.Locale">ja</value>
+ <value type="java.util.Locale">zh_TW</value>
+ <value type="java.util.Locale">zh_CN</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="userPreferencesFilter" class="com.jaspersoft.jasperserver.war.UserPreferencesFilter">
+ <property name="cookieAge">
+ <value type="int">86400</value>
+ </property>
+ <property name="userService">
+ <ref bean="internalUserAuthorityService"/>
+ </property>
+ </bean>
+
+ <!--
+ <bean id="rememberMeProcessingFilter" class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="rememberMeServices"><ref local="rememberMeServices"/></property>
+ </bean>
+
+ <bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
+ <property name="userDetailsService"><ref local="inMemoryDaoImpl"/></property>
+ <property name="key"><value>springRocks</value></property>
+ </bean>
+
+ <bean id="rememberMeAuthenticationProvider" class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
+ <property name="key"><value>springRocks</value></property>
+ </bean>
+ -->
+ <!-- Basic Authentication -->
+ <bean id="basicProcessingFilter" class="org.acegisecurity.ui.basicauth.BasicProcessingFilter">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="authenticationEntryPoint"><ref local="basicProcessingFilterEntryPoint"/></property>
+ </bean>
+
+ <bean id="portletAuthenticationProcessingFilter" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.JIPortletAuthenticationProcessingFilter">
+ <property name="trustedIpAddress">
+ <list>
+ <!-- uncomment this if both portal server and web server are running on the same machine -->
+ <!-- <value>127.0.0.1</value> -->
+ </list>
+ </property>
+ <property name="userService">
+ <ref bean="internalUserAuthorityService"/>
+ </property>
+ </bean>
+
+ <bean id="passwordExpirationProcessingFilter" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.PasswordExpirationProcessingFilter">
+ <property name="userService">
+ <ref bean="internalUserAuthorityService"/>
+
+ </property>
+ <property name="passwordExpirationInDays" value="0" />
+ </bean>
+
+
+ <!-- if there is no BASIC auth header, this filter will display a 401 error thanks to the entry point -->
+ <bean id="basicAuthExceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
+ <property name="authenticationEntryPoint"><ref bean="basicProcessingFilterEntryPoint"/></property>
+ </bean>
+
+ <bean id="basicProcessingFilterEntryPoint" class="org.acegisecurity.ui.basicauth.BasicProcessingFilterEntryPoint">
+ <property name="realmName"><value>Protected Area</value></property>
+ </bean>
+
+
+
+ <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
+ <property name="authenticationEntryPoint"><ref bean="casProcessingFilterEntryPoint"/></property>
+ </bean>
+
+
+
+
+<!--
+
+ <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="authenticationFailureUrl"><value>/login.html?error=1</value></property>
+ <property name="defaultTargetUrl"><value>/loginsuccess.html</value></property>
+ <property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
+ </bean>
+-->
+ <bean id="requestParameterAuthenticationFilter" class="com.jaspersoft.jasperserver.war.util.RequestParameterAuthenticationFilter">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="authenticationFailureUrl"><value>/loginerror.html</value></property>
+ <property name="excludeUrls">
+ <list>
+ <value>/j_acegi_switch_user</value>
+ </list>
+ </property>
+ </bean>
+<!--
+ <bean id="authenticationProcessingFilterEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
+ <property name="loginFormUrl"><value>/login.html</value></property>
+ <property name="forceHttps"><value>false</value></property>
+ </bean>
+ -->
+ <!-- ===================== HTTP REQUEST SECURITY ====================
+ <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter">
+ <property name="context"><value>org.acegisecurity.context.security.SecureContextImpl</value></property>
+ </bean>
+ -->
+ <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/>
+<!--
+ <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
+ <property name="authenticationEntryPoint"><ref bean="casProcessingFilterEntryPoint"/></property>
+ <property name="accessDeniedHandler">
+ <bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
+ <property name="errorPage" value="/WEB-INF/jsp/AccessDeniedPage.jsp"/>
+ </bean>
+ </property>
+ </bean>
+-->
+ <bean id="httpRequestAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
+ <property name="allowIfAllAbstainDecisions"><value>false</value></property>
+ <property name="decisionVoters">
+ <list>
+ <ref bean="roleVoter"/>
+ <bean class="org.acegisecurity.vote.AuthenticatedVoter"/>
+ </list>
+ </property>
+ </bean>
+
+
+ <bean id="runAsManager" class="org.acegisecurity.runas.RunAsManagerImpl"><!--org.acegisecurity.runas.RunAsImplAuthenticationProvider">-->
+ <property name="key"><value>my_run_as_password</value></property>
+ </bean>
+
+ <bean id="requestMethodsFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/>
+
+ <!-- Optionally, you can specify a "rolePrefix" property to change
+ (or remove) the ROLE_ prefix for role names. -->
+ <bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter"/>
+
+ <!--
+ Note the order that entries are placed against the objectDefinitionSource is critical.
+ The FilterSecurityInterceptor will work from the top of the list down to the FIRST pattern that matches the request URL.
+ Accordingly, you should place MOST SPECIFIC (ie a/b/c/d.*) expressions first, with LEAST SPECIFIC (ie a/.*) expressions last
+
+ ========= JasperServer Note ==============
+ There are currently three roles:
+ ROLE_ANONYMOUS (i.e. not logged in)
+ ROLE_USER
+ ROLE_ADMINISTRATOR
+ Any page accessible by a non-admin user (or by someone not logged in)
+ must be added explicitly. Any other pages are assumed to require the admin role
+
+ -->
+ <bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
+ <property name="authenticationManager"><ref bean="authenticationManager"/></property>
+ <property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>
+ <property name="runAsManager"><ref bean="runAsManager"/></property>
+ <property name="objectDefinitionSource">
+ <value>
+ CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
+ PATTERN_TYPE_APACHE_ANT
+ /j_acegi_cas_security_check*=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY
+ /login.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR
+ /logout.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY
+ /loginerror.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR
+ /exituser.html=ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY
+ /home.html=ROLE_USER,ROLE_ADMINISTRATOR
+ /flow.html=ROLE_USER,ROLE_ADMINISTRATOR
+ /loginsuccess.html=ROLE_USER,ROLE_ADMINISTRATOR
+ /listolapviews.html=ROLE_USER,ROLE_ADMINISTRATOR
+ /fillparams.html=ROLE_USER,ROLE_ADMINISTRATOR
+ /j_acegi_switch_user*=ROLE_ADMINISTRATOR
+ /fileview/**=ROLE_USER,ROLE_ADMINISTRATOR
+ /olap/**=ROLE_USER,ROLE_ADMINISTRATOR
+ /xmla=ROLE_USER,ROLE_ADMINISTRATOR
+ /services/**=ROLE_USER,ROLE_ADMINISTRATOR
+ /reportimage/**=ROLE_USER,ROLE_ADMINISTRATOR
+ /jrpxml/**=ROLE_USER,ROLE_ADMINISTRATOR
+ /heartbeatinfo.html=ROLE_USER,ROLE_ADMINISTRATOR
+ </value>
+ </property>
+ </bean>
+
+ <!-- updater bean to set the roles allowed to get to a URL -->
+ <bean id="setRolesForURL" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="filterInvocationInterceptor"/>
+ <property name="propertyName" value="objectDefinitionSource"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- get these done last -->
+ <bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater">
+ <property name="definition" ref="setRolesForURL"/>
+ <property name="order" value="1000000000"/>
+ <property name="value">
+ <value>
+ /*.html=ROLE_ADMINISTRATOR
+ /*.jsp=ROLE_ADMINISTRATOR
+ </value>
+ </property>
+ </bean>
+
+ <!-- switchUserProcessingFilter for "login-as" feature -->
+
+ <bean id="switchUserProcessingFilter"
+ class="org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter">
+ <property name="userDetailsService"><ref bean="internalUserAuthorityService"/></property>
+ <property name="switchUserUrl"><value>/j_acegi_switch_user</value></property>
+ <property name="exitUserUrl"><value>/j_acegi_exit_user</value></property>
+ <property name="targetUrl"><value>/home.html</value></property>
+ </bean>
+
+ <!-- ===================== ACL-BASED SECURITY ==================== -->
+
+ <!-- ACL permission masks used by this application -->
+ <bean id="SimpleAclEntry.ADMINISTRATION" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
+ <property name="staticField">
+ <value>org.acegisecurity.acl.basic.SimpleAclEntry.ADMINISTRATION</value>
+ </property>
+ </bean>
+
+ <bean id="SimpleAclEntry.READ_WRITE" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
+ <property name="staticField">
+ <value>org.acegisecurity.acl.basic.SimpleAclEntry.READ_WRITE</value>
+ </property>
+ </bean>
+
+ <bean id="SimpleAclEntry.READ" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
+ <property name="staticField">
+ <value>org.acegisecurity.acl.basic.SimpleAclEntry.READ</value>
+ </property>
+ </bean>
+
+ <bean id="SimpleAclEntry.DELETE" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
+ <property name="staticField">
+ <value>org.acegisecurity.acl.basic.SimpleAclEntry.DELETE</value>
+ </property>
+ </bean>
+
+ <!-- An access decision voter that reads ACL_USER_ADMIN settings -->
+ <bean id="aclUserAdminVoter" class="org.acegisecurity.vote.BasicAclEntryVoter">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="processConfigAttribute">
+ <value>ACL_USER_ADMIN</value>
+ </property>
+ <property name="processDomainObjectClass">
+ <value>com.jaspersoft.jasperserver.api.metadata.common.domain.Resource</value>
+ </property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- An access decision voter that reads ACL_USER_READ settings -->
+ <bean id="aclUserReadVoter" class="org.acegisecurity.vote.BasicAclEntryVoter">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="processConfigAttribute">
+ <value>ACL_USER_READ</value>
+ </property>
+ <property name="processDomainObjectClass">
+ <value>java.lang.String</value>
+ </property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- An access decision voter that reads ACL_USER_UPDATE settings -->
+ <bean id="aclUserUpdateVoter" class="org.acegisecurity.vote.BasicAclEntryVoter">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="processConfigAttribute">
+ <value>ACL_USER_UPDATE</value>
+ </property>
+ <property name="processDomainObjectClass">
+ <value>com.jaspersoft.jasperserver.api.metadata.common.domain.Resource</value>
+ </property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ_WRITE"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- An access decision voter that reads ACL_USER_READ settings -->
+ <bean id="aclUserDeleteVoter" class="org.acegisecurity.vote.BasicAclEntryVoter">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="processConfigAttribute">
+ <value>ACL_USER_DELETE</value>
+ </property>
+ <property name="processDomainObjectClass">
+ <value>java.lang.String</value>
+ </property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.DELETE"/>
+ </list>
+ </property>
+ </bean>
+
+
+ <!-- An access decision manager used by the business objects -->
+ <bean id="aclAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
+ <property name="allowIfAllAbstainDecisions"><value>true</value></property>
+ <property name="decisionVoters">
+ <list>
+ <ref local="roleVoter"/>
+ <ref local="aclUserAdminVoter"/>
+ <ref local="aclUserUpdateVoter"/>
+ <!-- <ref local="aclUserCreateVoter"/> -->
+ <ref local="aclUserDeleteVoter"/>
+ <ref local="aclUserReadVoter"/>
+ <ref local="aclUserMoveVoter"/>
+ <ref local="aclUserCopyVoter"/>
+ <ref local="aclUserMultiCopyVoter"/>
+ </list>
+ </property>
+ </bean>
+
+
+ <!-- ========= ACCESS CONTROL LIST MANAGER DEFINITIONS ========= -->
+
+ <bean id="aclManager" class="org.acegisecurity.acl.AclProviderManager">
+ <property name="providers">
+ <list>
+ <ref bean="objectPermissionServiceInternal"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- ===================== METHOD-LEVEL SECURITY ====================
+ Read methods:
+ getResource
+ getResourceData - Does not return a resource
+ getContentResourceData - Does not return a resource
+ getFolder
+ getAllFolders
+ getSubFolders
+ findResource
+ loadResourcesList*
+ loadClientResources*
+ getChildrenFolderName - Does not return a resource
+ Write methods:
+ saveFolder - Problems handling not existent objects...
+ saveResource - Problems handling not existent objects...
+ newResource - Not useful....
+ Delete methods:
+ deleteResource
+ deleteFolder
+ delete - Not useful....
+ -->
+ <bean id="hibernateRepoServiceSecurity"
+ class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="accessDecisionManager"><ref local="aclAccessDecisionManager"/></property>
+ <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
+ <property name="objectDefinitionSource"><ref local="repositoryServiceMethodSecurity"/></property>
+ </bean>
+
+ <bean id="repositoryServiceMethodSecurity" class="com.jaspersoft.jasperserver.api.common.util.spring.SimplePropertyFactoryBean">
+ <property name="objectType" value="org.acegisecurity.intercept.method.MethodDefinitionSource"/>
+ <property name="value">
+ <value>
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getResource=ACL_USER_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getFolder=ACL_USER_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.loadResourcesList=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.loadClientResources=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getAllFolders=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getAllSubfolders=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getSubFolders=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.findResource=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.findResources=AFTER_ACL_COLLECTION_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.saveFolder=ACL_USER_ADMIN,ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.saveResource=ACL_USER_ADMIN,ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.deleteResource=ACL_USER_DELETE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.deleteFolder=ACL_USER_DELETE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.delete=ACL_USER_DELETE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.moveFolder=ACL_USER_MOVE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.moveResource=ACL_USER_MOVE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.copyResource=ACL_USER_COPY
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.copyResources=ACL_USER_MULTI_COPY
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.copyFolder=ACL_USER_COPY
+ </value>
+ </property>
+ </bean>
+
+ <!--
+
+ Not used
+
+ <bean id="hibernateRepoServiceSecurity"
+ class="org.acegisecurity.intercept.method.aspectj.AspectJSecurityInterceptor">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="accessDecisionManager"><ref local="aclAccessDecisionManager"/></property>
+ <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
+ <property name="objectDefinitionSource">
+ <value>
+ com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService.getRepoResource=ROLE_PermissionTestRoleAgain,AFTER_ACL_READ
+ com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService.loadResourcesList=ROLE_PermissionTestRole,ROLE_PermissionTestRoleAgain,AFTER_ACL_COLLECTION_READ
+ </value>
+ </property>
+ </bean>
+
+ <bean id="domainObjectInstanceSecurityAspect"
+ class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.ObjectSecurityAspect"
+ factory-method="aspectOf">
+ <property name="securityInterceptor"><ref local="hibernateRepoServiceSecurity"/></property>
+ </bean>
+ -->
+
+ <!-- ============== "AFTER INTERCEPTION" AUTHORIZATION =========== -->
+
+ <bean id="afterInvocationManager" class="org.acegisecurity.afterinvocation.AfterInvocationProviderManager">
+ <property name="providers">
+ <list>
+ <ref local="afterAclRead"/>
+ <ref local="afterAclCollectionRead"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="afterInvocationManagerForUpdate" class="org.acegisecurity.afterinvocation.AfterInvocationProviderManager">
+ <property name="providers">
+ <list>
+ <ref local="afterAclRead"/>
+ <ref local="afterAclCollectionRead"/>
+ <ref local="afterAclCollectionUpdate"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- Processes AFTER_ACL_COLLECTION_READ configuration settings -->
+
+ <bean id="afterAclCollectionRead"
+ class="org.acegisecurity.afterinvocation.BasicAclEntryAfterInvocationCollectionFilteringProvider">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- Processes AFTER_ACL_READ configuration settings -->
+
+ <bean id="afterAclRead" class="org.acegisecurity.afterinvocation.BasicAclEntryAfterInvocationProvider">
+ <property name="aclManager"><ref local="aclManager"/></property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ"/>
+ </list>
+ </property>
+ </bean>
+
+ <!--Processes AFTER_ACL_COLLECTION_UPDATE configuration settings-->
+ <bean id="afterAclCollectionUpdate" class="org.acegisecurity.afterinvocation.BasicAclEntryAfterInvocationCollectionFilteringProvider">
+ <property name="aclManager">
+ <ref local="aclManager"/>
+ </property>
+ <property name="processConfigAttribute">
+ <value>AFTER_ACL_COLLECTION_UPDATE</value>
+ </property>
+ <property name="requirePermission">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ_WRITE"/>
+ </list>
+ </property>
+ </bean>
+
+
+ <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+ <property name="customEditors">
+ <map>
+ <entry key="com.jaspersoft.jasperserver.war.security.FlowDefinitionSource">
+ <bean class="com.jaspersoft.jasperserver.war.security.FlowDefinitionSourceEditor"/>
+ </entry>
+ <entry key="org.acegisecurity.ConfigAttribute">
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.ConfigAttributeEditor"/>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="flowAclManager" class="org.acegisecurity.acl.AclProviderManager">
+ <property name="providers">
+ <list>
+ <ref bean="objectPermissionServiceInternal"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="flowVoter" class="com.jaspersoft.jasperserver.war.security.FlowRoleAccessVoter">
+ <property name="flowAccessAttribute" value="FLOW_ACCESS"/>
+ <property name="flowDefinitionSource">
+ <value>
+ repoAdminFlow=ROLE_ADMINISTRATOR
+ userListFlow=ROLE_ADMINISTRATOR
+ roleListFlow=ROLE_ADMINISTRATOR
+ reportUnitFlow=ROLE_ADMINISTRATOR
+ olapUnitFlow=ROLE_ADMINISTRATOR
+ olapClientConnectionFlow=ROLE_ADMINISTRATOR
+ mondrianXmlaSourceFlow=ROLE_ADMINISTRATOR
+ editFolderFlow=ROLE_ADMINISTRATOR
+ fileResourceFlow=ROLE_ADMINISTRATOR
+ dataTypeFlow=ROLE_ADMINISTRATOR
+ listOfValuesFlow=ROLE_ADMINISTRATOR
+ queryFlow=ROLE_ADMINISTRATOR
+ reportDataSourceFlow=ROLE_ADMINISTRATOR
+ inputControlsFlow=ROLE_ADMINISTRATOR
+ objectPermissionToRoleFlow=ROLE_ADMINISTRATOR
+ userEditFlow=ROLE_ADMINISTRATOR
+ roleEditFlow=ROLE_ADMINISTRATOR
+ queryReferenceFlow=ROLE_ADMINISTRATOR
+ objectPermissionToUserFlow=ROLE_ADMINISTRATOR
+ repositoryExplorerFlow=ROLE_USER,ROLE_ADMINISTRATOR
+ *=ROLE_USER,ROLE_ADMINISTRATOR
+ </value>
+ </property>
+ </bean>
+
+ <bean id="flowAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
+ <property name="allowIfAllAbstainDecisions"><value>false</value></property>
+ <property name="decisionVoters">
+ <list>
+ <ref local="flowVoter"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="flowExecuterSecurity" class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
+ <property name="authenticationManager"><ref local="authenticationManager"/></property>
+ <property name="accessDecisionManager"><ref local="flowAccessDecisionManager"/></property>
+ <property name="objectDefinitionSource">
+ <value>
+ org.springframework.webflow.executor.FlowExecutor.launch=FLOW_ACCESS
+ </value>
+ </property>
+ </bean>
+
+ <bean id="checkAclUpdateInterceptor"
+ class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.CheckMethodSecurityInterceptor">
+ <property name="authenticationManager">
+ <ref local="authenticationManager"/>
+ </property>
+ <property name="accessDecisionManager">
+ <ref local="aclAccessDecisionManager"/>
+ </property>
+
+ <property name="afterInvocationManager">
+ <ref local="afterInvocationManagerForUpdate"/>
+ </property>
+
+ <property name="objectDefinitionSource"><ref local="repositoryServiceMethodSecurity"/></property>
+ </bean>
+
+
+ <!-- Use for saveResource -->
+ <bean id="securityCheckerForAclUpdate"
+ class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces">
+ <value>
+ com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService
+ </value>
+ </property>
+ <property name="interceptorNames">
+ <list>
+ <idref bean="checkAclUpdateInterceptor"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- Utility class using securityCheckerForAclUpdate -->
+ <bean id="internalRepositoryServiceSecurityChecker"
+ class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.RepositoryServiceSecurityChecker">
+ <property name="securityChecker">
+ <ref local="securityCheckerForAclUpdate"/>
+ </property>
+ </bean>
+
+ <bean id="repositoryServiceSecurityChecker"
+ class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.RepositoryServiceSecurityChecker">
+ <property name="securityChecker">
+ <ref local="securityCheckerForAclUpdate"/>
+ </property>
+ </bean>
+
+
+ <!-- run other interceptors if the user has update access. -->
+ <bean id="aclUpdateMethodSecurityInterceptor"
+ class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
+ <property name="authenticationManager">
+ <ref local="authenticationManager"/>
+ </property>
+ <property name="accessDecisionManager">
+ <ref local="aclAccessDecisionManager"/>
+ </property>
+
+ <property name="afterInvocationManager">
+ <ref local="afterInvocationManagerForUpdate"/>
+ </property>
+
+ <property name="objectDefinitionSource">
+ <value>
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getResource=ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getFolder=ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.loadResourcesList=AFTER_ACL_COLLECTION_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.loadClientResources=AFTER_ACL_COLLECTION_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getAllFolders=AFTER_ACL_COLLECTION_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getAllSubfolders=AFTER_ACL_COLLECTION_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.getSubFolders=AFTER_ACL_COLLECTION_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.saveFolder=ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.saveResource=ACL_USER_UPDATE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.deleteResource=ACL_USER_DELETE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.deleteFolder=ACL_USER_DELETE
+ com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService.delete=ACL_USER_DELETE
+ </value>
+ </property>
+ </bean>
+
+ <!-- Use for getAllFolders: will run repositoryService methods if the user has update access. -->
+ <bean id="repositoryServiceForAclUpdate"
+ class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces">
+ <value>
+ com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService
+ </value>
+ </property>
+ <property name="interceptorNames">
+ <list>
+ <idref bean="hibernateRepoServiceTransactionInterceptor" />
+ <idref bean="aclUpdateMethodSecurityInterceptor"/>
+ <idref bean="hibernateRepositoryService"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="aclUserMoveVoter" class="com.jaspersoft.jasperserver.api.metadata.security.MultiAclEntryVoter">
+ <property name="configAttribute" value="ACL_USER_MOVE"/>
+ <property name="aclManager" ref="aclManager"/>
+ <property name="argumentVoters">
+ <list>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodArgumentVoter">
+ <property name="argumentType" value="java.lang.String"/>
+ <property name="argumentIndex" value="1"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.DELETE"/>
+ </list>
+ </property>
+ </bean>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodArgumentVoter">
+ <property name="argumentType" value="java.lang.String"/>
+ <property name="argumentIndex" value="2"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ_WRITE"/>
+ </list>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="aclUserCopyVoter" class="com.jaspersoft.jasperserver.api.metadata.security.MultiAclEntryVoter">
+ <property name="configAttribute" value="ACL_USER_COPY"/>
+ <property name="aclManager" ref="aclManager"/>
+ <property name="argumentVoters">
+ <list>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodArgumentVoter">
+ <property name="argumentType" value="java.lang.String"/>
+ <property name="argumentIndex" value="1"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ"/>
+ </list>
+ </property>
+ </bean>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodArgumentVoter">
+ <property name="argumentType" value="java.lang.String"/>
+ <property name="argumentIndex" value="2"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ_WRITE"/>
+ </list>
+ </property>
+ <property name="argumentFunctor">
+ <bean class="com.jaspersoft.jasperserver.api.metadata.common.util.ParentPathFunctor"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="aclUserMultiCopyVoter" class="com.jaspersoft.jasperserver.api.metadata.security.MultiAclEntryVoter">
+ <property name="configAttribute" value="ACL_USER_MULTI_COPY"/>
+ <property name="aclManager" ref="aclManager"/>
+ <property name="argumentVoters">
+ <list>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodCollectionArgumentVoter">
+ <property name="argumentType" value="java.lang.String[]"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ"/>
+ </list>
+ </property>
+ </bean>
+ <bean class="com.jaspersoft.jasperserver.api.metadata.security.BasicMethodArgumentVoter">
+ <property name="argumentType" value="java.lang.String"/>
+ <property name="accessPermissions">
+ <list>
+ <ref local="SimpleAclEntry.ADMINISTRATION"/>
+ <ref local="SimpleAclEntry.READ_WRITE"/>
+ </list>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+</beans>
--- /dev/null
+<?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:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+ <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>/WEB-INF/hibernate.properties</value>
+ <value>/WEB-INF/js.quartz.properties</value>
+ <!-- below is for jboss + postgresql only -->
+ <!-- <value>/WEB-INF/js.jdbc-postgresql.properties</value> -->
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders" value="true"/>
+
+ </bean>
+
+ <bean id="contextApplicationContextProvider" class="com.jaspersoft.jasperserver.api.common.util.spring.ApplicationContextProvider"></bean>
+
+ <!-- Service beans -->
+
+ <!-- Hibernate SessionFactory -->
+ <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="mappingResources">
+ <list>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/CachedItem.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/ContentRepoFileResource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoBeanDataSource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoCustomDataSource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoDataType.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoFileResource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoFolder.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoInputControl.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoJdbcDataSource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoJndiJdbcDataSource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoListOfValues.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoOlapClientConnection.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoOlapUnit.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoQuery.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoReportUnit.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoResource.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/common/service/impl/hibernate/persistent/RepoXMLAConnection.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/user/domain/impl/hibernate/RepoUser.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/user/domain/impl/hibernate/RepoRole.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/user/domain/impl/hibernate/RepoTenant.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/user/domain/impl/hibernate/RepoObjectPermission.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/metadata/user/domain/impl/hibernate/RepoProfileAttribute.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/engine/scheduling/hibernate/PersistentReportJob.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/engine/scheduling/hibernate/PersistentReportJobTrigger.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/engine/scheduling/hibernate/PersistentReportJobRepositoryDestination.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/engine/scheduling/hibernate/PersistentReportJobMailNotification.hbm.xml</value>
+ <value>/com/jaspersoft/jasperserver/api/common/domain/impl/LogEvent.hbm.xml</value>
+ </list>
+ </property>
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">${metadata.hibernate.dialect}</prop>
+ <prop key="hibernate.show_sql">false</prop>
+ <prop key="hibernate.generate_statistics">true</prop>
+ <!-- uncomment property below if a default schema should be specified such as for DB2 -->
+ <!-- <prop key="hibernate.default_schema">${metadata.hibernate.default_schema}</prop> -->
+ </props>
+ </property>
+ <property name="eventListeners">
+ <map>
+ <entry key="merge">
+ <bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
+ </entry>
+ <entry key="delete">
+ <ref bean="hibernateCompositeDeleteListener"/>
+ </entry>
+ <entry key="save-update">
+ <ref bean="hibernateCompositeSaveOrUpdateListener"/>
+ </entry>
+ </map>
+ </property>
+ <property name="entityInterceptor">
+ <ref local="hibernateCompositeInterceptor"/>
+ </property>
+ </bean>
+
+ <bean id="hibernateCompositeDeleteListener" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.HibernateCompositeDeleteListener">
+ <property name="listeners">
+ <list>
+ <ref bean="hibernateReportJobsUserDeleteListener"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="hibernateCompositeInterceptor" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.HibernateCompositeInterceptor">
+ <property name="listeners">
+ <list>
+ <ref bean="metadataRepositoryDeleteListener"/>
+ <ref bean="userAuthorityDeleteListener"/>
+ <ref bean="objectPermissionsUserAuthorityDeleteListener"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="hibernateCompositeSaveOrUpdateListener" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.HibernateCompositeSaveOrUpdateListener">
+ <property name="listeners">
+ <list>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="metadataRepositoryDeleteListener" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateResourceDeleteListener">
+ <property name="persistentClassMappings" ref="persistentMappings"/>
+ </bean>
+
+ <bean id="userAuthorityDeleteListener" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.HibernateUserAuthorityDeleteListener">
+ </bean>
+
+ <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
+ <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ </bean>
+
+ <bean id="objectFactory" class="com.jaspersoft.jasperserver.api.common.service.impl.ObjectFactoryImpl"/>
+
+
+ <bean id="mappingResourceFactory" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.ResourceFactoryImpl">
+ <property name="objectFactory" ref="objectFactory"/>
+ <property name="implementationClassMappings">
+ <map>
+ <entry key="com.jaspersoft.jasperserver.api.common.domain.LogEvent"
+ value="com.jaspersoft.jasperserver.api.common.domain.client.LogEventImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.FileResourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.ContentResourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JdbcReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.JdbcReportDataSourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JndiJdbcReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.JndiJdbcReportDataSourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.BeanReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.BeanReportDataSourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.CustomReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.CustomReportDataSourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.ReportUnitImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.Query"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.QueryImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.InputControl"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.InputControlImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.ListOfValues"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.ListOfValuesImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.DataType"
+ value="com.jaspersoft.jasperserver.api.metadata.common.domain.client.DataTypeImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.User"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.client.UserImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.Role"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.client.RoleImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.Tenant"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.client.TenantImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.ObjectPermission"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.client.ObjectPermissionImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.ProfileAttribute"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.client.ProfileAttributeImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.MondrianXMLADefinition"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.client.MondrianXMLADefinitionImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.OlapUnit"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.client.OlapUnitImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.OlapClientConnection"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.client.OlapClientConnectionImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.XMLAConnection"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.client.XMLAConnectionImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.JdbcOlapDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.JdbcReportDataSourceImpl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.JndiJdbcOlapDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.client.JndiJdbcReportDataSourceImpl"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="persistentMappings" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.ResourceFactoryImpl">
+ <property name="objectFactory" ref="objectFactory"/>
+ <property name="implementationClassMappings">
+ <map>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoFileResource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.ContentRepoFileResource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoReportDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JdbcReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoJdbcDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JndiJdbcReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoJndiJdbcDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.BeanReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoBeanDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.CustomReportDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoCustomDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.RepoReportUnit"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.Query"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoQuery"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.InputControl"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoInputControl"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.ListOfValues"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoListOfValues"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.ListOfValuesItem"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoListOfValuesItem"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.DataType"
+ value="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoDataType"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.ProfileAttribute"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoProfileAttribute"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.ObjectPermission"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoObjectPermission"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.User"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoUser"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.Role"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoRole"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.user.domain.Tenant"
+ value="com.jaspersoft.jasperserver.api.metadata.user.domain.impl.hibernate.RepoTenant"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.OlapUnit"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.impl.hibernate.RepoOlapUnit"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.OlapClientConnection"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.impl.hibernate.RepoOlapClientConnection"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.XMLAConnection"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.impl.hibernate.RepoXMLAConnection"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.OlapDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.olap.domain.impl.hibernate.RepoOlapDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.JdbcOlapDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoJdbcDataSource"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.JndiJdbcOlapDataSource"
+ value="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoJndiJdbcDataSource"/>
+
+ </map>
+ </property>
+ </bean>
+
+ <bean id="hibernateRepositoryService" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="resourceFactory" ref="mappingResourceFactory"/>
+ <property name="persistentClassMappings" ref="persistentMappings"/>
+ <property name="validatorMappings" ref="validatorMappings"/>
+ <property name="collatorFactory" ref="collatorFactory"/>
+ <property name="repositoryListeners">
+ <list></list>
+ </property>
+ <property name="securityChecker" ref="internalRepositoryServiceSecurityChecker"/>
+ <property name="lockFoldersOnPathChange" value="true"/>
+ </bean>
+
+ <bean id="addRepositoryListener" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="hibernateRepositoryService"/>
+ <property name="propertyName" value="repositoryListeners"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <bean id="validatorMappings" class="com.jaspersoft.jasperserver.api.common.service.impl.SimpleClassMappObjectFactory">
+ <property name="mappings">
+ <map>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.Resource"
+ value-ref="defaultResourceValidator"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.common.domain.Folder"
+ value-ref="folderValidator"/>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit"
+ value-ref="reportUnitValidator"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="baseResourceValidator" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.BaseResourceValidator"
+ abstract="true">
+ <property name="repositoryService">
+ <ref bean="internalRepositoryService"/>
+ </property>
+ </bean>
+
+ <bean id="reportUnitValidator" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.ReportUnitValidator"
+ parent="baseResourceValidator">
+ <property name="servletContextInformation" ref="servletContextInformation"/>
+ </bean>
+
+ <bean id="defaultResourceValidator" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.DefaultResourceValidator"
+ parent="baseResourceValidator">
+ </bean>
+
+ <bean id="folderValidator" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.FolderValidator"
+ parent="baseResourceValidator">
+ </bean>
+
+ <bean id="servletContextInformation" class="com.jaspersoft.jasperserver.war.util.ServletContextWrapper">
+ <property name="jspPathPrefix" value="/WEB-INF/jsp/"/>
+ </bean>
+
+ <bean id="hibernateRepoServiceTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="get*">PROPAGATION_REQUIRED</prop>
+ <prop key="find*">PROPAGATION_REQUIRED</prop>
+ <prop key="createFolder">PROPAGATION_REQUIRED</prop>
+ <prop key="save*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="move*">PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED</prop>
+ <prop key="copy*">PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="internalRepositoryService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces"><value>com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService</value></property>
+ <property name="interceptorNames">
+ <list>
+ <idref local="hibernateRepoServiceTransactionInterceptor"/>
+ <idref bean="hibernateRepoServiceSecurity"/>
+ <idref local="hibernateRepositoryService"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- this bean is for a repository service connection without object level security -->
+ <bean id="unsecureRepositoryService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces">
+ <value>com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryService</value>
+ </property>
+ <property name="interceptorNames">
+ <list>
+ <idref bean="hibernateRepoServiceTransactionInterceptor"/>
+ <idref bean="hibernateRepositoryService"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="repositoryService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces"><value>com.jaspersoft.jasperserver.api.metadata.common.service.RepositoryService</value></property>
+ <property name="interceptorNames">
+ <list>
+ <idref local="hibernateRepoServiceTransactionInterceptor"/>
+ <idref bean="hibernateRepoServiceSecurity"/>
+ <idref local="hibernateRepositoryService"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="beanForInterfaceFactory" class="com.jaspersoft.jasperserver.api.common.service.impl.BeanForInterfaceFactoryImpl"/>
+
+ <bean id="dataSourceServiceFactories" class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceFactoryImpl">
+ <property name="factory">
+ <ref bean="beanForInterfaceFactory"/>
+ </property>
+ <property name="serviceDefinitionMap">
+ <map>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JdbcReportDataSource">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="jdbcDataSourceServiceFactory"/>
+ <property name="supportedQueryLanguages">
+ <set>
+ <value>sql</value>
+ <value>SQL</value>
+ </set>
+ </property>
+ </bean>
+ </entry>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JndiJdbcReportDataSource">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="jndiJdbcDataSourceServiceFactory"/>
+ <property name="supportedQueryLanguages">
+ <set>
+ <value>sql</value>
+ <value>SQL</value>
+ </set>
+ </property>
+ </bean>
+ </entry>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.BeanReportDataSource">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="beanDataSourceServiceFactory"/>
+ <property name="anyLanguage" value="true"/>
+ </bean>
+ </entry>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.CustomReportDataSource">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="customDataSourceServiceFactory"/>
+ <property name="anyLanguage" value="true"/>
+ </bean>
+ </entry>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.MondrianConnection">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="olapConnectionService"/>
+ <property name="supportedQueryLanguages">
+ <set>
+ <value>mdx</value>
+ <value>MDX</value>
+ </set>
+ </property>
+ </bean>
+ </entry>
+ <entry key="com.jaspersoft.jasperserver.api.metadata.olap.domain.XMLAConnection">
+ <bean class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.DataSourceServiceDefinition">
+ <property name="serviceBeanName" value="olapConnectionService"/>
+ <property name="supportedQueryLanguages">
+ <set>
+ <value>mdx</value>
+ <value>MDX</value>
+ </set>
+ </property>
+ </bean>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="dataSourceObjectPoolFactory" class="org.apache.commons.pool.impl.GenericObjectPoolFactory">
+ <constructor-arg type="org.apache.commons.pool.PoolableObjectFactory"><null/></constructor-arg>
+ <constructor-arg type="int" value="5"/>
+ </bean>
+
+ <bean id="dbcpJdbcDataSourceFactory" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory">
+ <property name="objectPoolFactory">
+ <ref bean="dataSourceObjectPoolFactory"/>
+ </property>
+ </bean>
+
+ <bean id="jdbcDataSourceServiceFactory" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory">
+ <property name="pooledJdbcDataSourceFactory">
+ <ref bean="dbcpJdbcDataSourceFactory"/>
+ </property>
+ <property name="poolTimeout" value="900"/>
+ </bean>
+
+ <bean id="jndiJdbcDataSourceServiceFactory" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JndiJdbcReportDataSourceServiceFactory"/>
+
+ <bean id="beanDataSourceServiceFactory" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.BeanReportDataSourceServiceFactory"/>
+
+ <bean id="customDataSourceServiceFactory" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.CustomReportDataSourceServiceFactory"/>
+
+ <bean id="hibernateRepositoryCacheBean" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryCache">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="repository">
+ <ref bean="internalRepositoryService"/>
+ </property>
+ </bean>
+
+ <bean id="hibernateRepositoryCacheTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="cache*">PROPAGATION_REQUIRED</prop>
+ <prop key="clearCache*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <!-- FIXME remove this once locking is implemented (see Bugzilla 10218) -->
+ <bean id="hibernateRepositoryCacheReattemptInterceptor"
+ class="com.jaspersoft.jasperserver.api.common.util.spring.ReattemptMethodInterceptor">
+ <property name="reattemptAttributes">
+ <bean class="com.jaspersoft.jasperserver.api.common.util.spring.MapNameMethodAttributes">
+ <property name="methodAttributes">
+ <map>
+ <entry key="cache">
+ <bean class="com.jaspersoft.jasperserver.api.common.util.spring.ExceptionTypesReattemptAttributes">
+ <property name="exceptionTypes">
+ <list>
+ <value>org.springframework.dao.DataIntegrityViolationException</value>
+ </list>
+ </property>
+ <property name="attemptCount" value="3"/>
+ </bean>
+ </entry>
+ </map>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <bean id="hibernateRepositoryCache" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="interceptorNames">
+ <list>
+ <idref local="hibernateRepositoryCacheReattemptInterceptor"/>
+ <idref local="hibernateRepositoryCacheTransactionInterceptor"/>
+ <idref local="hibernateRepositoryCacheBean"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="engineService" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl" destroy-method="release">
+ <property name="repositoryService">
+ <ref bean="repositoryService"/>
+ </property>
+ <property name="dataSourceServiceFactories">
+ <ref bean="dataSourceServiceFactories"/>
+ </property>
+ <property name="compiledReportsCache">
+ <ref bean="hibernateRepositoryCache"/>
+ </property>
+ <property name="securityContextProvider" ref="securityContextProvider"/>
+ <property name="loggedInUserReportParameterName" value="LoggedInUser"/>
+ <property name="reportParameterLabelKeyPrefix" value="net.sf.jasperreports.prompt.label."/>
+ </bean>
+
+ <bean id="profileAttributeServiceTarget"
+ class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.ProfileAttributeServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="objectMappingFactory" ref="mappingResourceFactory"/>
+ <property name="persistentClassFactory" ref="persistentMappings"/>
+ <property name="repositoryService" ref="internalRepositoryService"/>
+ </bean>
+
+ <bean id="profileAttributeService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="target" ref="profileAttributeServiceTarget"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="get*">PROPAGATION_REQUIRED</prop>
+ <prop key="find*">PROPAGATION_REQUIRED</prop>
+ <prop key="load*">PROPAGATION_REQUIRED</prop>
+ <prop key="put*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="userAuthorityServiceTarget"
+ class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="objectMappingFactory" ref="mappingResourceFactory"/>
+ <property name="persistentClassFactory" ref="persistentMappings"/>
+ <property name="profileAttributeService" ref="profileAttributeService"/>
+ <property name="defaultInternalRoles">
+ <list>
+ <value>ROLE_AUTHENTICATED</value>
+ </list>
+ </property>
+ <property name="tenantPersistenceResolver"><ref bean="hibernateTenantService"/></property>
+ </bean>
+
+ <bean id="userAuthorityServiceTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="get*">PROPAGATION_REQUIRED</prop>
+ <prop key="find*">PROPAGATION_REQUIRED</prop>
+ <prop key="load*">PROPAGATION_REQUIRED</prop>
+ <prop key="put*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="remove*">PROPAGATION_REQUIRED</prop>
+ <prop key="addRole*">PROPAGATION_REQUIRED</prop>
+ <prop key="enableUser*">PROPAGATION_REQUIRED</prop>
+ <prop key="disableUser*">PROPAGATION_REQUIRED</prop>
+ <prop key="maintainInternalUser">PROPAGATION_REQUIRED</prop>
+ <prop key="assignUsers">PROPAGATION_REQUIRED</prop>
+ <prop key="unassignUsers">PROPAGATION_REQUIRED</prop>
+ <prop key="update*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="userAuthorityService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces">
+ <value>com.jaspersoft.jasperserver.api.metadata.user.service.UserAuthorityService</value>
+ </property>
+ <property name="interceptorNames">
+ <list>
+ <idref local="userAuthorityServiceTransactionInterceptor"/>
+ <idref local="userAuthorityServiceTarget"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="internalUserAuthorityService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="interceptorNames">
+ <list>
+ <idref local="userAuthorityServiceTransactionInterceptor"/>
+ <idref local="userAuthorityServiceTarget"/>
+ </list>
+ </property>
+ </bean>
+
+
+ <bean id="tenantServiceTarget"
+ class="com.jaspersoft.jasperserver.api.metadata.tenant.service.impl.TenantServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="objectMappingFactory" ref="mappingResourceFactory"/>
+ <property name="persistentClassFactory" ref="persistentMappings"/>
+ <property name="userOrgIdDelimiter">
+ <value>|</value>
+ </property>
+ </bean>
+
+ <bean id="tenantServiceTransactionInterceptor"
+ class="org.springframework.transaction.interceptor.TransactionInterceptor">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="put*">PROPAGATION_REQUIRED</prop>
+ <prop key="update*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="hibernateTenantService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="interceptorNames">
+ <list>
+ <idref local="tenantServiceTransactionInterceptor"/>
+ <idref local="tenantServiceTarget"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="tenantService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="proxyInterfaces" value="com.jaspersoft.jasperserver.api.metadata.user.service.TenantService"/>
+ <property name="interceptorNames">
+ <list>
+ <value>hibernateTenantService</value>
+ </list>
+ </property>
+ </bean>
+
+
+ <bean id="objectPermissionServiceTarget"
+ class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.ObjectPermissionServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="objectMappingFactory" ref="mappingResourceFactory"/>
+ <property name="persistentClassFactory" ref="persistentMappings"/>
+ <property name="repositoryService" ref="internalRepositoryService"/>
+ <property name="userAuthorityService" ref="internalUserAuthorityService"/>
+ <property name="effectiveAclsResolver">
+ <bean class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.ObjectPermissionEffectiveAclsResolver"/>
+ </property>
+ <property name="basicAclEntryCache">
+ <bean class="org.acegisecurity.acl.basic.cache.EhCacheBasedAclEntryCache">
+ <property name="cache">
+ <ref local="aclCache"/>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- Setup a cache for ACLs -->
+ <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
+ <property name="configLocation">
+ <value>/WEB-INF/ehcache.xml</value>
+ </property>
+ </bean>
+
+ <bean id="aclCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+ <property name="cacheManager">
+ <ref local="cacheManager"/>
+ </property>
+ <property name="cacheName">
+ <value>aclCache</value>
+ </property>
+ </bean>
+
+ <bean id="objectPermissionServiceTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="get*">PROPAGATION_REQUIRED</prop>
+ <prop key="find*">PROPAGATION_REQUIRED</prop>
+ <prop key="load*">PROPAGATION_REQUIRED</prop>
+ <prop key="put*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="objectPermissionService" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="interceptorNames">
+ <list>
+ <idref local="objectPermissionServiceTransactionInterceptor"/>
+ <idref local="objectPermissionServiceTarget"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="objectPermissionServiceInternal" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="target" ref="objectPermissionServiceTarget"/>
+ <property name="transactionAttributes">
+ <props>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="update*">PROPAGATION_REQUIRED</prop>
+ <prop key="get*">PROPAGATION_REQUIRED</prop>
+ <prop key="find*">PROPAGATION_REQUIRED</prop>
+ <prop key="load*">PROPAGATION_REQUIRED</prop>
+ <prop key="put*">PROPAGATION_REQUIRED</prop>
+ <prop key="delete*">PROPAGATION_REQUIRED</prop>
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="objectPermissionsRepositoryListener" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.ObjectPermissionsRepositoryListener">
+ <property name="permissionsService" ref="objectPermissionServiceInternal"/>
+ </bean>
+
+ <bean class="com.jaspersoft.jasperserver.api.metadata.common.service.ResourceEventListenerProcessor" lazy-init="false">
+ <property name="registry" ref="metadataRepositoryDeleteListener"/>
+ <property name="listenerBeanName" value="objectPermissionsRepositoryListener"/>
+ </bean>
+
+ <bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater" lazy-init="false">
+ <property name="definition" ref="addRepositoryListener"/>
+ <property name="valueRef" value="objectPermissionsRepositoryListener"/>
+ </bean>
+
+ <bean id="objectPermissionsUserAuthorityDeleteListener" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.HibernateObjectPermissionUserAuthorityDeleteListener">
+ <property name="objectPermissionsServiceBeanName" value="objectPermissionServiceInternal"/>
+ </bean>
+
+ <!-- i18n -->
+ <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
+ <property name="useCodeAsDefaultMessage" value="true"/>
+ <property name="cacheSeconds" value="15"/>
+ <property name="basenames">
+ <list>
+ <value>WEB-INF/bundles/jasperserver_messages</value>
+ <value>WEB-INF/bundles/jasperserver_config</value>
+ <value>WEB-INF/bundles/jpivot_messages</value>
+ <value>WEB-INF/internal/jpivot_internal_messages</value>
+ <value>WEB-INF/internal/jasperserver</value>
+ <value>WEB-INF/bundles/calendar</value>
+ <value>WEB-INF/bundles/jsexceptions_messages</value>
+ <value>WEB-INF/bundles/scheduling_ws</value>
+ <value>WEB-INF/bundles/ja-pro_messages</value>
+ <value>WEB-INF/internal/ja-pro_internal_messages</value>
+ <value>WEB-INF/bundles/ja_mondrian_messages</value>
+ <value>WEB-INF/bundles/mondrian_exception_messages</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="messagesCalendarFormatProvider" class="com.jaspersoft.jasperserver.war.util.MessagesCalendarFormatProvider">
+ <property name="messages" ref="messageSource"/>
+ <property name="datePatternKey" value="date.format"/>
+ <property name="calendarDatePatternKey" value="calendar.date.format"/>
+ <property name="datetimePatternKey" value="datetime.format"/>
+ <property name="calendarDatetimePatternKey" value="calendar.datetime.format"/>
+ <property name="lenientFormats" value="false"/>
+ </bean>
+
+ <!-- handle file uploads using commons-fileupload
+ <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
+ -->
+
+ <bean id="engineCacheDeleteListener" class="com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineCacheDeleteListener">
+ <property name="engine" ref="engineService"/>
+ </bean>
+
+ <bean class="com.jaspersoft.jasperserver.api.metadata.common.service.ResourceEventListenerProcessor" lazy-init="false">
+ <property name="registry" ref="metadataRepositoryDeleteListener"/>
+ <property name="listenerBeanName" value="engineCacheDeleteListener"/>
+ </bean>
+
+ <bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater" lazy-init="false">
+ <property name="definition" ref="addRepositoryListener"/>
+ <property name="valueRef" value="engineCacheDeleteListener"/>
+ </bean>
+
+ <bean id="securityContextProviderTarget" class="com.jaspersoft.jasperserver.api.engine.common.service.impl.AcegiSecurityContextProvider">
+ <property name="userDetailsService" ref="internalUserAuthorityService"/>
+ <property name="userAuthorityService" ref="internalUserAuthorityService"/>
+ </bean>
+
+ <bean id="securityContextProvider" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="interceptorNames">
+ <list>
+ <idref local="securityContextProviderTarget"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="hyperlinkDateParameterFormatter" class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.HyperlinkDateParameterFormatter">
+ <property name="pattern" value="yyyyMMddHHmmss"/>
+ </bean>
+
+
+ <bean id="encodingProvider" class="com.jaspersoft.jasperserver.api.common.util.StaticCharacterEncodingProvider">
+ <constructor-arg value="UTF-8"/>
+ </bean>
+
+ <bean id="characterEncodingFilter" class="com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter">
+ <property name="encodingProvider" ref="encodingProvider"/>
+ <property name="encodingRequestAttrName" value="com.jaspersoft.ji.characterEncoding"/>
+ </bean>
+
+ <!-- Make maxSize bigger if you are displaying dashboards with 10+ frames and you are getting image loading problems -->
+ <bean id="jasperPrintAccessor" class="com.jaspersoft.jasperserver.war.util.LRUSessionObjectAccessor">
+ <property name="listSessionName" value="jasperPrintSerie"/>
+ <property name="maxSize" value="10"/>
+ </bean>
+
+ <bean id="baseReportExecutionHyperlinkProducer" class="com.jaspersoft.jasperserver.api.engine.jasperreports.util.BaseReportExecutionHyperlinkProducerFactory"
+ abstract="true">
+ <property name="flowControllerMapping" value="/flow.html"/>
+ <property name="reportExecutionFlowId" value="viewReportFlow"/>
+ <property name="hyperlinkParameterReportUnit" value="_report"/>
+ <property name="urlParameterReportUnit" value="reportUnit"/>
+ <property name="hyperlinkParameterOutputChannel" value="_output"/>
+ <property name="urlParameterOutputChannel" value="output"/>
+ <property name="dateFormatter" ref="hyperlinkDateParameterFormatter"/>
+ <property name="encodingProvider" ref="encodingProvider"/>
+ </bean>
+
+ <bean id="reportExecutionHyperlinkProducer" class="com.jaspersoft.jasperserver.war.action.hyperlinks.ReportExecutionHyperlinkProducerFactory"
+ parent="baseReportExecutionHyperlinkProducer">
+ <property name="attributeReportLocale" value="reportExecutionLocale"/>
+ <property name="urlParameterReportLocale" value="reportLocale"/>
+ </bean>
+
+ <bean id="localPageHyperlinkProducerFactory" class="com.jaspersoft.jasperserver.war.action.hyperlinks.LocalPageHyperlinkProducerFactory">
+ <property name="navigateToPageFunction" value="navigateToReportPage"/>
+ </bean>
+
+ <bean id="localAnchorHyperlinkProducerFactory" class="com.jaspersoft.jasperserver.war.action.hyperlinks.LocalAnchorHyperlinkProducerFactory">
+ <property name="jasperPrintNameRequestAttribute" value="jasperPrintName"/>
+ <property name="flowControllerMapping" value="/flow.html"/>
+ <property name="navigateEventID" value="navigate"/>
+ <property name="pageIndexParameter" value="pageIndex"/>
+ <property name="jasperPrintAccessor" ref="jasperPrintAccessor"/>
+ </bean>
+
+ <bean id="viewReportHyperlinkProducerFactory" class="com.jaspersoft.jasperserver.war.action.hyperlinks.MapHyperlinkProducerFactoryFlowFactory">
+ <property name="flowHyperlinkProducers">
+ <map>
+ <entry key="ReportExecution" value-ref="reportExecutionHyperlinkProducer"/>
+ <entry key="LocalPage" value-ref="localPageHyperlinkProducerFactory"/>
+ <entry key="LocalAnchor" value-ref="localAnchorHyperlinkProducerFactory"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="swfReportExecutionHyperlinkProducer" class="com.jaspersoft.jasperserver.war.action.hyperlinks.ReportExecutionHyperlinkProducerFactory"
+ parent="reportExecutionHyperlinkProducer">
+ <property name="defaultOutputChannel" value="swf"/>
+ </bean>
+
+ <bean id="swfReportHyperlinkProducerFactory" class="com.jaspersoft.jasperserver.war.action.hyperlinks.MapHyperlinkProducerFactoryFlowFactory">
+ <property name="flowHyperlinkProducers">
+ <map>
+ <entry key="ReportExecution" value-ref="swfReportExecutionHyperlinkProducer"/>
+ </map>
+ </property>
+ </bean>
+
+ <bean id="collatorFactory" class="com.jaspersoft.jasperserver.api.common.util.DefaultCollatorFactory"/>
+
+ <bean id="configurationBean" class="com.jaspersoft.jasperserver.war.common.ConfigurationBean">
+ <!-- constants -->
+ <property name="paginatorItemsPerPage" value="20"></property>
+ <property name="paginatorPagesRange" value="3"></property>
+ <property name="reportLevelConfigurable" value="false"/>
+ <property name="paginationForSinglePageReport" value="false"/>
+
+ <!-- referenced beans -->
+ <property name="messages">
+ <ref bean="messageSource"/>
+ </property>
+
+ <property name="userItemsPerPage" value="20"/>
+ <property name="roleItemsPerPage" value="20"/>
+
+ <property name="calendarInputJsp" value="/WEB-INF/jsp/CalendarInput.jsp"/>
+
+ <property name="userNameSeparator" value="|" />
+
+ <!--Must contain userNameSeparator as well-->
+ <property name="userNameNotSupportedSymbols">
+ <value><![CDATA[[\|\s`"'~!#\u0024%\^&,*\+=;:?<>}{)(\]\[/]]]></value>
+ </property>
+ <property name="roleNameNotSupportedSymbols">
+ <value><![CDATA[[\|\s`"'~!#\u0024%\^&,*\+=;:?<>}{)(\]\[/]]]></value>
+ </property>
+ <property name="defaultRole" value="ROLE_USER" />
+ <property name="passwordMask" value="*" />
+ <property name="viewReportsFilterList">
+ <list>
+ <value><![CDATA[^(/organizations/[^/]+)*(/temp/|/adhoc/topics/)]]></value>
+ <value><![CDATA[^/public/adhoc/topics/]]></value>
+ <value><![CDATA[^(/organizations/[^/]+)*(/organizations/org_template/)]]></value>
+ </list>
+ </property>
+ <property name="tenantNameNotSupportedSymbols">
+ <value><![CDATA[[\|&*?<>/\\]]]></value>
+ </property>
+ <property name="tenantIdNotSupportedSymbols">
+ <value><![CDATA[[~!#\$%\^\|\s]]]></value>
+ </property>
+ <property name="publicFolderUri">
+ <value><![CDATA[/public]]></value>
+ </property>
+ </bean>
+
+ <!-- report virtualizers -->
+ <bean id="fileVirtualizerFactory" class="com.jaspersoft.jasperserver.api.engine.common.service.impl.FileVirtualizerFactory">
+ <property name="maxSize" value="300"></property>
+ <property name="directory" value="${java.io.tmpdir}"></property>
+ </bean>
+
+ <!-- resources bean for jpivot -->
+ <bean id="jpivot-resources" class="com.tonbeller.tbutils.res.Resources">
+ <property name="resourceBundle">
+ <ref bean="messageSource"/>
+ </property>
+ <property name="encodingProvider">
+ <ref bean="encodingProvider"/>
+ </property>
+ </bean>
+
+ <!-- updater definitions so other bean files can add items to beans defined here,
+ instead of running tweakWar.js or manually hacking
+ -->
+
+ <!-- add hibernate hbm.xml -->
+ <bean id="addHibernateConfig" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="sessionFactory"/>
+ <property name="propertyName" value="mappingResources"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- map an interface to a client impl -->
+ <bean id="mapClientClass" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="mappingResourceFactory"/>
+ <property name="propertyName" value="implementationClassMappings"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- map an interface to a repo impl -->
+ <bean id="mapRepoClass" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="persistentMappings"/>
+ <property name="propertyName" value="implementationClassMappings"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- add a message catalog -->
+ <bean id="addMessageCatalog" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="messageSource"/>
+ <property name="propertyName" value="basenames"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- map a new datasource to factory -->
+ <bean id="mapDataSources" class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdaterDefinition">
+ <property name="order" value="10"/>
+ <property name="beanName" value="dataSourceServiceFactories"/>
+ <property name="propertyName" value="serviceDefinitionMap"/>
+ <property name="operation" value="append"/>
+ </bean>
+
+ <!-- export parameters -->
+
+ <bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean">
+ <property name="detectCellType" value="true"/>
+ <property name="onePagePerSheet" value="false"/>
+ <property name="removeEmptySpaceBetweenRows" value="true"/>
+ <property name="removeEmptySpaceBetweenColumns" value="true"/>
+ <property name="whitePageBackground" value="false"/>
+ <property name="ignoreGraphics" value="true"/>
+ <property name="collapseRowSpan" value="true"/>
+ <property name="ignoreCellBorder" value="true"/>
+ <property name="fontSizeFixEnabled" value="true"/>
+ <property name="maximumRowsPerSheet" value="0"/>
+ <property name="xlsFormatPatternsMap" ref="formatPatternsMap"/>
+ </bean>
+
+ <bean id="csvExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.CsvExportParametersBean">
+ <property name="fieldDelimiter" value=","/>
+ </bean>
+
+ <bean id="pdfExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.PdfExportParametersBean">
+ <property name="localizedFontMap" ref="localePdfFontMap"/>
+ </bean>
+
+ <util:map id="formatPatternsMap">
+ <!-- entry key="¤ #,##0.00" value="$ #,##0.00"/-->
+ </util:map>
+
+ <!-- end export parameters -->
+
+ <import resource="pdfFontBeans.xml"/>
+
+ <bean id="userTimeZonesList" class="com.jaspersoft.jasperserver.war.common.JdkTimeZonesList">
+ <property name="timeZonesIds">
+ <list>
+ <value>America/Los_Angeles</value>
+ <value>America/Denver</value>
+ <value>America/Chicago</value>
+ <value>America/New_York</value>
+ <value>Europe/London</value>
+ <value>Europe/Berlin</value>
+ <value>Europe/Bucharest</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="roleManagerService" class="com.jaspersoft.jasperserver.api.metadata.user.service.impl.RoleManagerServiceImpl">
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="transactionManager" ref="transactionManager"/>
+ <property name="userService">
+ <ref bean="userAuthorityService"/>
+ </property>
+ </bean>
+
+ <bean id="standardUserPersistenceHandler"
+ class="com.jaspersoft.jasperserver.api.engine.common.user.StandardUserPersistenceHandler">
+ <property name="securityContextProvider" ref="securityContextProvider"/>
+ <property name="userPersistenceService" ref="internalUserAuthorityService"/>
+ </bean>
+
+</beans>
--- /dev/null
+\r
+#\r
+# CAS Server properties\r
+#\r
+\r
+CAS_HOST=www.cartabledesavoie.com\r
+CAS_PORT=443\r
+\r
+#\r
+# CAS Proxy Validation\r
+# \r
+\r
+CAS_PROXY_HOST=eddv-cg73-cart-front.eolas-services.com\r
+CAS_PROXY_PORT=443\r
+\r
+\r
+#\r
+# Service properties\r
+#\r
+\r
+SERVICE_HOST=www.cartabledesavoie.com\r
+SERVICE_PORT=443\r
+WEBAPP_CONTAINER=jasperserver\r
+\r
+#\r
+# LDAP Server properties\r
+#\r
+\r
+ldap.host=10.66.137.11\r
+ldap.port=389\r
+ldap.basesuffix=dc=cartabledesavoie,dc=com\r
+ldap.userbase=ou=people\r
+ldap.groupbase=ou=groups\r
+ldap.managerDn=cn=admin,dc=cartabledesavoie,dc=com\r
+ldap.managerPwd=secret\r
+ldap.loginAttr=ENTPersonLogin\r
+ldap.groupId=businessCategory\r
+ldap.memberStyle=member\r
--- /dev/null
+<%--\r
+ Copyright (C) 2005 - 2007 JasperSoft Corporation. All rights reserved.\r
+ http://www.jaspersoft.com.\r
+\r
+ Unless you have purchased a commercial license agreement from JasperSoft,\r
+ the following license terms apply:\r
+\r
+ This program is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License version 2 as published by\r
+ the Free Software Foundation.\r
+\r
+ This program is distributed WITHOUT ANY WARRANTY; and without the\r
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
+ See the GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, see http://www.gnu.org/licenses/gpl.txt\r
+ or write to:\r
+\r
+ Free Software Foundation, Inc.,\r
+ 59 Temple Place - Suite 330,\r
+ Boston, MA USA 02111-1307\r
+--%>\r
+<%@ taglib prefix="spring" uri="/spring" %>\r
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>\r
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>\r
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>\r
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz"%>\r
+<decorator:usePage id="thePage" />\r
+<c:set var="pageProperties" value="${thePage.properties}"/>\r
+<c:choose>\r
+ <c:when test="${pageProperties['meta.formName']!=null}"><c:set var="formName" value="${pageProperties['meta.formName']}"/></c:when>\r
+ <c:otherwise><c:set var="formName" value="mainForm"/></c:otherwise>\r
+</c:choose>\r
+<c:choose>\r
+ <c:when test="${pageProperties['meta.formMethod']!=null}"><c:set var="formMethod" value="${pageProperties['meta.formMethod']}"/></c:when>\r
+ <c:otherwise><c:set var="formMethod" value="GET"/></c:otherwise>\r
+</c:choose>\r
+<c:set var="pageType" value="${pageProperties['meta.pageType']}"/>\r
+<c:choose>\r
+<c:when test="${pageType!='popup' and (empty param['decorate'] or param['decorate'] == 'yes')}">\r
+ <html>\r
+ <head>\r
+ <title><spring:message code='jsp.main.title'/></title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=${requestScope['com.jaspersoft.ji.characterEncoding']}">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/stylesheet.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/dialog.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/jpivot/table/mdxtable.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/jpivot/navi/mdxnavi.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/form/xform.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/table/xtable.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/tree/xtree.css" rel="stylesheet" type="text/css">\r
+ <jsp:include page="/cal/calendar.jsp" flush="true"/>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/prototype.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/jasperserver.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/ajax.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/common.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/common-utils.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/drag.js"></script>\r
+ <decorator:head />\r
+ </head>\r
+\r
+ <%-- NOTE: Edit the file JI-menu.xml to control menu items content --%>\r
+\r
+ <body style="color: black; background-color: white; margin-left: 2px; margin-right: 2px; margin-top: 2px;">\r
+\r
+ <!-- DYNAMICALLY GENERATED JAVASCRIPT TO SHOW POPDOWN MENUS FOR SUBITEMS -->\r
+ <script>\r
+ function initmenu(div_id) {\r
+ var d = document.getElementById(div_id);\r
+ <c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <c:if test="${menuItem.hasSubItems}">\r
+ if (document.getElementById('jsmenu${status.count}')) {\r
+ document.getElementById('jsmenu${status.count}').style.display='none';\r
+ }\r
+ </c:if>\r
+ </c:forEach>\r
+ if (d) {d.style.display='block';}\r
+ }\r
+\r
+\r
+ function hideAllDropDowmMenu() {\r
+ for (var i=0; i<5; i++) {\r
+ var curDropDownMenu = document.getElementById("jsmenu" + i);\r
+ if (curDropDownMenu) {\r
+ curDropDownMenu.style.display = "none";\r
+ }\r
+ }\r
+ }\r
+\r
+ window.onload=initmenu;\r
+ </script>\r
+\r
+ <table id="mainTable" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" valign="top">\r
+ <tr onmouseover="hideAllDropDowmMenu()" onmouseout="hideAllDropDowmMenu()">\r
+ <td valign="top" width="100%">\r
+ \r
+<!-- SECTION COMMENTED BY PENTILA : REMOVE HEADER -->\r
+\r
+<!-- <table bgcolor="#e9e8de" border="0" cellpadding="0" cellspacing="0" width="100%" cols="5">\r
+ <tr valign="top">\r
+ <td colspan="5" bgcolor="#000033"><img src="${pageContext.request.contextPath}/images/pixel.gif" height="1"></td>\r
+ </tr>\r
+ <tr>\r
+\r
+ <td style="border-left: 1px solid rgb(0, 0, 51);" valign="middle" align="left" width="150"><a href="http://www.jaspersoft.com/"><img src="${pageContext.request.contextPath}/images/jaspersoft-logo.gif" hspace="4" border="0" width="129" height="28"></a></td>\r
+ <td valign="middle" align="left" height="60"></td>\r
+ <td colspan="2"> \r
+ <authz:authorize ifNotGranted="ROLE_ANONYMOUS">\r
+ <spring:message code="jsp.main.welcome"/>\r
+ <c:if test="<%= com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.isUserSwitched() %>">\r
+ <%= ((com.jaspersoft.jasperserver.api.metadata.user.domain.User)com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.getSourceAuthentication().getPrincipal()).getFullName() %>\r
+ <spring:message code="jsp.main.as"/>\r
+ </c:if>\r
+ <authz:authentication operation="fullName"/><spring:message code="jsp.main.exclamation.mark"/>\r
+ </authz:authorize>\r
+ </td>\r
+\r
+ <td width="135"><a href="http://jasperforge.org/"><img src="${pageContext.request.contextPath}/images/jasperforge-logo.gif" border="0" height="27" hspace="10" width="139"></a></td>\r
+ </tr>\r
+ <tr valign="top">\r
+ <td colspan="5" bgcolor="#000033"><img src="${pageContext.request.contextPath}/images/pixel.gif" height="1"></td>\r
+ </tr>\r
+ </table>\r
+\r
+-->\r
+\r
+ </td>\r
+ </tr>\r
+\r
+ <!-- CODE FOR HORIZONTAL MENU ITEMS -->\r
+\r
+<!-- SECTION COMMENTED BY PENTILA -->\r
+\r
+<!--\r
+ <c:choose>\r
+ <c:when test="${pageProperties['meta.noMenu']==null}">\r
+ <tr bgcolor="#c2c4b6" style="height:17;" valign="top">\r
+ <td width="100%" style="border-left: 1px solid rgb(0, 0, 51);">\r
+ <table cellpadding=0 cellspacing=2 cols="6" rows="1">\r
+ <tr>\r
+<c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <c:set var="cellStyle" value='${menuItem.url==null?"padding-left:3px; FONT-WEIGHT:normal; FONT-SIZE:7pt; COLOR: #FFFFFF; TEXT-DECORATION: none;":"padding-left:3px;"}'/>\r
+ <authz:authorize ifAnyGranted="${menuItem.rolesStr}">\r
+ <td id="href${status.count}" bgcolor="#000033" width="150" style="${cellStyle}" onMouseOver="javascript:initmenu(<c:if test="${menuItem.hasSubItems}">'jsmenu${status.count}'</c:if>);" nowrap><c:if test="${menuItem.url!=null}"><a class="fwhite" href="<c:url value="${menuItem.url}?${empty menuItem.servletParams ?'':'&'}curlnk=${status.count}"/>"></c:if> <spring:message code="${menuItem.name}"/><c:if test="${menuItem.url!=null}"></a></c:if></td>\r
+ </authz:authorize>\r
+</c:forEach>\r
+ \r
+ <td width="150" onMouseOver="javascript:initmenu();" nowrap> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </c:when>\r
+ <c:otherwise>\r
+ </c:otherwise>\r
+ </c:choose>\r
+-->\r
+ <!-- END CODE FOR HORIZONTAL MENU ITEMS -->\r
+\r
+ <tr>\r
+ <td valign="top" width="100%" height="100%" style="border-left: 1px solid rgb(0, 0, 51);">\r
+ <decorator:body />\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td style="border-left: 1px solid rgb(0, 0, 51); border-bottom: 1px solid rgb(0, 0, 51); background-color: rgb(114, 115, 110); vertical-align: middle;" height="25">\r
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td align="center"><font class="fsmall" color="white"><spring:message code='decorators.main.copyright'/></font></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <!-- CODE FOR HZL MENU SUBMENU ITEMS -->\r
+<c:if test="${pageProperties['meta.noMenu']==null}">\r
+ <c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <authz:authorize ifAnyGranted="${menuItem.rolesStr}">\r
+ <c:if test="${menuItem.hasSubItems}">\r
+ <div id="jsmenu${status.count}" style="position: absolute; width: 156; left: ${status.index*156}; z-index: 90; top: 80; display: none;" onMouseOver="initmenu('jsmenu${status.count}');" onMouseOut="initmenu();">\r
+ <table cellpadding="0" cellspacing="1" bgcolor="#c2c4b6" align="left" valign="middle" cols="1" width="100%">\r
+ <c:forEach items="${menuItem.subItems}" var="subItem">\r
+ <authz:authorize ifAnyGranted="${subItem.rolesStr}">\r
+ <tr>\r
+ <td id="href${status.count}" bgcolor="#000033" style="padding-left:3px;" height="12" nowrap><a class="fwhite" href="<c:url value="${subItem.url}?${subItem.servletParams}${empty subItem.servletParams ? '' : '&'}curlnk=${status.count}"/>"> <spring:message code="${subItem.name}"/></a></td>\r
+ </tr>\r
+ </authz:authorize>\r
+ </c:forEach>\r
+ </table>\r
+ </div>\r
+ </c:if>\r
+ </authz:authorize>\r
+ </c:forEach>\r
+</c:if>\r
+ <!-- END CODE FOR HZL MENU SUBMENU ITEMS -->\r
+\r
+ <!-- JAVASCRIPT FOR HIGHLIGHTING THE APPROPRIATE MENU HEADER -->\r
+ <script>\r
+ var linkobject = null;\r
+ var currlinkvalue = "${param.curlnk}";\r
+ for(ix = 1; ix <= <%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems().length %>; ix++) {\r
+ linkobject = document.getElementById("href"+ix);\r
+ if(linkobject) {\r
+ if(currlinkvalue == ix) {\r
+ linkobject.style.background="#666666";\r
+ } else {\r
+ linkobject.style.background="#000033";\r
+ }\r
+ }\r
+ }\r
+\r
+ </script>\r
+\r
+<%\r
+ com.jaspersoft.jasperserver.war.common.HeartbeatBean heartbeat = (com.jaspersoft.jasperserver.war.common.HeartbeatBean)\r
+ application.getAttribute("heartbeatBean");\r
+%>\r
+<authz:authorize ifAnyGranted="ROLE_ADMINISTRATOR">\r
+<%\r
+ if (heartbeat != null && heartbeat.haveToAskForPermissionNow())\r
+ {\r
+%>\r
+ <jsp:include page="../jsp/heartbeatOptin.jsp"/>\r
+<%\r
+ }\r
+%>\r
+</authz:authorize>\r
+<authz:authorize ifAnyGranted="ROLE_USER,ROLE_ADMINISTRATOR">\r
+<%\r
+ if (heartbeat != null && heartbeat.isMakingCalls()\r
+ && session != null \r
+ && session.getAttribute("jsHeartbeatSentClientInfo") == null)\r
+ {\r
+ session.setAttribute("jsHeartbeatSentClientInfo", Boolean.TRUE);\r
+%>\r
+ <jsp:include page="../jsp/heartbeatSendClientInfo.jsp"/>\r
+<%\r
+ }\r
+%>\r
+</authz:authorize>\r
+ </body>\r
+ </html>\r
+ </c:when>\r
+\r
+ <c:otherwise>\r
+ <html>\r
+ <head>\r
+ <title><spring:message code='decorators.main.title'/></title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=${requestScope['com.jaspersoft.ji.characterEncoding']}">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/stylesheet.css" rel="stylesheet" type="text/css">\r
+ <decorator:head />\r
+ </head>\r
+ <body style="color: black; background-color: white; margin-left: 2px; margin-right: 2px; margin-top: 2px;">\r
+ <decorator:body />\r
+ </body>\r
+ </html>\r
+ </c:otherwise>\r
+</c:choose>\r
+\r
--- /dev/null
+<%--\r
+ Copyright (C) 2005 - 2007 JasperSoft Corporation. All rights reserved.\r
+ http://www.jaspersoft.com.\r
+\r
+ Unless you have purchased a commercial license agreement from JasperSoft,\r
+ the following license terms apply:\r
+\r
+ This program is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License version 2 as published by\r
+ the Free Software Foundation.\r
+\r
+ This program is distributed WITHOUT ANY WARRANTY; and without the\r
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
+ See the GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, see http://www.gnu.org/licenses/gpl.txt\r
+ or write to:\r
+\r
+ Free Software Foundation, Inc.,\r
+ 59 Temple Place - Suite 330,\r
+ Boston, MA USA 02111-1307\r
+--%>\r
+<%@ taglib prefix="spring" uri="/spring" %>\r
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>\r
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>\r
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>\r
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz"%>\r
+<decorator:usePage id="thePage" />\r
+<c:set var="pageProperties" value="${thePage.properties}"/>\r
+<c:choose>\r
+ <c:when test="${pageProperties['meta.formName']!=null}"><c:set var="formName" value="${pageProperties['meta.formName']}"/></c:when>\r
+ <c:otherwise><c:set var="formName" value="mainForm"/></c:otherwise>\r
+</c:choose>\r
+<c:choose>\r
+ <c:when test="${pageProperties['meta.formMethod']!=null}"><c:set var="formMethod" value="${pageProperties['meta.formMethod']}"/></c:when>\r
+ <c:otherwise><c:set var="formMethod" value="GET"/></c:otherwise>\r
+</c:choose>\r
+<c:set var="pageType" value="${pageProperties['meta.pageType']}"/>\r
+<c:choose>\r
+<c:when test="${pageType!='popup' and (empty param['decorate'] or param['decorate'] == 'yes')}">\r
+ <html>\r
+ <head>\r
+ <title><spring:message code='jsp.main.title'/></title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=${requestScope['com.jaspersoft.ji.characterEncoding']}">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/stylesheet.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/dialog.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/jpivot/table/mdxtable.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/jpivot/navi/mdxnavi.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/form/xform.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/table/xtable.css" rel="stylesheet" type="text/css">\r
+ <link href="${pageContext.request.contextPath}/wcf/tree/xtree.css" rel="stylesheet" type="text/css">\r
+ <jsp:include page="/cal/calendar.jsp" flush="true"/>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/prototype.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/jasperserver.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/ajax.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/common.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/common-utils.js"></script>\r
+ <script language=JavaScript src="${pageContext.request.contextPath}/scripts/drag.js"></script>\r
+ <decorator:head />\r
+ </head>\r
+\r
+ <%-- NOTE: Edit the file JI-menu.xml to control menu items content --%>\r
+\r
+ <body style="color: black; background-color: white; margin-left: 2px; margin-right: 2px; margin-top: 2px;">\r
+\r
+ <!-- DYNAMICALLY GENERATED JAVASCRIPT TO SHOW POPDOWN MENUS FOR SUBITEMS -->\r
+ <script>\r
+ function initmenu(div_id) {\r
+ var d = document.getElementById(div_id);\r
+ <c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <c:if test="${menuItem.hasSubItems}">\r
+ if (document.getElementById('jsmenu${status.count}')) {\r
+ document.getElementById('jsmenu${status.count}').style.display='none';\r
+ }\r
+ </c:if>\r
+ </c:forEach>\r
+ if (d) {d.style.display='block';}\r
+ }\r
+\r
+\r
+ function hideAllDropDowmMenu() {\r
+ for (var i=0; i<5; i++) {\r
+ var curDropDownMenu = document.getElementById("jsmenu" + i);\r
+ if (curDropDownMenu) {\r
+ curDropDownMenu.style.display = "none";\r
+ }\r
+ }\r
+ }\r
+\r
+ window.onload=initmenu;\r
+ </script>\r
+\r
+ <table id="mainTable" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" valign="top">\r
+ <tr onmouseover="hideAllDropDowmMenu()" onmouseout="hideAllDropDowmMenu()">\r
+ <td valign="top" width="100%">\r
+ <table bgcolor="#e9e8de" border="0" cellpadding="0" cellspacing="0" width="100%" cols="5">\r
+ <tr valign="top">\r
+ <td colspan="5" bgcolor="#000033"><img src="${pageContext.request.contextPath}/images/pixel.gif" height="1"></td>\r
+ </tr>\r
+ <tr>\r
+ <td style="border-left: 1px solid rgb(0, 0, 51);" valign="middle" align="left" width="150"><a href="http://www.jaspersoft.com/"><img src="${pageContext.request.contextPath}/images/jaspersoft-logo.gif" hspace="4" border="0" width="129" height="28"></a></td>\r
+ <td valign="middle" align="left" height="60"></td>\r
+ <td colspan="2"> \r
+ <authz:authorize ifNotGranted="ROLE_ANONYMOUS">\r
+ <spring:message code="jsp.main.welcome"/>\r
+ <c:if test="<%= com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.isUserSwitched() %>">\r
+ <%= ((com.jaspersoft.jasperserver.api.metadata.user.domain.User)com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.getSourceAuthentication().getPrincipal()).getFullName() %>\r
+ <spring:message code="jsp.main.as"/>\r
+ </c:if>\r
+ <authz:authentication operation="fullName"/><spring:message code="jsp.main.exclamation.mark"/>\r
+ </authz:authorize>\r
+ </td>\r
+ <td width="135"><a href="http://jasperforge.org/"><img src="${pageContext.request.contextPath}/images/jasperforge-logo.gif" border="0" height="27" hspace="10" width="139"></a></td>\r
+ </tr>\r
+ <tr valign="top">\r
+ <td colspan="5" bgcolor="#000033"><img src="${pageContext.request.contextPath}/images/pixel.gif" height="1"></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <!-- CODE FOR HORIZONTAL MENU ITEMS -->\r
+ <c:choose>\r
+ <c:when test="${pageProperties['meta.noMenu']==null}">\r
+ <tr bgcolor="#c2c4b6" style="height:17;" valign="top">\r
+ <td width="100%" style="border-left: 1px solid rgb(0, 0, 51);">\r
+ <table cellpadding=0 cellspacing=2 cols="6" rows="1">\r
+ <tr>\r
+<c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <c:set var="cellStyle" value='${menuItem.url==null?"padding-left:3px; FONT-WEIGHT:normal; FONT-SIZE:7pt; COLOR: #FFFFFF; TEXT-DECORATION: none;":"padding-left:3px;"}'/>\r
+ <authz:authorize ifAnyGranted="${menuItem.rolesStr}">\r
+ <td id="href${status.count}" bgcolor="#000033" width="150" style="${cellStyle}" onMouseOver="javascript:initmenu(<c:if test="${menuItem.hasSubItems}">'jsmenu${status.count}'</c:if>);" nowrap><c:if test="${menuItem.url!=null}"><a class="fwhite" href="<c:url value="${menuItem.url}?${empty menuItem.servletParams ?'':'&'}curlnk=${status.count}"/>"></c:if> <spring:message code="${menuItem.name}"/><c:if test="${menuItem.url!=null}"></a></c:if></td>\r
+ </authz:authorize>\r
+</c:forEach>\r
+ <!-- defaultly add the 2 columns -->\r
+ <td width="150" onMouseOver="javascript:initmenu();" nowrap> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </c:when>\r
+ <c:otherwise>\r
+ </c:otherwise>\r
+ </c:choose>\r
+ <!-- END CODE FOR HORIZONTAL MENU ITEMS -->\r
+\r
+ <tr>\r
+ <td valign="top" width="100%" height="100%" style="border-left: 1px solid rgb(0, 0, 51);">\r
+ <decorator:body />\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td style="border-left: 1px solid rgb(0, 0, 51); border-bottom: 1px solid rgb(0, 0, 51); background-color: rgb(114, 115, 110); vertical-align: middle;" height="25">\r
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td align="center"><font class="fsmall" color="white"><spring:message code='decorators.main.copyright'/></font></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <!-- CODE FOR HZL MENU SUBMENU ITEMS -->\r
+<c:if test="${pageProperties['meta.noMenu']==null}">\r
+ <c:forEach varStatus="status" var="menuItem" items="<%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems() %>">\r
+ <authz:authorize ifAnyGranted="${menuItem.rolesStr}">\r
+ <c:if test="${menuItem.hasSubItems}">\r
+ <div id="jsmenu${status.count}" style="position: absolute; width: 156; left: ${status.index*156}; z-index: 90; top: 80; display: none;" onMouseOver="initmenu('jsmenu${status.count}');" onMouseOut="initmenu();">\r
+ <table cellpadding="0" cellspacing="1" bgcolor="#c2c4b6" align="left" valign="middle" cols="1" width="100%">\r
+ <c:forEach items="${menuItem.subItems}" var="subItem">\r
+ <authz:authorize ifAnyGranted="${subItem.rolesStr}">\r
+ <tr>\r
+ <td id="href${status.count}" bgcolor="#000033" style="padding-left:3px;" height="12" nowrap><a class="fwhite" href="<c:url value="${subItem.url}?${subItem.servletParams}${empty subItem.servletParams ? '' : '&'}curlnk=${status.count}"/>"> <spring:message code="${subItem.name}"/></a></td>\r
+ </tr>\r
+ </authz:authorize>\r
+ </c:forEach>\r
+ </table>\r
+ </div>\r
+ </c:if>\r
+ </authz:authorize>\r
+ </c:forEach>\r
+</c:if>\r
+ <!-- END CODE FOR HZL MENU SUBMENU ITEMS -->\r
+\r
+ <!-- JAVASCRIPT FOR HIGHLIGHTING THE APPROPRIATE MENU HEADER -->\r
+ <script>\r
+ var linkobject = null;\r
+ var currlinkvalue = "${param.curlnk}";\r
+ for(ix = 1; ix <= <%= com.jaspersoft.jasperserver.war.common.SiteMenu.instance().getMenu().getSubItems().length %>; ix++) {\r
+ linkobject = document.getElementById("href"+ix);\r
+ if(linkobject) {\r
+ if(currlinkvalue == ix) {\r
+ linkobject.style.background="#666666";\r
+ } else {\r
+ linkobject.style.background="#000033";\r
+ }\r
+ }\r
+ }\r
+\r
+ </script>\r
+\r
+<%\r
+ com.jaspersoft.jasperserver.war.common.HeartbeatBean heartbeat = (com.jaspersoft.jasperserver.war.common.HeartbeatBean)\r
+ application.getAttribute("heartbeatBean");\r
+%>\r
+<authz:authorize ifAnyGranted="ROLE_ADMINISTRATOR">\r
+<%\r
+ if (heartbeat != null && heartbeat.haveToAskForPermissionNow())\r
+ {\r
+%>\r
+ <jsp:include page="../jsp/heartbeatOptin.jsp"/>\r
+<%\r
+ }\r
+%>\r
+</authz:authorize>\r
+<authz:authorize ifAnyGranted="ROLE_USER,ROLE_ADMINISTRATOR">\r
+<%\r
+ if (heartbeat != null && heartbeat.isMakingCalls()\r
+ && session != null \r
+ && session.getAttribute("jsHeartbeatSentClientInfo") == null)\r
+ {\r
+ session.setAttribute("jsHeartbeatSentClientInfo", Boolean.TRUE);\r
+%>\r
+ <jsp:include page="../jsp/heartbeatSendClientInfo.jsp"/>\r
+<%\r
+ }\r
+%>\r
+</authz:authorize>\r
+ </body>\r
+ </html>\r
+ </c:when>\r
+\r
+ <c:otherwise>\r
+ <html>\r
+ <head>\r
+ <title><spring:message code='decorators.main.title'/></title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=${requestScope['com.jaspersoft.ji.characterEncoding']}">\r
+ <link href="${pageContext.request.contextPath}/stylesheets/stylesheet.css" rel="stylesheet" type="text/css">\r
+ <decorator:head />\r
+ </head>\r
+ <body style="color: black; background-color: white; margin-left: 2px; margin-right: 2px; margin-top: 2px;">\r
+ <decorator:body />\r
+ </body>\r
+ </html>\r
+ </c:otherwise>\r
+</c:choose>\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<web-app version="2.4"\r
+ xmlns="http://java.sun.com/xml/ns/j2ee"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">\r
+\r
+ <display-name>JasperServer UI application</display-name>\r
+\r
+\r
+ <context-param>\r
+ <param-name>sessionPublishedBeans</param-name>\r
+ <param-value>configurationBean,heartbeatBean</param-value>\r
+ </context-param>\r
+\r
+\r
+ \r
+ <context-param>\r
+ <param-name>webAppRootKey</param-name>\r
+ <param-value>jasperserver.root</param-value>\r
+ </context-param>\r
+\r
+ <listener>\r
+ <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>\r
+ </listener>\r
+ \r
+ <context-param>\r
+ <param-name>log4jConfigLocation</param-name>\r
+ <param-value>/WEB-INF/log4j.properties</param-value>\r
+ </context-param>\r
+ \r
+ <!-- listener to load the root application context -->\r
+ <listener>\r
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
+ </listener>\r
+\r
+ <context-param>\r
+ <param-name>contextConfigLocation</param-name>\r
+ <param-value>/WEB-INF/applicationContext*.xml</param-value>\r
+ </context-param>\r
+\r
+ <context-param>\r
+ <param-name>contextClass</param-name>\r
+ <param-value>com.jaspersoft.jasperserver.war.util.JSWebApplicationContext</param-value>\r
+ </context-param>\r
+\r
+ <!-- resources initializer -->\r
+ <listener>\r
+ <listener-class>com.tonbeller.tbutils.res.ResourcesFactoryContextListener</listener-class>\r
+ </listener>\r
+\r
+ <!-- optional? now in JPivot by default -->\r
+ <context-param>\r
+ <param-name>contextFactory</param-name>\r
+ <param-value>com.tonbeller.wcf.controller.RequestContextFactoryImpl</param-value>\r
+ </context-param>\r
+ \r
+ <!-- Close JDBC connections on end of session -->\r
+ <listener>\r
+ <listener-class>com.jaspersoft.jasperserver.war.DrillThroughConnectionKiller</listener-class>\r
+ </listener>\r
+\r
+ <!-- SecurityContextHolder.setStrategyName(MODE_INHERITABLETHREADLOCAL) -->\r
+ <listener>\r
+ <listener-class>com.jaspersoft.jasperserver.war.util.SecurityContextHolderStrategyInitializer</listener-class>\r
+ </listener>\r
+\r
+ <listener>\r
+ <display-name>Session mutex</display-name>\r
+ <listener-class>org.springframework.web.util.HttpSessionMutexListener</listener-class>\r
+ </listener> \r
+\r
+ <listener>\r
+ <listener-class>com.jaspersoft.jasperserver.war.util.SpringBeanServletContextPlublisher</listener-class>\r
+ </listener>\r
+ \r
+\r
+ <filter>\r
+ <filter-name>securityFilter</filter-name>\r
+ <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>\r
+ <init-param>\r
+ <param-name>targetBean</param-name>\r
+ <param-value>filterChainProxy</param-value>\r
+ </init-param>\r
+ </filter>\r
+<filter-mapping>\r
+ <filter-name>securityFilter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+</filter-mapping>\r
+\r
+\r
+\r
+\r
+<!--\r
+<filter>\r
+ <filter-name>Acegi CAS Processing Filter</filter-name>\r
+ <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>\r
+ <init-param>\r
+ <param-name>targetClass</param-name>\r
+ <param-value>org.acegisecurity.ui.cas.CasProcessingFilter</param-value>\r
+ </init-param>\r
+</filter>\r
+\r
+<filter-mapping>\r
+ <filter-name>Acegi CAS Processing Filter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+</filter-mapping>\r
+-->\r
+\r
+\r
+ <!-- Start of SiteMesh filter config -->\r
+ <filter>\r
+ <filter-name>sitemesh</filter-name>\r
+ <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>\r
+ </filter>\r
+<!--\r
+ <filter-mapping>\r
+ <filter-name>characterEncodingProxyFilter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ </filter-mapping>\r
+ <filter-mapping>\r
+ <filter-name>securityFilter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ </filter-mapping>\r
+-->\r
+ <filter-mapping>\r
+ <filter-name>sitemesh</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ <dispatcher>FORWARD</dispatcher>\r
+ </filter-mapping>\r
+ \r
+ <!-- Filter to help parse the file name and extension of uplaoded files-->\r
+ <filter>\r
+ <filter-name>multiPartHelperFilter</filter-name>\r
+ <filter-class>com.jaspersoft.jasperserver.war.common.UploadMultipartFilter</filter-class>\r
+ </filter>\r
+\r
+ <filter-mapping>\r
+ <filter-name>multiPartHelperFilter</filter-name>\r
+ <url-pattern>/*</url-pattern>\r
+ </filter-mapping>\r
+\r
+ <filter>\r
+ <filter-name>JPivotController</filter-name>\r
+ <filter-class>com.tonbeller.wcf.controller.RequestFilter</filter-class>\r
+\r
+<!-- to avoid double clicking problem in the OLAP view list\r
+ <init-param>\r
+ <param-name>indexJSP</param-name>\r
+ <param-value>/olap/viewOlap.html</param-value>\r
+ <description>forward to this page if session is new</description>\r
+ </init-param>\r
+-->\r
+ <init-param>\r
+ <description>URI of error page</description>\r
+ <param-name>errorJSP</param-name>\r
+ <param-value>/olap/error.html</param-value>\r
+ </init-param>\r
+ <init-param>\r
+ <description>This page is displayed if a the user clicks\r
+ on a query before the previous query has finished</description>\r
+ <param-name>busyJSP</param-name>\r
+ <param-value>/olap/busy.html</param-value>\r
+ </init-param>\r
+ <!--\r
+ <init-param>\r
+ <param-name>forceExtension</param-name>\r
+ <param-value>.faces</param-value>\r
+ <description>replace .jsp with .faces</description>\r
+ </init-param>\r
+ -->\r
+ </filter>\r
+\r
+ <filter-mapping>\r
+ <filter-name>JPivotController</filter-name>\r
+ <url-pattern>/olap/viewOlap.html</url-pattern>\r
+ </filter-mapping>\r
+\r
+<!--\r
+-->\r
+\r
+\r
+\r
+<servlet>\r
+ <servlet-name>casproxy</servlet-name>\r
+ <servlet-class>edu.yale.its.tp.cas.proxy.ProxyTicketReceptor</servlet-class>\r
+</servlet>\r
+\r
+<servlet-mapping>\r
+ <servlet-name>casproxy</servlet-name>\r
+ <url-pattern>/casProxy/*</url-pattern>\r
+</servlet-mapping>\r
+\r
+\r
+\r
+\r
+\r
+ <!-- dispatcher servlet for the application -->\r
+ <servlet>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>\r
+ <init-param>\r
+ <param-name>contextConfigLocation</param-name>\r
+ <param-value>/WEB-INF/jasperserver-*.xml</param-value>\r
+ </init-param>\r
+ <load-on-startup>1</load-on-startup>\r
+ </servlet>\r
+ <servlet-mapping>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <url-pattern>*.html</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <url-pattern>/flow.html/*</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <url-pattern>/fileview/*</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <url-pattern>/reportimage/*</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>jasperserver</servlet-name>\r
+ <url-pattern>/jrpxml/*</url-pattern>\r
+ </servlet-mapping>\r
+ \r
+\r
+ <!-- MondrianXmlaServlet replaced with JasperXmlaServlet -->\r
+ <!--\r
+ <servlet>\r
+ <servlet-name>MondrianXmlaServlet</servlet-name>\r
+ <servlet-class>mondrian.xmla.impl.DefaultXmlaServlet</servlet-class>\r
+ <init-param>\r
+ <param-name>DataSourcesConfig</param-name>\r
+ <param-value>datasources.xml</param-value>\r
+ </init-param>\r
+ </servlet>\r
+ -->\r
+\r
+ <!-- XML for Analysis Servlet -->\r
+ <servlet>\r
+ <servlet-name>JasperXmlaServlet</servlet-name>\r
+ <servlet-class>com.jaspersoft.jasperserver.war.xmla.XmlaServletImpl</servlet-class>\r
+ </servlet>\r
+\r
+ <servlet-mapping>\r
+ <servlet-name>JasperXmlaServlet</servlet-name>\r
+ <url-pattern>/xmla</url-pattern>\r
+ </servlet-mapping>\r
+\r
+ <!-- for drillthrough -->\r
+ \r
+ <servlet>\r
+ <servlet-name>JasperDrillThroughServlet</servlet-name>\r
+ <servlet-class>com.jaspersoft.jasperserver.war.CSVServlet</servlet-class>\r
+ </servlet>\r
+ <servlet-mapping>\r
+ <servlet-name>JasperDrillThroughServlet</servlet-name>\r
+ <url-pattern>/olap/drillthrough.csv</url-pattern>\r
+ </servlet-mapping>\r
+\r
+ <!-- jfreechart provided servlet -->\r
+ <servlet>\r
+ <servlet-name>DisplayChart</servlet-name>\r
+ <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>\r
+ </servlet>\r
+\r
+ <!-- jfreechart provided servlet -->\r
+ <servlet>\r
+ <description>Serves up chart images for OLAP printing to PDF and Excel.</description>\r
+ <servlet-name>GetChart</servlet-name>\r
+ <!--display-name>GetChart</display-name-->\r
+ <servlet-class>com.jaspersoft.jasperserver.war.OlapGetChart</servlet-class>\r
+ </servlet>\r
+ <servlet>\r
+ <description>Generate PDF and Excel files for download based on OLAP model.</description>\r
+ <servlet-name>Print</servlet-name>\r
+ <!--display-name>Print</display-name-->\r
+ \r
+ <!-- Use JPivot PrintServlet which has been customized -->\r
+ \r
+ <servlet-class>com.tonbeller.jpivot.print.PrintServlet</servlet-class>\r
+ <!-- <servlet-class>com.jaspersoft.jasperserver.war.OlapPrint</servlet-class> -->\r
+ </servlet>\r
+\r
+ <servlet-mapping>\r
+ <servlet-name>DisplayChart</servlet-name>\r
+ <url-pattern>/DisplayChart</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>Print</servlet-name>\r
+ <url-pattern>/olap/Print</url-pattern>\r
+ </servlet-mapping>\r
+ <servlet-mapping>\r
+ <servlet-name>GetChart</servlet-name>\r
+ <url-pattern>/GetChart</url-pattern>\r
+ </servlet-mapping>\r
+\r
+ <!-- web services support -->\r
+ \r
+ <!-- webService Axis2 support START -->\r
+ <servlet>\r
+ <servlet-name>Axis2Servlet</servlet-name>\r
+ <!--display-name>Apache-Axis2 Servlet</display-name-->\r
+ <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>\r
+ <!--\r
+ <init-param>\r
+ <param-name>repository</param-name>\r
+ <param-value>/WEB-INF</param-value>\r
+ </init-param>\r
+ -->\r
+ <load-on-startup>1</load-on-startup>\r
+ </servlet>\r
+ \r
+ <servlet-mapping>\r
+ <servlet-name>Axis2Servlet</servlet-name>\r
+ <url-pattern>/services/*</url-pattern>\r
+ </servlet-mapping>\r
+ <!-- webService Axis2 support END -->\r
+ \r
+\r
+\r
+ <session-config>\r
+ <!-- Default to 20 minute session timeouts -->\r
+ <session-timeout>20</session-timeout>\r
+ </session-config>\r
+\r
+ <jsp-config>\r
+ \r
+ <taglib>\r
+ <taglib-uri>/WEB-INF/jasperserver.tld</taglib-uri>\r
+ <taglib-location>/WEB-INF/jasperserver.tld</taglib-location>\r
+ </taglib> \r
+\r
+ <taglib>\r
+ <taglib-uri>/spring</taglib-uri>\r
+ <taglib-location>/WEB-INF/spring.tld</taglib-location>\r
+ </taglib>\r
+\r
+ <taglib>\r
+ <taglib-uri>http://www.tonbeller.com/wcf</taglib-uri>\r
+ <taglib-location>/WEB-INF/wcf/wcf-tags.tld</taglib-location>\r
+ </taglib>\r
+\r
+ <taglib>\r
+ <taglib-uri>http://www.tonbeller.com/jpivot</taglib-uri>\r
+ <taglib-location>/WEB-INF/jpivot/jpivot-tags.tld</taglib-location>\r
+ </taglib>\r
+\r
+ </jsp-config>\r
+\r
+ <resource-ref>\r
+ <description>JasperServer Metadata repository</description>\r
+ <res-ref-name>jdbc/jasperserver</res-ref-name>\r
+ <res-type>javax.sql.DataSource</res-type>\r
+ <res-auth>Container</res-auth>\r
+ </resource-ref>\r
+ \r
+ <resource-ref>\r
+ <description>SugarCRM example database</description>\r
+ <res-ref-name>jdbc/sugarcrm</res-ref-name>\r
+ <res-type>javax.sql.DataSource</res-type>\r
+ <res-auth>Container</res-auth>\r
+ </resource-ref>\r
+ \r
+ <resource-ref>\r
+ <description>Foodmart database</description>\r
+ <res-ref-name>jdbc/foodmart</res-ref-name>\r
+ <res-type>javax.sql.DataSource</res-type>\r
+ <res-auth>Container</res-auth>\r
+ </resource-ref>\r
+ \r
+ <welcome-file-list>\r
+ <welcome-file>index.htm</welcome-file>\r
+ </welcome-file-list>\r
+ \r
+ <!-- currently the W3C havent settled on a media type for WSDL;\r
+ http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft\r
+ for now we go with the basic 'it's XML' response -->\r
+ <mime-mapping>\r
+ <extension>wsdl</extension>\r
+ <mime-type>text/xml</mime-type>\r
+ </mime-mapping>\r
+ \r
+\r
+ <mime-mapping>\r
+ <extension>xsd</extension>\r
+ <mime-type>text/xml</mime-type>\r
+ </mime-mapping>\r
+\r
+</web-app>\r
+\r
--- /dev/null
+CeCILL-C FREE SOFTWARE LICENSE AGREEMENT
+
+
+ Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+ * firstly, compliance with the principles governing the distribution
+ of Free Software: access to source code, broad rights granted to
+ users,
+ * secondly, the election of a governing law, French law, with which
+ it is conformant, both as regards the law of torts and
+ intellectual property law, and the protection that it offers to
+ both authors and holders of the economic rights over software.
+
+The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial research establishment, having its principal place of
+business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+ Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and re-use the software governed by this license.
+
+The exercising of this right is conditional upon the obligation to make
+available to the community the modifications made to the source code of
+the software so as to contribute to its evolution.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+suitability of the software as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+ Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Integrated Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Integrated
+Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Integrated Contribution: means any or all modifications, corrections,
+translations, adaptations and/or new functions integrated into the
+Source Code by any or all Contributors.
+
+Related Module: means a set of sources files including their
+documentation that, without modification to the Source Code, enables
+supplementary functions or services in addition to those offered by the
+Software.
+
+Derivative Software: means any combination of the Software, modified or
+not, and of a Related Module.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+ Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the
+protection granted by the rights over said Software.
+
+
+ Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+ * (i) loading the Software by any or all means, notably, by
+ downloading from a remote server, or by loading from a physical
+ medium;
+ * (ii) the first time the Licensee exercises any of the rights
+ granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and
+understood it.
+
+
+ Article 4 - EFFECTIVE DATE AND TERM
+
+
+ 4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+ 4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+ Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+ 5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+ 1. permanent or temporary reproduction of all or part of the Software
+ by any or all means and in any or all form.
+
+ 2. loading, displaying, running, or storing the Software on any or
+ all medium.
+
+ 3. entitlement to observe, study or test its operation so as to
+ determine the ideas and principles behind any or all constituent
+ elements of said Software. This shall apply when the Licensee
+ carries out any or all loading, displaying, running, transmission
+ or storage operation as regards the Software, that it is entitled
+ to carry out hereunder.
+
+
+ 5.2 RIGHT OF MODIFICATION
+
+The right of modification includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting software. It includes, in particular, the
+right to create a Derivative Software.
+
+The Licensee is authorized to make any or all modification to the
+Software provided that it includes an explicit notice that it is the
+author of said modification and indicates the date of the creation thereof.
+
+
+ 5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+ 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+ 1. a copy of the Agreement,
+
+ 2. a notice relating to the limitation of both the Licensor's
+ warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows effective access to the full Source
+Code of the Software at a minimum during the entire period of its
+distribution of the Software, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+ 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes an Integrated Contribution to the Software, the
+terms and conditions for the distribution of the resulting Modified
+Software become subject to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+source code or object code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+ 1. a copy of the Agreement,
+
+ 2. a notice relating to the limitation of both the Licensor's
+ warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the object code of the Modified
+Software is redistributed, the Licensee allows effective access to the
+full source code of the Modified Software at a minimum during the entire
+period of its distribution of the Modified Software, it being understood
+that the additional cost of acquiring the source code shall not exceed
+the cost of transferring the data.
+
+
+ 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE
+
+When the Licensee creates Derivative Software, this Derivative Software
+may be distributed under a license agreement other than this Agreement,
+subject to compliance with the requirement to include a notice
+concerning the rights over the Software as defined in Article 6.4.
+In the event the creation of the Derivative Software required modification
+of the Source Code, the Licensee undertakes that:
+
+ 1. the resulting Modified Software will be governed by this Agreement,
+ 2. the Integrated Contributions in the resulting Modified Software
+ will be clearly identified and documented,
+ 3. the Licensee will allow effective access to the source code of the
+ Modified Software, at a minimum during the entire period of
+ distribution of the Derivative Software, such that such
+ modifications may be carried over in a subsequent version of the
+ Software; it being understood that the additional cost of
+ purchasing the source code of the Modified Software shall not
+ exceed the cost of transferring the data.
+
+
+ 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE
+
+When a Modified Software contains an Integrated Contribution subject to
+the CeCILL license agreement, or when a Derivative Software contains a
+Related Module subject to the CeCILL license agreement, the provisions
+set forth in the third item of Article 6.4 are optional.
+
+
+ Article 6 - INTELLECTUAL PROPERTY
+
+
+ 6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by this Agreement, for the duration set forth in Article 4.2.
+
+
+ 6.2 OVER THE INTEGRATED CONTRIBUTIONS
+
+The Licensee who develops an Integrated Contribution is the owner of the
+intellectual property rights over this Contribution as defined by
+applicable law.
+
+
+ 6.3 OVER THE RELATED MODULES
+
+The Licensee who develops a Related Module is the owner of the
+intellectual property rights over this Related Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution under the conditions defined in Article 5.3.3.
+
+
+ 6.4 NOTICE OF RIGHTS
+
+The Licensee expressly undertakes:
+
+ 1. not to remove, or modify, in any manner, the intellectual property
+ notices attached to the Software;
+
+ 2. to reproduce said notices, in an identical manner, in the copies
+ of the Software modified or not;
+
+ 3. to ensure that use of the Software, its intellectual property
+ notices and the fact that it is governed by the Agreement is
+ indicated in a text that is easily accessible, specifically from
+ the interface of any Derivative Software.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-Ã -vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+ Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+ Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+ Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the suitability of the product for its requirements, its good working
+order, and for ensuring that it shall not cause damage to either persons
+or properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+ Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+ Article 11 - MISCELLANEOUS
+
+
+ 11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+ 11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+ Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version.
+
+
+ Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 1.0 dated 2006-09-05.
\ No newline at end of file
--- /dev/null
+<?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="propertyPlaceholderConfigurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+-->
+ <bean id="dataSource"
+ class="com.mchange.v2.c3p0.ComboPooledDataSource"
+ destroy-method="close">
+ <description>DataSource for Mysql with C3P0 Connexion Pool management.</description>
+
+ <property name="driverClass" value="${dbdriver}" />
+ <property name="jdbcUrl"
+ value="${dburl}" />
+ <property name="user" value="${dbuser}" />
+ <property name="password" value="${dbpassword}" />
+
+ <property name="initialPoolSize"><value>${hibernate.c3p0.initialPoolSize}</value></property>
+ <property name="minPoolSize"><value>${hibernate.c3p0.minPoolSize}</value></property>
+ <property name="maxPoolSize"><value>${hibernate.c3p0.maxPoolSize}</value></property>
+ <property name="acquireRetryAttempts"><value>${hibernate.c3p0.acquireRetryAttempts}</value></property>
+ <property name="acquireIncrement"><value>${hibernate.c3p0.acquireIncrement}</value></property>
+ <property name="idleConnectionTestPeriod"><value>${hibernate.c3p0.idleConnectionTestPeriod}</value></property>
+ <property name="maxIdleTime"><value>${hibernate.c3p0.maxIdleTime}</value></property>
+ <property name="maxConnectionAge"><value>${hibernate.c3p0.maxConnectionAge}</value></property>
+ <property name="preferredTestQuery"><value>${hibernate.c3p0.preferredTestQuery}</value></property>
+ <property name="testConnectionOnCheckin"><value>${hibernate.c3p0.testConnectionOnCheckin}</value></property>
+ </bean>
+
+ <!-- Hibernate SessionFactory -->
+ <bean id="sessionFactory"
+ class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+
+ <description>SessionFactory Bean declaration for dataSource</description>
+
+ <property name="dataSource"><ref local="dataSource"/></property>
+ <property name="packagesToScan" value="com.pentila.sconet.model.log"/>
+
+
+
+
+
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">${dbdialect}</prop>
+ <prop key="hibernate.hbm2ddl.auto">${hbm2ddl}</prop>
+
+ <prop key="hibernate.c3p0.acquire_increment">${hibernate.c3p0.acquireIncrement}</prop>
+ <prop key="hibernate.c3p0.idle_test_period">${hibernate.c3p0.idleConnectionTestPeriod}</prop>
+ <prop key="hibernate.c3p0.timeout">${hibernate.c3p0.maxIdleTime}</prop>
+ <prop key="hibernate.c3p0.max_size">${hibernate.c3p0.maxPoolSize}</prop>
+ <prop key="hibernate.c3p0.min_size">${hibernate.c3p0.minPoolSize}</prop>
+
+
+ </props>
+ </property>
+ </bean>
+
+ <bean id="logDAO" class="com.pentila.sconet.manager.LogDAO">
+ <property name="sessionFactory"><ref bean="sessionFactory"/></property>
+ </bean>
+
+ <bean id="BeanUtil" class="com.pentila.sconet.manager.Beans" />
+
+</beans>
--- /dev/null
+<?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="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+
+
+<import resource="applicationContext-hibernate.xml"/>
+
+<bean id="contextSource" class="org.springframework.ldap.pool.factory.PoolingContextSource">
+ <property name="contextSource" ref="contextSourceTarget" />
+ <property name="dirContextValidator" ref="dirContextValidator" />
+ <property name="testOnBorrow" value="true" />
+ <property name="testWhileIdle" value="true" />
+ </bean>
+
+ <bean id="dirContextValidator"
+ class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" />
+
+ <bean id="contextSourceTarget"
+ class="org.springframework.ldap.core.support.LdapContextSource">
+ <description>Contexte LDAP via Spring</description>
+ <property name="urls" value="ldap://${ldap.server.ip}:${ldap.server.port}" />
+ <property name="userDn" value="${ldap.managerDN}"/>
+ <property name="password" value="${ldap.managerPWD}"/>
+ <property name="base" value="${ldap.branch.suffix}"/>
+ <property name="dirObjectFactory" value="org.springframework.ldap.core.support.DefaultDirObjectFactory" />
+ <property name="pooled" value="false"/>
+ </bean>
+
+ <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
+ <description>Template d'acces Spring pour LDAP</description>
+ <constructor-arg ref="contextSource"/>
+ </bean>
+
+ <bean id="ldapPasswordEncoder" class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+
+ <bean id="ldapManager" class="com.pentila.sconet.manager.LdapManager" init-method="initialize">
+ <constructor-arg type="java.lang.String" index="0"><value>${ldap.schema.person}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="1"><value>${ldap.schema.structure}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="2"><value>${ldap.schema.groups}</value></constructor-arg>
+
+ <property name="ldapTemplate" ><ref bean="ldapTemplate" /></property>
+ <property name="suffix"><value>${ldap.branch.suffix}</value></property>
+ <property name="branchPeople"><value>${ldap.branch.people}</value></property>
+ <property name="branchGroups"><value>${ldap.branch.groups}</value></property>
+ <property name="branchEtablissements"><value>${ldap.branch.etabs}</value></property>
+ <property name="groupMemberName"><value>${ldap.groupmembername}</value></property>
+ <property name="groupReportAccess"><value>${ldap.reportaccessgroup}</value></property>
+ <property name="ldapPasswordEncoder"><ref bean="ldapPasswordEncoder" /></property>
+ </bean>
+
+ <bean id="sconetManager" class="com.pentila.sconet.manager.SconetManager" init-method="loadFiles">
+ <property name="filesLocation"><value>${sconet.filesLocation}</value></property>
+ <property name="filesArchiveLocation"><value>${sconet.filesArchiveLocation}</value></property>
+ <property name="filesArchiveMove"><value>${files.archive.move}</value></property>
+ </bean>
+
+ <bean id="processor" class="com.pentila.sconet.manager.Processor">
+ <property name="ldapManager"><ref bean="ldapManager" /></property>
+ <property name="sconetManager"><ref bean="sconetManager" /></property>
+ <property name="expirationPeriod"><value>${app.expirationPeriod}</value></property>
+ </bean>
+
+</beans>
--- /dev/null
+sconet.filesLocation=/files ##location where sconet files are stored to being processed\r
+sconet.filesArchiveLocation=/archives ##location where sconet files are stored after process\r
+ldap.server.port=389\r
+ldap.server.ip=168.0.0.1 ##LDAP server IP\r
+ldap.branch.suffix=dc\=organization,dc\=com #LDAP base dn\r
+ldap.branch.groups=ou\=groups\r
+ldap.branch.etabs=ou\=etablissements\r
+ldap.branch.people=ou\=people\r
+ldap.managerDN=cn\=admin,dc\=organization,dc\=com\r
+ldap.managerPWD=password\r
+ldap.schema.person=person,inetOrgPerson,ENTPerson,ENTEleve,ENTAuxPersRelEleve,ENTAuxEnseignant,ENTAuxNonEnsServAc,ENTAuxNonEnsCollLoc,ENTAuxNonEnsEtab,ENTAuxPersExt,ENTAuxTuteurStage,ENTAuxRespEntrp\r
+ldap.schema.structure=organizationalUnit,ENTStructure,ENTEtablissement,ENTCollLoc,ENTEntreprise\r
+ldap.schema.groups=groupOfNames,ENTClasse,ENTGroupe,ENTGroupementEtabs,ENTProfil,ENTRoleAppli,ENTRelEleve\r
+ldap.groupmembername=portal_members\r
+ldap.reportaccessgroup=groupAccessReport\r
+\r
+# DataBase URL\r
+dburl=jdbc:mysql://localhost:3306/entlog ##MySQL DB address for reporting\r
+dbuser=user\r
+dbpassword=password\r
+hbm2ddl=update\r
+dbdriver=com.mysql.jdbc.Driver\r
+dbdialect=org.hibernate.dialect.MySQLDialect\r
+\r
+# Hibernate C3P0 configuration against Mysql server\r
+hibernate.c3p0.initialPoolSize=10\r
+hibernate.c3p0.minPoolSize=1\r
+hibernate.c3p0.maxPoolSize=25\r
+hibernate.c3p0.acquireRetryAttempts=10\r
+hibernate.c3p0.acquireIncrement=5\r
+hibernate.c3p0.idleConnectionTestPeriod=3600\r
+hibernate.c3p0.preferredTestQuery=SELECT 1;\r
+hibernate.c3p0.testConnectionOnCheckin=false\r
+hibernate.c3p0.maxConnectionAge=14400\r
+hibernate.c3p0.maxIdleTime=10800\r
+app.expirationPeriod=92\r
+\r
+# permet de differencier la gestion des fichiers Savoie ou Rouen --> copy or move\r
+# si true --> move alors on deplace les fichiers traité apres process\r
+# si false --> copy; on laisse une copie dans le repertoire a traiter et on compare avec les archives\r
+files.archive.move=true\r
--- /dev/null
+###############################################################################
+#
+# Copyright (c) 2008 Savoie Technolac, PENTILA SAS.
+#
+# Ce logiciel est diffuse sous les termes et conditions de la licence CECILL.
+# Voir le fichier joint Licence_CeCILL_V2-fr.txt pour plus de details.
+#
+###############################################################################
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+log4j.rootLogger=info, stdout
+#log4j.logger.org.hibernate=info
+#log4j.logger.org.hibernate=debug
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+### log just the SQL
+log4j.logger.org.hibernate.SQL=fatal
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=fatal
+### log schema export/update ###
+#log4j.logger.org.hibernate.tool.hbm2ddl=info
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=info
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
+log4j.logger.org.springframework=fatal
+
+log4j.logger.com.pentila=debug
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" ?>
+<project default="compilation">
+
+ <property name="component.name" value="ImportENT"/>
+ <property name="component.version" value="1.0"/>
+ <property name="component.vendor" value="PENTILA S.A"/>
+
+
+ <!-- Building JAR FILE -->
+ <!-- name of the output .jar file -->
+ <property name="jar.name" value="sconetldap.jar" />
+ <property name="build.home" value="./jarbuild" />
+
+ <property name="src.dir" value="./src" />
+ <property name="config.dir" value="./etc" />
+ <property name="classes.dir" value="bin/" />
+
+ <property name="lib.dir" value="./lib" />
+ <property name="dist.home" value="./dist" />
+ <property name="verbose" value="true" />
+
+ <path id="project.class.path">
+
+ <!--<pathelement path="${java.library.path}" />
+ <pathelement path="${java.class.path}" />-->
+ <pathelement path="${classes.dir}" />
+ <pathelement path="${lib.dir}" />
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+
+
+ <target name="clean"
+ description="clean all generated stuff for this project">
+
+ <delete verbose="true">
+ <fileset dir="${classes.dir}"/>
+ </delete>
+ <delete verbose="true">
+ <fileset dir="${build.home}"/>
+ </delete>
+ </target>
+
+ <!-- General Target -->
+
+
+
+ <target name="compilation" description="Compilation" depends="clean">
+ <mkdir dir="${classes.dir}" />
+ <javac destdir="${classes.dir}" encoding="utf-8">
+ <src path="${src.dir}" />
+ <classpath refid="project.class.path" />
+ </javac>
+ </target>
+
+ <target name="jar" depends="compilation" description="Create jar and MANIFEST.MF">
+ <mkdir dir="${build.home}" />
+ <!-- create a property containing all .jar files, prefix lib/, and seperated with a space -->
+ <pathconvert property="libs.project" pathsep=" ">
+ <mapper>
+ <chainedmapper>
+
+ <!-- remove absolute path -->
+ <flattenmapper />
+
+ <!-- add lib/ prefix -->
+ <globmapper from="*" to="./lib/*" />
+ </chainedmapper>
+ </mapper>
+
+ <path>
+
+ <!-- lib.home contains all jar files, in several subdirectories -->
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
+
+ </pathconvert>
+
+ <!-- create the jar -->
+ <jar jarfile="${build.home}/${jar.name}" basedir="${classes.dir}" excludes="applicationContext*.xml *.properties">
+
+ <!-- define MANIFEST.MF -->
+ <manifest>
+ <attribute name="Built-By" value="${user.name}" />
+ <attribute name="Main-Class" value="com.pentila.sconet.Importer" />
+ <section name="common">
+ <attribute name="Specification-Title" value="${component.name}" />
+ <attribute name="Specification-Version" value="${component.version}" />
+ <attribute name="Specification-Vendor" value="${component.vendor}" />
+ <attribute name="Implementation-Title" value="${component.name}" />
+ <attribute name="Implementation-Version" value="${component.version} ${TODAY}" />
+ <attribute name="Implementation-Vendor" value="${component.vendor}" />
+ </section>
+
+ <!-- finally, use the magically generated libs path -->
+ <attribute name="Class-Path" value="${libs.project} etc/" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="dist" description="Creation d'une distribution" depends="jar">
+ <delete dir="${dist.home}" />
+ <mkdir dir="${dist.home}" />
+ <!-- contains all library dependencies -->
+ <mkdir dir="${dist.home}/lib" />
+ <mkdir dir="${dist.home}/etc" />
+
+
+ <copy todir="${dist.home}" file="${build.home}/${jar.name}" />
+ <copy todir="${dist.home}">
+ <fileset dir=".">
+ <include name="*.dtd" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.home}/etc/" >
+ <fileset dir="${src.dir}">
+ <include name="applicationContext*.xml" />
+ <include name="*.properties" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.home}" file="./synchronize.sh" />
+ <copy todir="${dist.home}" file="./synchronizePWD.sh" />
+ <copy todir="${dist.home}/etc/" file="${src.dir}/log4j.properties" />
+
+
+
+ <copy todir="${dist.home}/lib" filtering="off">
+ <!-- remove the directory hierarchy: lib contains no subdirectories -->
+ <flattenmapper />
+ <fileset dir="${lib.dir}" includes="**/*.jar" />
+
+ </copy>
+ </target>
+
+</project>
+
+
+
--- /dev/null
+<?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="propertyPlaceholderConfigurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+-->
+ <bean id="dataSource"
+ class="com.mchange.v2.c3p0.ComboPooledDataSource"
+ destroy-method="close">
+ <description>DataSource for Mysql with C3P0 Connexion Pool management.</description>
+
+ <property name="driverClass" value="${dbdriver}" />
+ <property name="jdbcUrl"
+ value="${dburl}" />
+ <property name="user" value="${dbuser}" />
+ <property name="password" value="${dbpassword}" />
+
+ <property name="initialPoolSize"><value>${hibernate.c3p0.initialPoolSize}</value></property>
+ <property name="minPoolSize"><value>${hibernate.c3p0.minPoolSize}</value></property>
+ <property name="maxPoolSize"><value>${hibernate.c3p0.maxPoolSize}</value></property>
+ <property name="acquireRetryAttempts"><value>${hibernate.c3p0.acquireRetryAttempts}</value></property>
+ <property name="acquireIncrement"><value>${hibernate.c3p0.acquireIncrement}</value></property>
+ <property name="idleConnectionTestPeriod"><value>${hibernate.c3p0.idleConnectionTestPeriod}</value></property>
+ <property name="maxIdleTime"><value>${hibernate.c3p0.maxIdleTime}</value></property>
+ <property name="maxConnectionAge"><value>${hibernate.c3p0.maxConnectionAge}</value></property>
+ <property name="preferredTestQuery"><value>${hibernate.c3p0.preferredTestQuery}</value></property>
+ <property name="testConnectionOnCheckin"><value>${hibernate.c3p0.testConnectionOnCheckin}</value></property>
+ </bean>
+
+ <!-- Hibernate SessionFactory -->
+ <bean id="sessionFactory"
+ class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+
+ <description>SessionFactory Bean declaration for dataSource</description>
+
+ <property name="dataSource"><ref local="dataSource"/></property>
+ <property name="packagesToScan" value="com.pentila.sconet.model.log"/>
+
+
+
+
+
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">${dbdialect}</prop>
+ <prop key="hibernate.hbm2ddl.auto">${hbm2ddl}</prop>
+
+ <prop key="hibernate.c3p0.acquire_increment">${hibernate.c3p0.acquireIncrement}</prop>
+ <prop key="hibernate.c3p0.idle_test_period">${hibernate.c3p0.idleConnectionTestPeriod}</prop>
+ <prop key="hibernate.c3p0.timeout">${hibernate.c3p0.maxIdleTime}</prop>
+ <prop key="hibernate.c3p0.max_size">${hibernate.c3p0.maxPoolSize}</prop>
+ <prop key="hibernate.c3p0.min_size">${hibernate.c3p0.minPoolSize}</prop>
+
+
+ </props>
+ </property>
+ </bean>
+
+ <bean id="logDAO" class="com.pentila.sconet.manager.LogDAO">
+ <property name="sessionFactory"><ref bean="sessionFactory"/></property>
+ </bean>
+
+ <bean id="BeanUtil" class="com.pentila.sconet.manager.Beans" />
+
+</beans>
--- /dev/null
+<?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="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+
+
+<import resource="applicationContext-hibernate.xml"/>
+
+<bean id="contextSource" class="org.springframework.ldap.pool.factory.PoolingContextSource">
+ <property name="contextSource" ref="contextSourceTarget" />
+ <property name="dirContextValidator" ref="dirContextValidator" />
+ <property name="testOnBorrow" value="true" />
+ <property name="testWhileIdle" value="true" />
+ </bean>
+
+ <bean id="dirContextValidator"
+ class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" />
+
+ <bean id="contextSourceTarget"
+ class="org.springframework.ldap.core.support.LdapContextSource">
+ <description>Contexte LDAP via Spring</description>
+ <property name="urls" value="ldap://${ldap.server.ip}:${ldap.server.port}" />
+ <property name="userDn" value="${ldap.managerDN}"/>
+ <property name="password" value="${ldap.managerPWD}"/>
+ <property name="base" value="${ldap.branch.suffix}"/>
+ <property name="dirObjectFactory" value="org.springframework.ldap.core.support.DefaultDirObjectFactory" />
+ <property name="pooled" value="false"/>
+ </bean>
+
+ <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
+ <description>Template d'acces Spring pour LDAP</description>
+ <constructor-arg ref="contextSource"/>
+ </bean>
+
+ <bean id="ldapPasswordEncoder" class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+
+ <bean id="ldapManager" class="com.pentila.sconet.manager.LdapManager" init-method="initialize">
+ <constructor-arg type="java.lang.String" index="0"><value>${ldap.schema.person}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="1"><value>${ldap.schema.structure}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="2"><value>${ldap.schema.groups}</value></constructor-arg>
+
+ <property name="ldapTemplate" ><ref bean="ldapTemplate" /></property>
+ <property name="suffix"><value>${ldap.branch.suffix}</value></property>
+ <property name="branchPeople"><value>${ldap.branch.people}</value></property>
+ <property name="branchGroups"><value>${ldap.branch.groups}</value></property>
+ <property name="branchEtablissements"><value>${ldap.branch.etabs}</value></property>
+ <property name="groupMemberName"><value>${ldap.groupmembername}</value></property>
+ <property name="groupReportAccess"><value>${ldap.reportaccessgroup}</value></property>
+ <property name="ldapPasswordEncoder"><ref bean="ldapPasswordEncoder" /></property>
+ </bean>
+
+ <bean id="sconetManager" class="com.pentila.sconet.manager.SconetManager" init-method="loadFiles">
+ <property name="filesLocation"><value>${sconet.filesLocation}</value></property>
+ <property name="filesArchiveLocation"><value>${sconet.filesArchiveLocation}</value></property>
+ <property name="filesArchiveMove"><value>${files.archive.move}</value></property>
+ </bean>
+
+ <bean id="processor" class="com.pentila.sconet.manager.Processor">
+ <property name="ldapManager"><ref bean="ldapManager" /></property>
+ <property name="sconetManager"><ref bean="sconetManager" /></property>
+ <property name="expirationPeriod"><value>${app.expirationPeriod}</value></property>
+ </bean>
+
+</beans>
--- /dev/null
+sconet.filesLocation=/files ##location where sconet files are stored to being processed\r
+sconet.filesArchiveLocation=/archives ##location where sconet files are stored after process\r
+ldap.server.port=389\r
+ldap.server.ip=168.0.0.1 ##LDAP server IP\r
+ldap.branch.suffix=dc\=organization,dc\=com #LDAP base dn\r
+ldap.branch.groups=ou\=groups\r
+ldap.branch.etabs=ou\=etablissements\r
+ldap.branch.people=ou\=people\r
+ldap.managerDN=cn\=admin,dc\=organization,dc\=com\r
+ldap.managerPWD=password\r
+ldap.schema.person=person,inetOrgPerson,ENTPerson,ENTEleve,ENTAuxPersRelEleve,ENTAuxEnseignant,ENTAuxNonEnsServAc,ENTAuxNonEnsCollLoc,ENTAuxNonEnsEtab,ENTAuxPersExt,ENTAuxTuteurStage,ENTAuxRespEntrp\r
+ldap.schema.structure=organizationalUnit,ENTStructure,ENTEtablissement,ENTCollLoc,ENTEntreprise\r
+ldap.schema.groups=groupOfNames,ENTClasse,ENTGroupe,ENTGroupementEtabs,ENTProfil,ENTRoleAppli,ENTRelEleve\r
+ldap.groupmembername=portal_members\r
+ldap.reportaccessgroup=groupAccessReport\r
+\r
+# DataBase URL\r
+dburl=jdbc:mysql://localhost:3306/entlog ##MySQL DB address for reporting\r
+dbuser=user\r
+dbpassword=password\r
+hbm2ddl=update\r
+dbdriver=com.mysql.jdbc.Driver\r
+dbdialect=org.hibernate.dialect.MySQLDialect\r
+\r
+# Hibernate C3P0 configuration against Mysql server\r
+hibernate.c3p0.initialPoolSize=10\r
+hibernate.c3p0.minPoolSize=1\r
+hibernate.c3p0.maxPoolSize=25\r
+hibernate.c3p0.acquireRetryAttempts=10\r
+hibernate.c3p0.acquireIncrement=5\r
+hibernate.c3p0.idleConnectionTestPeriod=3600\r
+hibernate.c3p0.preferredTestQuery=SELECT 1;\r
+hibernate.c3p0.testConnectionOnCheckin=false\r
+hibernate.c3p0.maxConnectionAge=14400\r
+hibernate.c3p0.maxIdleTime=10800\r
+app.expirationPeriod=92\r
+\r
+# permet de differencier la gestion des fichiers Savoie ou Rouen --> copy or move\r
+# si true --> move alors on deplace les fichiers traité apres process\r
+# si false --> copy; on laisse une copie dans le repertoire a traiter et on compare avec les archives\r
+files.archive.move=true\r
--- /dev/null
+###############################################################################
+#
+# Copyright (c) 2008 Savoie Technolac, PENTILA SAS.
+#
+# Ce logiciel est diffuse sous les termes et conditions de la licence CECILL.
+# Voir le fichier joint Licence_CeCILL_V2-fr.txt pour plus de details.
+#
+###############################################################################
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+log4j.rootLogger=info, stdout
+#log4j.logger.org.hibernate=info
+#log4j.logger.org.hibernate=debug
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+### log just the SQL
+log4j.logger.org.hibernate.SQL=fatal
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=fatal
+### log schema export/update ###
+#log4j.logger.org.hibernate.tool.hbm2ddl=info
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=info
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
+log4j.logger.org.springframework=fatal
+
+log4j.logger.com.pentila=debug
\ No newline at end of file
--- /dev/null
+<!ELEMENT ficAlimMENESR (addRequest|modifyRequest|deleteRequest)*>\r
+<!ELEMENT addRequest (operationalAttributes, identifier, attributes)>\r
+<!ELEMENT modifyRequest (operationalAttributes, identifier, modifications)>\r
+<!ELEMENT deleteRequest (operationalAttributes, identifier)>\r
+<!ELEMENT operationalAttributes (attr)> <!-- Pas de controle : l'attribut "name" de l'element "attr" doit etre egal a "categoriePersonne" ou "categorieStructure" -->\r
+<!ELEMENT identifier (id)>\r
+<!ELEMENT attributes (attr+)>\r
+<!ELEMENT attr (value+)>\r
+<!ELEMENT modifications (modification+)>\r
+<!ELEMENT modification (value+)>\r
+<!ELEMENT value (#PCDATA)>\r
+<!ELEMENT id (#PCDATA)>\r
+<!ATTLIST attr name CDATA #REQUIRED>\r
+<!ATTLIST modification\r
+ name CDATA #REQUIRED\r
+ operation (replace) #REQUIRED>\r
+\r
+\r
--- /dev/null
+currentPath=`dirname "$0"`
+cd $currentPath
+
+java -Xmx1024M -jar sconetldap.jar
\ No newline at end of file
--- /dev/null
+currentPath=`dirname "$0"`
+cd $currentPath
+
+java -Xmx1024M -jar sconetldap.jar updatePWD
\ No newline at end of file
--- /dev/null
+<!ELEMENT ficAlimMENESR (addRequest|modifyRequest|deleteRequest)*>\r
+<!ELEMENT addRequest (operationalAttributes, identifier, attributes)>\r
+<!ELEMENT modifyRequest (operationalAttributes, identifier, modifications)>\r
+<!ELEMENT deleteRequest (operationalAttributes, identifier)>\r
+<!ELEMENT operationalAttributes (attr)> <!-- Pas de controle : l'attribut "name" de l'element "attr" doit etre egal a "categoriePersonne" ou "categorieStructure" -->\r
+<!ELEMENT identifier (id)>\r
+<!ELEMENT attributes (attr+)>\r
+<!ELEMENT attr (value+)>\r
+<!ELEMENT modifications (modification+)>\r
+<!ELEMENT modification (value+)>\r
+<!ELEMENT value (#PCDATA)>\r
+<!ELEMENT id (#PCDATA)>\r
+<!ATTLIST attr name CDATA #REQUIRED>\r
+<!ATTLIST modification\r
+ name CDATA #REQUIRED\r
+ operation (replace) #REQUIRED>\r
+\r
+\r
--- /dev/null
+CeCILL-C FREE SOFTWARE LICENSE AGREEMENT
+
+
+ Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+ * firstly, compliance with the principles governing the distribution
+ of Free Software: access to source code, broad rights granted to
+ users,
+ * secondly, the election of a governing law, French law, with which
+ it is conformant, both as regards the law of torts and
+ intellectual property law, and the protection that it offers to
+ both authors and holders of the economic rights over software.
+
+The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial research establishment, having its principal place of
+business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+ Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and re-use the software governed by this license.
+
+The exercising of this right is conditional upon the obligation to make
+available to the community the modifications made to the source code of
+the software so as to contribute to its evolution.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+suitability of the software as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+ Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Integrated Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Integrated
+Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Integrated Contribution: means any or all modifications, corrections,
+translations, adaptations and/or new functions integrated into the
+Source Code by any or all Contributors.
+
+Related Module: means a set of sources files including their
+documentation that, without modification to the Source Code, enables
+supplementary functions or services in addition to those offered by the
+Software.
+
+Derivative Software: means any combination of the Software, modified or
+not, and of a Related Module.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+ Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the
+protection granted by the rights over said Software.
+
+
+ Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+ * (i) loading the Software by any or all means, notably, by
+ downloading from a remote server, or by loading from a physical
+ medium;
+ * (ii) the first time the Licensee exercises any of the rights
+ granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and
+understood it.
+
+
+ Article 4 - EFFECTIVE DATE AND TERM
+
+
+ 4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+ 4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+ Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+ 5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+ 1. permanent or temporary reproduction of all or part of the Software
+ by any or all means and in any or all form.
+
+ 2. loading, displaying, running, or storing the Software on any or
+ all medium.
+
+ 3. entitlement to observe, study or test its operation so as to
+ determine the ideas and principles behind any or all constituent
+ elements of said Software. This shall apply when the Licensee
+ carries out any or all loading, displaying, running, transmission
+ or storage operation as regards the Software, that it is entitled
+ to carry out hereunder.
+
+
+ 5.2 RIGHT OF MODIFICATION
+
+The right of modification includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting software. It includes, in particular, the
+right to create a Derivative Software.
+
+The Licensee is authorized to make any or all modification to the
+Software provided that it includes an explicit notice that it is the
+author of said modification and indicates the date of the creation thereof.
+
+
+ 5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+ 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+ 1. a copy of the Agreement,
+
+ 2. a notice relating to the limitation of both the Licensor's
+ warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows effective access to the full Source
+Code of the Software at a minimum during the entire period of its
+distribution of the Software, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+ 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes an Integrated Contribution to the Software, the
+terms and conditions for the distribution of the resulting Modified
+Software become subject to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+source code or object code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+ 1. a copy of the Agreement,
+
+ 2. a notice relating to the limitation of both the Licensor's
+ warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the object code of the Modified
+Software is redistributed, the Licensee allows effective access to the
+full source code of the Modified Software at a minimum during the entire
+period of its distribution of the Modified Software, it being understood
+that the additional cost of acquiring the source code shall not exceed
+the cost of transferring the data.
+
+
+ 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE
+
+When the Licensee creates Derivative Software, this Derivative Software
+may be distributed under a license agreement other than this Agreement,
+subject to compliance with the requirement to include a notice
+concerning the rights over the Software as defined in Article 6.4.
+In the event the creation of the Derivative Software required modification
+of the Source Code, the Licensee undertakes that:
+
+ 1. the resulting Modified Software will be governed by this Agreement,
+ 2. the Integrated Contributions in the resulting Modified Software
+ will be clearly identified and documented,
+ 3. the Licensee will allow effective access to the source code of the
+ Modified Software, at a minimum during the entire period of
+ distribution of the Derivative Software, such that such
+ modifications may be carried over in a subsequent version of the
+ Software; it being understood that the additional cost of
+ purchasing the source code of the Modified Software shall not
+ exceed the cost of transferring the data.
+
+
+ 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE
+
+When a Modified Software contains an Integrated Contribution subject to
+the CeCILL license agreement, or when a Derivative Software contains a
+Related Module subject to the CeCILL license agreement, the provisions
+set forth in the third item of Article 6.4 are optional.
+
+
+ Article 6 - INTELLECTUAL PROPERTY
+
+
+ 6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by this Agreement, for the duration set forth in Article 4.2.
+
+
+ 6.2 OVER THE INTEGRATED CONTRIBUTIONS
+
+The Licensee who develops an Integrated Contribution is the owner of the
+intellectual property rights over this Contribution as defined by
+applicable law.
+
+
+ 6.3 OVER THE RELATED MODULES
+
+The Licensee who develops a Related Module is the owner of the
+intellectual property rights over this Related Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution under the conditions defined in Article 5.3.3.
+
+
+ 6.4 NOTICE OF RIGHTS
+
+The Licensee expressly undertakes:
+
+ 1. not to remove, or modify, in any manner, the intellectual property
+ notices attached to the Software;
+
+ 2. to reproduce said notices, in an identical manner, in the copies
+ of the Software modified or not;
+
+ 3. to ensure that use of the Software, its intellectual property
+ notices and the fact that it is governed by the Agreement is
+ indicated in a text that is easily accessible, specifically from
+ the interface of any Derivative Software.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-Ã -vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+ Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+ Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+ Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the suitability of the product for its requirements, its good working
+order, and for ensuring that it shall not cause damage to either persons
+or properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+ Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+ Article 11 - MISCELLANEOUS
+
+
+ 11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+ 11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+ Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version.
+
+
+ Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 1.0 dated 2006-09-05.
\ No newline at end of file
--- /dev/null
+<?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="propertyPlaceholderConfigurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+-->
+ <bean id="dataSource"
+ class="com.mchange.v2.c3p0.ComboPooledDataSource"
+ destroy-method="close">
+ <description>DataSource for Mysql with C3P0 Connexion Pool management.</description>
+
+ <property name="driverClass" value="${dbdriver}" />
+ <property name="jdbcUrl"
+ value="${dburl}" />
+ <property name="user" value="${dbuser}" />
+ <property name="password" value="${dbpassword}" />
+
+ <property name="initialPoolSize"><value>${hibernate.c3p0.initialPoolSize}</value></property>
+ <property name="minPoolSize"><value>${hibernate.c3p0.minPoolSize}</value></property>
+ <property name="maxPoolSize"><value>${hibernate.c3p0.maxPoolSize}</value></property>
+ <property name="acquireRetryAttempts"><value>${hibernate.c3p0.acquireRetryAttempts}</value></property>
+ <property name="acquireIncrement"><value>${hibernate.c3p0.acquireIncrement}</value></property>
+ <property name="idleConnectionTestPeriod"><value>${hibernate.c3p0.idleConnectionTestPeriod}</value></property>
+ <property name="maxIdleTime"><value>${hibernate.c3p0.maxIdleTime}</value></property>
+ <property name="maxConnectionAge"><value>${hibernate.c3p0.maxConnectionAge}</value></property>
+ <property name="preferredTestQuery"><value>${hibernate.c3p0.preferredTestQuery}</value></property>
+ <property name="testConnectionOnCheckin"><value>${hibernate.c3p0.testConnectionOnCheckin}</value></property>
+ </bean>
+
+ <!-- Hibernate SessionFactory -->
+ <bean id="sessionFactory"
+ class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+
+ <description>SessionFactory Bean declaration for dataSource</description>
+
+ <property name="dataSource"><ref local="dataSource"/></property>
+ <property name="packagesToScan" value="com.pentila.sconet.model.log"/>
+
+
+
+
+
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">${dbdialect}</prop>
+ <prop key="hibernate.hbm2ddl.auto">${hbm2ddl}</prop>
+
+ <prop key="hibernate.c3p0.acquire_increment">${hibernate.c3p0.acquireIncrement}</prop>
+ <prop key="hibernate.c3p0.idle_test_period">${hibernate.c3p0.idleConnectionTestPeriod}</prop>
+ <prop key="hibernate.c3p0.timeout">${hibernate.c3p0.maxIdleTime}</prop>
+ <prop key="hibernate.c3p0.max_size">${hibernate.c3p0.maxPoolSize}</prop>
+ <prop key="hibernate.c3p0.min_size">${hibernate.c3p0.minPoolSize}</prop>
+
+
+ </props>
+ </property>
+ </bean>
+
+ <bean id="logDAO" class="com.pentila.sconet.manager.LogDAO">
+ <property name="sessionFactory"><ref bean="sessionFactory"/></property>
+ </bean>
+
+ <bean id="BeanUtil" class="com.pentila.sconet.manager.Beans" />
+
+</beans>
--- /dev/null
+<?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="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:configuration.properties</value>
+ </list>
+ </property>
+ <property name="ignoreUnresolvablePlaceholders"><value>true</value></property>
+</bean>
+
+
+<import resource="applicationContext-hibernate.xml"/>
+
+<bean id="contextSource" class="org.springframework.ldap.pool.factory.PoolingContextSource">
+ <property name="contextSource" ref="contextSourceTarget" />
+ <property name="dirContextValidator" ref="dirContextValidator" />
+ <property name="testOnBorrow" value="true" />
+ <property name="testWhileIdle" value="true" />
+ </bean>
+
+ <bean id="dirContextValidator"
+ class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" />
+
+ <bean id="contextSourceTarget"
+ class="org.springframework.ldap.core.support.LdapContextSource">
+ <description>Contexte LDAP via Spring</description>
+ <property name="urls" value="ldap://${ldap.server.ip}:${ldap.server.port}" />
+ <property name="userDn" value="${ldap.managerDN}"/>
+ <property name="password" value="${ldap.managerPWD}"/>
+ <property name="base" value="${ldap.branch.suffix}"/>
+ <property name="dirObjectFactory" value="org.springframework.ldap.core.support.DefaultDirObjectFactory" />
+ <property name="pooled" value="false"/>
+ </bean>
+
+ <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
+ <description>Template d'acces Spring pour LDAP</description>
+ <constructor-arg ref="contextSource"/>
+ </bean>
+
+ <bean id="ldapPasswordEncoder" class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+
+ <bean id="ldapManager" class="com.pentila.sconet.manager.LdapManager" init-method="initialize">
+ <constructor-arg type="java.lang.String" index="0"><value>${ldap.schema.person}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="1"><value>${ldap.schema.structure}</value></constructor-arg>
+ <constructor-arg type="java.lang.String" index="2"><value>${ldap.schema.groups}</value></constructor-arg>
+
+ <property name="ldapTemplate" ><ref bean="ldapTemplate" /></property>
+ <property name="suffix"><value>${ldap.branch.suffix}</value></property>
+ <property name="branchPeople"><value>${ldap.branch.people}</value></property>
+ <property name="branchGroups"><value>${ldap.branch.groups}</value></property>
+ <property name="branchEtablissements"><value>${ldap.branch.etabs}</value></property>
+ <property name="groupMemberName"><value>${ldap.groupmembername}</value></property>
+ <property name="groupReportAccess"><value>${ldap.reportaccessgroup}</value></property>
+ <property name="ldapPasswordEncoder"><ref bean="ldapPasswordEncoder" /></property>
+ </bean>
+
+ <bean id="sconetManager" class="com.pentila.sconet.manager.SconetManager" init-method="loadFiles">
+ <property name="filesLocation"><value>${sconet.filesLocation}</value></property>
+ <property name="filesArchiveLocation"><value>${sconet.filesArchiveLocation}</value></property>
+ <property name="filesArchiveMove"><value>${files.archive.move}</value></property>
+ </bean>
+
+ <bean id="processor" class="com.pentila.sconet.manager.Processor">
+ <property name="ldapManager"><ref bean="ldapManager" /></property>
+ <property name="sconetManager"><ref bean="sconetManager" /></property>
+ <property name="expirationPeriod"><value>${app.expirationPeriod}</value></property>
+ </bean>
+
+</beans>
--- /dev/null
+package com.pentila.sconet;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import com.pentila.sconet.manager.Processor;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Importer.
+ */
+public class Importer {
+
+ /**
+ * The main method.
+ *
+ * @param args the args
+ */
+ public static void main(String[] args) {
+ String importType = "classic";
+ try{
+ importType = args[0];
+ }
+ catch(Exception e) {}
+
+ // Call Spring bean config
+ final ApplicationContext ctx = new ClassPathXmlApplicationContext(
+ "applicationContext.xml");
+ // Lance le processus de sycnhronization
+ Processor p = (Processor) ctx.getBean("processor");
+
+ if (importType.equals("updatePWD")) {
+ p.updatePWDTable();
+ }
+ else {
+ p.run();
+ }
+
+ }
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Beans.
+ */
+public class Beans implements ApplicationContextAware {
+
+ /** The ctx. */
+ private static ApplicationContext ctx;
+
+ /* (non-Javadoc)
+ * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+ */
+ public void setApplicationContext(ApplicationContext ctx)
+ throws BeansException {
+ // TODO Auto-generated method stub
+ Beans.ctx = ctx;
+ }
+
+ /**
+ * Gets the application context.
+ *
+ * @return the application context
+ */
+ public static ApplicationContext getApplicationContext() {
+ return Beans.ctx;
+ }
+
+ /*
+ * Retourne le bean de log.
+ */
+
+ /**
+ * Gets the log dao.
+ *
+ * @return the log dao
+ */
+ public static LogDAO getLogDAO() {
+ LogDAO log = (LogDAO) ctx.getBean("logDAO");
+ return log;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+/**
+ * The Interface ILog.
+ */
+public interface ILog {
+
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+
+import org.apache.log4j.Logger;
+import org.springframework.ldap.NamingException;
+import org.springframework.ldap.core.AttributesMapper;
+import org.springframework.ldap.core.ContextExecutor;
+import org.springframework.ldap.core.LdapTemplate;
+import org.springframework.ldap.core.NameClassPairCallbackHandler;
+import org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder;
+import org.springframework.util.StringUtils;
+
+import com.pentila.sconet.model.ldap.EtabMapper;
+import com.pentila.sconet.model.ldap.EtabRef;
+import com.pentila.sconet.model.ldap.GroupMapper;
+import com.pentila.sconet.model.ldap.GroupRef;
+import com.pentila.sconet.model.ldap.PersonMapper;
+import com.pentila.sconet.model.ldap.PersonRef;
+import com.pentila.sconet.model.xml.ExtAttribute;
+import com.pentila.sconet.util.Utils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class LdapManager.
+ */
+public class LdapManager {
+
+ /** declaration du logger */
+ private final static Logger logger = Logger.getLogger(LdapManager.class);
+
+ // Suffix LDAP (ex : dc=pentila,dc=org)
+ /** The suffix. */
+ private String suffix;
+
+ // Branche People (ex : ou=people)
+ /** The branch people. */
+ private String branchPeople;
+
+ //Branche Groups (ex : ou=groups)
+ /** The branch groups. */
+ private String branchGroups;
+
+ //Branche Etablisssement (ex : ou=etablissement)
+ /** The branch etablissements. */
+ private String branchEtablissements;
+
+ // Style de membre de groupe ldap (ex : member)
+ /** The group member name. */
+ private String groupMemberName;
+
+ // tableau de classes LDAP décrivant des personnes
+ /** The person class names. */
+ private String[] personClassNames;
+
+ // tableau de classes LDAP décrivant des structures
+ /** The structure class names. */
+ private String[] structureClassNames;
+
+ // tableau de classes LDAP décrivant des groupes / Classes
+ /** The groupes class names. */
+ private String[] groupesClassNames;
+
+ // Spring LDAP template
+ /** The ldap template. */
+ private LdapTemplate ldapTemplate;
+
+ // Encoder SHA pour les mots de passe
+ /** The ldap password encoder. */
+ private LdapShaPasswordEncoder ldapPasswordEncoder;
+
+
+ // Definition des commandes d'obtention de schema LDAP
+ /** The Constant CLASS. */
+ public static final String CLASS = "ClassDefinition";
+
+ /** The Constant ATTR. */
+ public static final String ATTR = "AttributeDefinition";
+
+ // classNames => Attributes
+ /** The cl map. */
+ Map<String, Attributes> clMap = new HashMap<String, Attributes>();
+
+ // attrName => Attributes
+ /** The attr map. */
+ Map<String, Attributes> attrMap = new HashMap<String, Attributes>();
+
+ // Attribute Schema Extension : MultiVal etc ....
+ /** The ext attr map. */
+ Map<String, ExtAttribute> extAttrMap = new HashMap<String, ExtAttribute>();
+
+
+ // SENTPersonJointure => PersonRef object (Data Source : LDAP Server)
+ /** The join people. */
+ private Map<String, PersonRef> joinPeople;
+
+ // UID => PersonRef (Data Source : LDAP Server)
+ /** The uid people. */
+ private Map<String, PersonRef> uidPeople;
+
+ // dn (full) => PersonRef (Data Source : LDAP Server)
+ /** The dn people. */
+ private Map<String, PersonRef> dnPeople;
+
+ // Login => PersonRef (Data Source : LDAP Server)
+ /** The login people. */
+ private Map<String, PersonRef> loginPeople;
+
+
+
+
+ private Map<String, Set<PersonRef>> parentPeople;
+
+
+ // id group (cn) => GroupRef (Data Source : LDAP Server)
+ /** The id groups. */
+ private Map<String, GroupRef> idGroups;
+
+ // dn group (full) => GroupRef (Data Source : LDAP Server)
+ /** The dn groups. */
+ private Map<String, GroupRef> dnGroups;
+
+ // dn member (full) => Set<DNGroups> (Data Source : LDAP Server)
+ /** The dn groups. */
+ private Map<String, Set<String>> dnMemberGroups;
+
+ // id Etab (ou) => EtabRef (Data Source : LDAP Server)
+ /** The id etabs. */
+ private Map<String, EtabRef> idEtabs;
+
+ // dn (full) etabl => EtabRef (Data Source : LDAP Server)
+ /** The dn etabs. */
+ private Map<String, EtabRef> dnEtabs;
+
+ private String groupReportAccess;
+
+ /**
+ * Instantiates a new ldap manager.
+ *
+ * @param pcn the pcn
+ * @param scn the scn
+ * @param gcn the gcn
+ */
+ public LdapManager(String pcn, String scn, String gcn) {
+
+ // Initialisation : Structure de reconnaissance de classes et attribut
+ personClassNames = StringUtils.commaDelimitedListToStringArray(pcn);
+ structureClassNames = StringUtils.commaDelimitedListToStringArray(scn);
+ groupesClassNames = StringUtils.commaDelimitedListToStringArray(gcn);
+
+ joinPeople = new HashMap<String, PersonRef>();
+ uidPeople = new HashMap<String, PersonRef>();
+ dnPeople = new HashMap<String, PersonRef>();
+ loginPeople = new HashMap<String, PersonRef>();
+ parentPeople = new HashMap<String, Set<PersonRef>>();
+
+
+ idGroups = new HashMap<String, GroupRef>();
+ dnGroups = new HashMap<String, GroupRef>();
+
+ dnMemberGroups = new HashMap<String, Set<String>>();
+
+ idEtabs = new HashMap<String, EtabRef>();
+ dnEtabs = new HashMap<String, EtabRef>();
+ }
+
+ /**
+ * Initialize Maps.
+ */
+ public void initialize() {
+ initializeObjectClassMaps();
+ }
+
+ /**
+ * Gets the suffix.
+ *
+ * @return the suffix
+ */
+ public String getSuffix() {
+ return suffix;
+ }
+
+ /**
+ * Sets the suffix.
+ *
+ * @param suffix the new suffix
+ */
+ public void setSuffix(String suffix) {
+ this.suffix = suffix;
+ }
+
+ /**
+ * Gets the person class names.
+ *
+ * @return the person class names
+ */
+ public String[] getPersonClassNames() {
+ return personClassNames;
+ }
+
+ /**
+ * Sets the person class names.
+ *
+ * @param personClassNames the new person class names
+ */
+ public void setPersonClassNames(String[] personClassNames) {
+ this.personClassNames = personClassNames;
+ }
+
+ /**
+ * Gets the structure class names.
+ *
+ * @return the structure class names
+ */
+ public String[] getStructureClassNames() {
+ return structureClassNames;
+ }
+
+ /**
+ * Sets the structure class names.
+ *
+ * @param structureClassNames the new structure class names
+ */
+ public void setStructureClassNames(String[] structureClassNames) {
+ this.structureClassNames = structureClassNames;
+ }
+
+ /**
+ * Gets the groupes class names.
+ *
+ * @return the groupes class names
+ */
+ public String[] getGroupesClassNames() {
+ return groupesClassNames;
+ }
+
+ /**
+ * Sets the groupes class names.
+ *
+ * @param groupesClassNames the new groupes class names
+ */
+ public void setGroupesClassNames(String[] groupesClassNames) {
+ this.groupesClassNames = groupesClassNames;
+ }
+
+ /**
+ * Gets the ldap template.
+ *
+ * @return the ldap template
+ */
+ public LdapTemplate getLdapTemplate() {
+ return ldapTemplate;
+ }
+
+ /**
+ * Sets the ldap template.
+ *
+ * @param ldapTemplate the new ldap template
+ */
+ public void setLdapTemplate(LdapTemplate ldapTemplate) {
+ this.ldapTemplate = ldapTemplate;
+ }
+
+ /**
+ * Gets the object schema def from LDAP Schema definition of LDAP Server.
+ *
+ * @param kind CLASS/ATTR
+ * @param name nom de classe ou nom d'attribut
+ *
+ * @return the object schema def
+ */
+ public Attributes getObjectSchemaDef(String kind, final String name) {
+
+ ContextExecutor executor = new ContextExecutor() {
+ public DirContext executeWithContext(DirContext ctx) {
+ DirContext schema = null;
+
+ try {
+ schema = ctx.getSchema("");
+ } catch (NamingException e) {
+ System.out.println("getSchema failed");
+ e.printStackTrace();
+ } catch (javax.naming.NamingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return schema;
+
+ }
+ };
+
+ DirContext schema = (DirContext) this.ldapTemplate
+ .executeReadOnly(executor);
+
+ try {
+
+ DirContext s = (DirContext) schema.lookup(kind + "/" + name.trim());
+ javax.naming.directory.Attributes Attrs = s.getAttributes("");
+
+ return Attrs;
+ } catch (javax.naming.NamingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+
+ }
+
+ /**
+ * Initialize object class maps.
+ */
+ public void initializeObjectClassMaps() {
+ //System.out.println("LOADING SCHEMA CLASSES OBEJCTS");
+ for (String name : getPersonClassNames()) {
+ Attributes attrs = getObjectSchemaDef(CLASS, name);
+ buildMaps(name, attrs);
+ }
+
+ for (String name : this.getGroupesClassNames()) {
+
+ Attributes attrs = getObjectSchemaDef(CLASS, name);
+ buildMaps(name, attrs);
+
+ }
+
+ for (String name : this.getStructureClassNames()) {
+
+ Attributes attrs = getObjectSchemaDef(CLASS, name);
+
+ buildMaps(name, attrs);
+
+ }
+
+ //System.out.println("DONE!");
+
+ }
+
+ /**
+ * Builds the maps.
+ *
+ * @param name the name
+ * @param attrs the attrs
+ */
+ private void buildMaps(String name, Attributes attrs) {
+ clMap.put(name, attrs);
+
+ Attribute must = attrs.get("must");
+ Attribute may = attrs.get("may");
+
+ if (must != null) {
+ Set<String> attrsvalues = Utils.getStringValues(must);
+ for (String av : attrsvalues) {
+ attrMap.put(av, attrs);
+ if (!extAttrMap.containsKey(av)) {
+ ExtAttribute ea = new ExtAttribute();
+ Attributes aa = getObjectSchemaDef(ATTR, av);
+
+ ea.setName(av);
+
+ ea.setMust(true);
+ if (aa.get("SINGLE-VALUE") == null) {
+ ea.setSingleValue(false);
+ } else {
+ ea.setSingleValue(true);
+ }
+
+ extAttrMap.put(av, ea);
+ }
+
+ extAttrMap.get(av).getClassNames().add(name);
+ }
+ }
+ if (may != null) {
+ Set<String> attrsvalues = Utils.getStringValues(may);
+ for (String av : attrsvalues) {
+ attrMap.put(av, attrs);
+ if (!extAttrMap.containsKey(av)) {
+
+ ExtAttribute ea = new ExtAttribute();
+ Attributes aa = getObjectSchemaDef(ATTR, av);
+
+ ea.setName(av);
+
+ ea.setMust(false);
+ if (aa.get("SINGLE-VALUE") == null) {
+ ea.setSingleValue(false);
+ } else {
+ ea.setSingleValue(true);
+ }
+
+ try {
+ if (aa.get("SUP") != null
+ && aa.get("SUP").get().equals(
+ "distinguishedName")) {
+ ea.setDn(true);
+ }
+
+ } catch (javax.naming.NamingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ extAttrMap.put(av, ea);
+ }
+
+ extAttrMap.get(av).getClassNames().add(name);
+
+ }
+ }
+ }
+
+ /**
+ * Gets the branch people.
+ *
+ * @return the branch people
+ */
+ public String getBranchPeople() {
+ return branchPeople;
+ }
+
+ /**
+ * Sets the branch people.
+ *
+ * @param branchPeople the new branch people
+ */
+ public void setBranchPeople(String branchPeople) {
+ this.branchPeople = branchPeople;
+ }
+
+ /**
+ * Gets the branch groups.
+ *
+ * @return the branch groups
+ */
+ public String getBranchGroups() {
+ return branchGroups;
+ }
+
+ /**
+ * Sets the branch groups.
+ *
+ * @param branchGroups the new branch groups
+ */
+ public void setBranchGroups(String branchGroups) {
+ this.branchGroups = branchGroups;
+ }
+
+ /**
+ * Gets the branch etablissements.
+ *
+ * @return the branch etablissements
+ */
+ public String getBranchEtablissements() {
+ return branchEtablissements;
+ }
+
+ /**
+ * Sets the branch etablissements.
+ *
+ * @param branchEtablissements the new branch etablissements
+ */
+ public void setBranchEtablissements(String branchEtablissements) {
+ this.branchEtablissements = branchEtablissements;
+ }
+
+ /**
+ * Construit les structures reprentant la branche PEOPLE.
+ */
+ public void buildPersonRef() {
+
+ //System.out.println("START SYNCHRONIZE PEOPLE ...");
+ logger.debug("START SYNCHRONIZE PEOPLE ... buildPersonRef");
+
+ joinPeople.clear();
+ uidPeople.clear();
+ dnPeople.clear();
+ loginPeople.clear();
+ parentPeople.clear();
+
+ List<PersonRef> l = ldapTemplate.search(getBranchPeople(),
+ "(objectclass=person)", new PersonMapper());
+
+ for (PersonRef er : l) {
+
+ String join = er.getJoin();
+ String uid = er.getId();
+ String dn = String.format("uid=%s,%s,%s", er.getId(), this
+ .getBranchPeople(), this.getSuffix());
+ er.setDn(dn);
+ String login = er.getLogin();
+
+ joinPeople.put(join, er);
+ uidPeople.put(uid, er);
+ dnPeople.put(dn, er);
+ loginPeople.put(login, er);
+
+ for (String pdn : er.getParentDns()){
+ if (!parentPeople.containsKey(pdn)){
+ parentPeople.put(pdn, new HashSet<PersonRef>());
+ }
+ parentPeople.get(pdn).add(er);
+
+ }
+
+
+ }
+
+ logger.debug("END SYNCHRONIZE PEOPLE ... buildPersonRef");
+
+ }
+
+ /**
+ * Retourne une liste de l'ensemble des utilisateurs LDAP
+ */
+ public Set<String> getDNLDAPListPeople() {
+ // on ne prend que ceux qui ne sont pas businessCategory=EXT
+ Set<String> allLDAPPeople = new HashSet<String>();
+
+ List<PersonRef> l = ldapTemplate.search(getBranchPeople(),
+ "(&(objectclass=person)(!(businessCategory=EXT)))", new PersonMapper());
+
+ for (PersonRef er : l) {
+
+ String dn = String.format("uid=%s,%s", er.getId(), this
+ .getBranchPeople());
+ er.setDn(dn);
+
+ allLDAPPeople.add(dn);
+ }
+
+ return allLDAPPeople;
+ }
+
+
+ /**
+ * Retourne l'ensemble des utilisateurs LDAP
+ */
+ public List<PersonRef> getAllPeople() {
+
+ logger.debug("Start getting all users");
+
+ List<PersonRef> l = ldapTemplate.search(getBranchPeople(),
+ "(objectclass=person)", new PersonMapper());
+
+ logger.debug("Ending getting all users");
+ return l;
+ }
+
+ /**
+ * Retourne un utilisateur LDAP en fonction de son dn
+ */
+ public List<PersonRef> getPersonFromDN(String userDN) {
+
+ List<PersonRef> l = ldapTemplate.search(getBranchPeople(),
+ "(dn="+ userDN +")", new PersonMapper());
+
+ return l;
+ }
+
+
+ /**
+ * Gets the object classes by attribute names.
+ *
+ * @param as the as
+ *
+ * @return the object classes by attribute names
+ */
+ public Set<String> getObjectClassesByAttributeNames(Set<String> as) {
+ Set<String> ss = new HashSet<String>();
+
+ for (String attributeName : as) {
+
+ if (extAttrMap.containsKey(attributeName)) {
+ ExtAttribute ea = extAttrMap.get(attributeName);
+
+ ss.addAll(ea.getClassNames());
+
+ } else {
+ //System.out.println("Attribute Name : " + attributeName
+ // + " Not FOUND !");
+ }
+
+ }
+
+ if (ss.contains("ENTStructure") || ss.contains("ENTEtablissement")) {
+ ss.remove("person");
+ }
+
+ if (ss.contains("person") || ss.contains("ENTPerson")) {
+ ss.remove("organizationalUnit");
+ }
+
+ return ss;
+ }
+
+ /**
+ * Gets the cl map.
+ *
+ * @return the cl map
+ */
+ public Map<String, Attributes> getClMap() {
+ return clMap;
+ }
+
+ /**
+ * Sets the cl map.
+ *
+ * @param clMap the cl map
+ */
+ public void setClMap(Map<String, Attributes> clMap) {
+ this.clMap = clMap;
+ }
+
+ /**
+ * Gets the attr map.
+ *
+ * @return the attr map
+ */
+ public Map<String, Attributes> getAttrMap() {
+ return attrMap;
+ }
+
+ /**
+ * Sets the attr map.
+ *
+ * @param attrMap the attr map
+ */
+ public void setAttrMap(Map<String, Attributes> attrMap) {
+ this.attrMap = attrMap;
+ }
+
+ /**
+ * Gets the ext attr map.
+ *
+ * @return the ext attr map
+ */
+ public Map<String, ExtAttribute> getExtAttrMap() {
+ return extAttrMap;
+ }
+
+ /**
+ * Sets the ext attr map.
+ *
+ * @param extAttrMap the ext attr map
+ */
+ public void setExtAttrMap(Map<String, ExtAttribute> extAttrMap) {
+ this.extAttrMap = extAttrMap;
+ }
+
+ /**
+ * Builds the group ref.
+ */
+ public void buildGroupRef() {
+
+ logger.debug("START SYNCHRONIZE GROUP ... buildGroupRef");
+
+ idGroups.clear();
+ dnGroups.clear();
+
+ dnMemberGroups.clear();
+
+ String cnAllMemberGrp = Utils.fixDN(getGroupMemberName());
+
+ List<GroupRef> l = ldapTemplate.search(getBranchGroups(),
+ "(&(objectclass=groupOfNames)(!(businessCategory=user)))", new GroupMapper());
+
+ for (GroupRef er : l) {
+ String cn = er.getId();
+
+ if (cn != null && !cn.equals("")) {
+
+ idGroups.put(cn, er);
+ String dn = String.format("cn=%s,%s,%s", er.getId(), this
+ .getBranchGroups(), this.getSuffix());
+ er.setDn(dn);
+ dnGroups.put(dn, er);
+
+ if (!cn.equals(cnAllMemberGrp)) {
+ for (String dnMember: er.getMembers()) {
+ if (!dnMemberGroups.containsKey(dnMember)) {
+ dnMemberGroups.put(dnMember, new HashSet<String>());
+ }
+ dnMemberGroups.get(dnMember).add(dn);
+ }
+ }
+ }
+ }
+ logger.debug("END SYNCHRONIZE GROUP ... buildGroupRef");
+
+ }
+
+ /**
+ * Builds the etab ref.
+ */
+ public void buildEtabRef() {
+
+ logger.debug("START SYNCHRONIZE ETAB ... buildEtabRef");
+
+ idEtabs.clear();
+ dnEtabs.clear();
+
+ List<EtabRef> l = ldapTemplate.search(this.getBranchEtablissements(),
+ "(objectclass=organizationalUnit)", new EtabMapper());
+
+ for (EtabRef er : l) {
+ String ou = er.getId();
+
+ if (ou != null && !ou.equals("")) {
+
+ idEtabs.put(ou, er);
+ String dn = String.format("ou=%s,%s,%s", er.getId(), this
+ .getBranchEtablissements(), this.getSuffix());
+ er.setDn(dn);
+ dnEtabs.put(dn, er);
+ }
+ }
+ logger.debug("END SYNCHRONIZE ETAB ... buildEtabRef");
+
+ }
+
+ /**
+ * Adds the.
+ *
+ * @param dn the dn
+ * @param a the a
+ */
+ public void add(String dn, Attributes a) {
+ logger.debug("Ajout de "+dn);
+ try {
+ ldapTemplate.bind(dn, null, a);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Gets the encypted password.
+ *
+ * @param clearpass the clearpass
+ *
+ * @return the encypted password
+ */
+ public String getEncyptedPassword(String clearpass) {
+ return ldapPasswordEncoder.encodePassword(clearpass, null);
+ }
+
+ /**
+ * Gets the ldap password encoder.
+ *
+ * @return the ldap password encoder
+ */
+ public LdapShaPasswordEncoder getLdapPasswordEncoder() {
+ return ldapPasswordEncoder;
+ }
+
+ /**
+ * Sets the ldap password encoder.
+ *
+ * @param ldapPasswordEncoder the new ldap password encoder
+ */
+ public void setLdapPasswordEncoder(
+ LdapShaPasswordEncoder ldapPasswordEncoder) {
+ this.ldapPasswordEncoder = ldapPasswordEncoder;
+ }
+
+ /**
+ * Gets the join people.
+ *
+ * @return the join people
+ */
+ public Map<String, PersonRef> getJoinPeople() {
+ return joinPeople;
+ }
+
+ /**
+ * Sets the join people.
+ *
+ * @param joinPeople the join people
+ */
+ public void setJoinPeople(Map<String, PersonRef> joinPeople) {
+ this.joinPeople = joinPeople;
+ }
+
+ /**
+ * Gets the uid people.
+ *
+ * @return the uid people
+ */
+ public Map<String, PersonRef> getUidPeople() {
+ return uidPeople;
+ }
+
+ /**
+ * Sets the uid people.
+ *
+ * @param uidPeople the uid people
+ */
+ public void setUidPeople(Map<String, PersonRef> uidPeople) {
+ this.uidPeople = uidPeople;
+ }
+
+ /**
+ * Gets the dn people.
+ *
+ * @return the dn people
+ */
+ public Map<String, PersonRef> getDnPeople() {
+ return dnPeople;
+ }
+
+ /**
+ * Sets the dn people.
+ *
+ * @param dnPeople the dn people
+ */
+ public void setDnPeople(Map<String, PersonRef> dnPeople) {
+ this.dnPeople = dnPeople;
+ }
+
+ /**
+ * Gets the login people.
+ *
+ * @return the login people
+ */
+ public Map<String, PersonRef> getLoginPeople() {
+ return loginPeople;
+ }
+
+ /**
+ * Sets the login people.
+ *
+ * @param loginPeople the login people
+ */
+ public void setLoginPeople(Map<String, PersonRef> loginPeople) {
+ this.loginPeople = loginPeople;
+ }
+
+ /**
+ * Gets the id groups.
+ *
+ * @return the id groups
+ */
+ public Map<String, GroupRef> getIdGroups() {
+ return idGroups;
+ }
+
+ /**
+ * Sets the id groups.
+ *
+ * @param idGroups the id groups
+ */
+ public void setIdGroups(Map<String, GroupRef> idGroups) {
+ this.idGroups = idGroups;
+ }
+
+ /**
+ * Gets the dn groups.
+ *
+ * @return the dn groups
+ */
+ public Map<String, GroupRef> getDnGroups() {
+ return dnGroups;
+ }
+
+ /**
+ * Sets the dn groups.
+ *
+ * @param dnGroups the dn groups
+ */
+ public void setDnGroups(Map<String, GroupRef> dnGroups) {
+ this.dnGroups = dnGroups;
+ }
+
+ /**
+ * Modify.
+ *
+ * @param dn the dn
+ * @param sattrs the sattrs
+ * @param type the type
+ */
+ public void modify(String dn, Set<BasicAttribute> sattrs, String type) {
+
+ logger.debug("START MODIFY ENTRY "+ dn +" (modify in LDAPManager)");
+
+ int mode;
+ if (type.equals("add")) {
+ mode = DirContext.ADD_ATTRIBUTE;
+ } else if (type.equals("replace")) {
+ mode = DirContext.REPLACE_ATTRIBUTE;
+ } else {
+ mode = DirContext.REMOVE_ATTRIBUTE;
+ }
+
+ ModificationItem[] miArray = new ModificationItem[sattrs.size()];
+
+ int i = 0;
+
+ for (BasicAttribute ba : sattrs) {
+
+ ModificationItem item = new ModificationItem(mode, ba);
+
+ miArray[i] = item;
+ i++;
+ }
+ ldapTemplate.modifyAttributes(dn, miArray);
+
+ logger.debug("END MODIFY ENTRY "+ dn +" (modify in LDAPManager)");
+
+ }
+
+ /**
+ * Delete.
+ *
+ * @param dn the dn
+ */
+ public void delete(String dn) {
+ logger.debug("Delete de "+dn);
+
+ ldapTemplate.unbind(dn);
+
+ }
+
+ /**
+ * Gets the id etabs.
+ *
+ * @return the id etabs
+ */
+ public Map<String, EtabRef> getIdEtabs() {
+ return idEtabs;
+ }
+
+ /**
+ * Sets the id etabs.
+ *
+ * @param idEtabs the id etabs
+ */
+ public void setIdEtabs(Map<String, EtabRef> idEtabs) {
+ this.idEtabs = idEtabs;
+ }
+
+ /**
+ * Gets the dn etabs.
+ *
+ * @return the dn etabs
+ */
+ public Map<String, EtabRef> getDnEtabs() {
+ return dnEtabs;
+ }
+
+ /**
+ * Sets the dn etabs.
+ *
+ * @param dnEtabs the dn etabs
+ */
+ public void setDnEtabs(Map<String, EtabRef> dnEtabs) {
+ this.dnEtabs = dnEtabs;
+ }
+
+ /**
+ * Gets the group member name.
+ *
+ * @return the group member name
+ */
+ public String getGroupMemberName() {
+ return groupMemberName;
+ }
+
+ /**
+ * Sets the group member name.
+ *
+ * @param groupMemberName the new group member name
+ */
+ public void setGroupMemberName(String groupMemberName) {
+ this.groupMemberName = groupMemberName;
+ }
+
+ public Map<String, Set<PersonRef>> getParentPeople() {
+ return parentPeople;
+ }
+
+ public void setParentPeople(Map<String, Set<PersonRef>> parentPeople) {
+ this.parentPeople = parentPeople;
+ }
+
+ public String getGroupReportAccess() {
+ return groupReportAccess;
+ }
+
+ public void setGroupReportAccess(String groupReportAccess) {
+ this.groupReportAccess = groupReportAccess;
+ }
+
+ public List<String> getManagerEtabDns(){
+
+ logger.debug("START MANAGER FIND ... getManagerEtabDns");
+
+ List<String> l = ldapTemplate.search(this.getBranchPeople(),
+ "(ENTPersonFonctions=*DIRECTION CHEF D'ETABLISSEMENT*)",
+
+ new AttributesMapper() {
+ public String mapFromAttributes(Attributes attrs)
+ {
+
+ String dn = "";
+ String uid ="";
+ try {
+ uid = (String)attrs.get("uid").get();
+
+ dn = String.format("uid=%s,%s,%s", uid, getBranchPeople(), getSuffix());
+
+ } catch (javax.naming.NamingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return dn;
+ }
+
+
+ });
+ if (l!=null) {
+ logger.debug("END MANAGER FIND with "+ l.size() +" persons... getManagerEtabDns");
+ }
+ else {
+ logger.debug("END MANAGER FIND WITH NO RESULT (null)... getManagerEtabDns");
+ }
+
+ return l;
+
+ }
+
+ public void setDnMemberGroups(Map<String, Set<String>> dnMemberGroups) {
+ this.dnMemberGroups = dnMemberGroups;
+ }
+
+ public Map<String, Set<String>> getDnMemberGroups() {
+ return dnMemberGroups;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+import java.util.List;
+
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+import com.pentila.sconet.model.log.Event;
+import com.pentila.sconet.model.log.Operation;
+import com.pentila.sconet.model.log.User;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class LogDAO.
+ */
+public class LogDAO extends HibernateDaoSupport implements ILog {
+
+ /**
+ * Write.
+ *
+ * @param l the l
+ */
+ public void write(Operation l) {
+ this.getHibernateTemplate().saveOrUpdate(l);
+ }
+
+ /**
+ * Write.
+ *
+ * @param e the e
+ */
+ public void write(Event e) {
+ this.getHibernateTemplate().saveOrUpdate(e);
+ }
+
+ public void write(User u) {
+ this.getHibernateTemplate().saveOrUpdate(u);
+ }
+
+ public Operation getUserAddOperation(String userLogin) {
+ Operation o = new Operation();
+ o.setTimestamp(null);
+ o.setLogin(userLogin);
+ o.setType(Operation.ADD);
+
+ List results = this.getHibernateTemplate().findByNamedParam("SELECT op FROM Operation as op where op.login=:login and op.type=:type", new String[]{"login", "type"}, new Object[]{userLogin, Operation.ADD});
+ if (results.isEmpty()) {
+ return null;
+ }
+ else {
+ return (Operation)results.get(0);
+ }
+
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.RandomUtils;
+import org.apache.log4j.Logger;
+
+import com.pentila.sconet.model.ldap.Group;
+import com.pentila.sconet.model.ldap.GroupRef;
+import com.pentila.sconet.model.ldap.PersonRef;
+import com.pentila.sconet.model.log.Event;
+import com.pentila.sconet.model.log.Operation;
+import com.pentila.sconet.model.log.User;
+import com.pentila.sconet.model.xml.AddRequest;
+import com.pentila.sconet.model.xml.Attr;
+import com.pentila.sconet.model.xml.DeleteRequest;
+import com.pentila.sconet.model.xml.ExtAttribute;
+import com.pentila.sconet.model.xml.FicAlimMENESR;
+import com.pentila.sconet.model.xml.IRequest;
+import com.pentila.sconet.model.xml.Modif;
+import com.pentila.sconet.model.xml.ModifyRequest;
+import com.pentila.sconet.util.PasswordGenerator;
+import com.pentila.sconet.util.Utils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Processor.
+ */
+public class Processor {
+
+ /** declaration du logger */
+ private final static Logger logger = Logger.getLogger(Processor.class);
+
+ /** The ldap manager. */
+ LdapManager ldapManager;
+
+ /** The sconet manager. */
+ SconetManager sconetManager;
+
+ /** The map groups. */
+ Map<String, Group> mapGroups = new HashMap<String, Group>();
+
+ /** The add user pwd. */
+ Map<String, String> addUserPWD = new HashMap<String, String>();
+
+ /** The generated logins. */
+ private Map<String, String> generatedLogins = new HashMap<String, String>();
+
+ /** The Constant CLASS. */
+ public static final String CLASS = "CLASS";
+
+ /** The Constant GROUP. */
+ public static final String GROUP = "GROUP";
+
+
+ private int expirationPeriod = -1;
+
+ private Map<String, Set<String>> parentClass = new HashMap<String, Set<String>>();
+
+
+ /**
+ * Gets the ldap manager.
+ *
+ * @return the ldap manager
+ */
+ public LdapManager getLdapManager() {
+ return ldapManager;
+ }
+
+ /**
+ * Sets the ldap manager.
+ *
+ * @param ldapManager the new ldap manager
+ */
+ public void setLdapManager(LdapManager ldapManager) {
+ this.ldapManager = ldapManager;
+ }
+
+ /**
+ * Gets the sconet manager.
+ *
+ * @return the sconet manager
+ */
+ public SconetManager getSconetManager() {
+ return sconetManager;
+ }
+
+ /**
+ * Sets the sconet manager.
+ *
+ * @param sconetManager the new sconet manager
+ */
+ public void setSconetManager(SconetManager sconetManager) {
+ this.sconetManager = sconetManager;
+ }
+
+ /**
+ * Run.
+ */
+ public void updatePWDTable() {
+ System.out.println("Mise à jour de la table des pwd !!!");
+ //List<PersonRef> allPeople = this.getLdapManager().getAllPeople();
+ //int nbPeople = allPeople.size();
+ //System.out.println("Nombre de personne LDAP: " + nbPeople);
+ this.ldapManager.buildPersonRef();
+ System.out.println("fin buildPersonRef");
+ int count = 0;
+ Collection<PersonRef> allPeople = this.ldapManager.getUidPeople().values();
+ for (PersonRef pr: allPeople){
+ count++;
+ //System.out.println(count + "/" + nbPeople);
+
+ User u = new User();
+
+ for (String classDn : pr.getClassDns()){
+ String className = classDn.split(",")[0].split("=")[1];
+ u.setDivision(className);
+ break;
+ }
+
+ String numEtabDn = pr.getNumEtabDn();
+
+ Long numEt = new Long(0);
+ try {
+ String numEtab = Utils.convertDNToJointure(numEtabDn);
+ numEt = new Long(numEtab);
+ } catch (Exception e) {
+ }
+ u.setNumEtab(numEt);
+
+ u.setLogin(pr.getLogin());
+
+ u.setUid(pr.getId());
+
+ u.setName(pr.getSn());
+
+ u.setPrenom(pr.getGivenName());
+
+ int entValidAccount = -1;
+ try{
+ entValidAccount = Integer.valueOf(pr.getENTValidAccount());
+ }
+ catch(Exception e) {}
+ u.setEntvalidaccount(entValidAccount);
+
+ if(pr.getEntPersonProfils().contains("National_1")) {
+ u.setTypeEntity(User.ELEVE);
+ }
+ else if(pr.getEntPersonProfils().contains("National_2")) {
+ u.setTypeEntity(User.PARENT);
+ // on set la classe de leur enfant
+ for(String eDn: pr.getElevesDn()){
+ if (this.ldapManager.getDnPeople().containsKey(eDn)) {
+ PersonRef soon = this.ldapManager.getDnPeople().get(eDn);
+ for (String classDn : soon.getClassDns()){
+ String className = classDn.split(",")[0].split("=")[1];
+ u.setDivision(className);
+ break;
+ }
+ }
+ if (!u.getDivision().equals("")) {
+ break;
+ }
+ }
+ }
+ else {
+ u.setTypeEntity(User.PERSONEDU);
+ }
+
+ String pwd = pr.getPassword();
+ if (pwd.isEmpty()) {
+ // il faut obtenir le pwd depuis la base avec une recherche
+ Operation o = Beans.getLogDAO().getUserAddOperation(u.getLogin());
+ if (o != null) {
+ pwd = o.getPassword();
+ }
+ }
+ u.setPassword(pwd);
+
+ Beans.getLogDAO().write(u);
+
+
+
+
+
+
+ }
+ }
+
+ public void run() {
+
+ // identifier que l on a un complet --> forcement des operation ADD
+ // on prend tout les mecs du ldap
+ boolean isCompletProcess = false;
+ boolean firstFileProcess = true;
+ Set<String> allLDAPDNPeople = new HashSet<String>();
+
+ // si LFS est vide on ne fait rien
+ // Soit car y a une erreur dans le parse des fichiers
+ // Soit fichier vide --> ce qui est aussi une erreur!!!
+ if (sconetManager.getLFS().isEmpty()) {
+ System.out.println("ON BREAK L IMPORT CAR LFS VIDE --> CHECK XML FILES!!!!!!");
+ return;
+ }
+
+
+ for (FicAlimMENESR fac : sconetManager.getLFS()) {
+
+ if (fac.isComplet()) {
+ isCompletProcess = true;
+ if (firstFileProcess) {
+ // on copie la liste de toutes les personnes presentes dans le LDAP
+ firstFileProcess = false;
+ allLDAPDNPeople = ldapManager.getDNLDAPListPeople();
+ }
+ }
+
+ Set<AddRequest> modifToAdd = new HashSet<AddRequest>();
+
+ Set<ModifyRequest> addToModify = new HashSet<ModifyRequest>();
+
+
+ if (fac.getAddRequest() != null) {
+
+ logger.info("Debut du traitement d un fichier avec: " + fac.getAddRequest().size());
+
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+ ldapManager.buildEtabRef();
+ mapGroups.clear();
+ addUserPWD.clear();
+ for (AddRequest ar : fac.getAddRequest()) {
+ logger.debug("traitement addRequest");
+ Map<String, Attributes> a = buildAttributes(ar);
+
+ String dn = a.keySet().iterator().next();
+ Attributes attrs = a.values().iterator().next();
+
+
+ String dnFull = String.format("%s,%s", dn, ldapManager
+ .getSuffix());
+
+ logger.debug("traitement addRequest de "+dnFull);
+
+ // si complet on enleve le mec de ma liste en haut
+ if (isCompletProcess) {
+ // on enleve la personne de la liste de personne a supprimer a la fin
+ allLDAPDNPeople.remove(dn);
+ }
+
+
+
+ if (!ldapManager.getDnPeople().containsKey(dnFull)
+ && !ldapManager.getDnEtabs().containsKey(dnFull)) {
+
+ int cat = getCategoryEntity(ar, ldapManager.getObjectClassesByAttributeNames(ar.getAttributeNames()));
+
+ ldapManager.add(dn, attrs);
+
+ Operation o = Utils.buildOperation(attrs);
+
+ o.setType(Operation.ADD);
+ o.setTypeEntity(cat);
+ String description = "";
+
+ if (isPerson(o.getTypeEntity())) {
+
+ String password = "";
+
+ password = addUserPWD.get(o.getLogin());
+
+ o.setPassword(password);
+
+ if (cat == Operation.ELEVE){
+ Set<String> classNames = Utils.getStringValues(attrs, "ENTEleveClasses");
+ for (String classDn : classNames){
+
+ String c = classDn.split(",")[0].split("=")[1];
+
+ o.setDivision(c);
+ break;
+ }
+ }
+ else if (cat == Operation.PARENT && ldapManager.getParentPeople().containsKey(dnFull)){
+ PersonRef pr = ldapManager.getParentPeople().get(dnFull).iterator().next();
+
+ for (String classDn : pr.getClassDns()){
+
+ String className = classDn.split(",")[0].split("=")[1];
+ o.setDivision(className);
+ break;
+ }
+ }
+
+
+ } else {
+ description = String.format("NOM : %s", Utils
+ .getValue(attrs, "ENTStructureNomCourant"));
+ }
+
+ o.setDescription(description);
+
+ Beans.getLogDAO().write(o);
+ logger.debug(dnFull + " a ete ajoute dans la base de log");
+
+ } else {
+ // on revoit tous les users car on est sur un import complet
+ ModifyRequest mr = Utils.convertAddToModify(ar);
+
+ addToModify.add(mr);
+ /*
+ // modif pour l'ENT --> on revalide les users
+ try {
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ BasicAttribute shadowExpire = new BasicAttribute("ENTExpireAccount");
+ shadowExpire.add("-1");
+ sattrs.add(shadowExpire);
+
+ BasicAttribute shadowFlag = new BasicAttribute("ENTValidAccount");
+ shadowFlag.add("-1");
+ sattrs.add(shadowFlag);
+
+ ldapManager.modify(dn, sattrs, "replace");
+ }
+ catch(Exception exc) {}
+ // fin de la modif
+
+
+ Event e = Utils.buildEvent(attrs);
+ String cn = Utils.getValue(attrs, "cn");
+
+ String name = "";
+
+ e.setSource(Event.XML);
+
+ String description = "Ajout : existe déjà : " + cn;
+
+ e.setDescription(description);
+ e.setType(Event.ERROR);
+
+ Beans.getLogDAO().write(e);
+
+ logger.debug(description);
+ */
+ }
+
+ }
+
+
+ addGroupsToLDAP();
+
+ }
+
+ if (fac.getModifyRequest() != null || !addToModify.isEmpty()) {
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+ ldapManager.buildEtabRef();
+ mapGroups.clear();
+
+ // on ne gere qu une liste
+ if (fac.getModifyRequest() != null) {
+ addToModify.addAll(fac.getModifyRequest());
+ }
+
+
+ for (ModifyRequest mr : addToModify) {
+ try {
+
+ Map<String, Attributes> a = buildAttributes(mr);
+ String dn = a.keySet().iterator().next();
+ Attributes attrs = a.values().iterator().next();
+
+ if (attrs != null) {
+ String dnFull = String.format("%s,%s", dn, ldapManager
+ .getSuffix());
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ logger.debug("traitement modifyRequest de "+dnFull);
+
+ NamingEnumeration enumeration = attrs.getAll();
+ while (enumeration.hasMoreElements()) {
+ BasicAttribute value = (BasicAttribute) enumeration
+ .nextElement();
+ sattrs.add(value);
+ }
+ ldapManager.modify(dn, sattrs, "replace");
+
+ Operation o = Utils.buildOperation(attrs);
+
+ o.setType(Operation.MOD);
+
+ int cat = getCategoryEntity(mr, ldapManager.getObjectClassesByAttributeNames(mr.getAttributeNames()));
+
+ o.setTypeEntity(cat);
+
+ String description = "";
+
+ if (isPerson(o.getTypeEntity())) {
+
+ if (cat == Operation.ELEVE){
+ Set<String> classNames = Utils.getStringValues(attrs, "ENTEleveClasses");
+ for (String classDn : classNames){
+
+ String c = classDn.split(",")[0].split("=")[1];
+
+ o.setDivision(c);
+ break;
+ }
+ }
+ else if (cat == Operation.PARENT && ldapManager.getParentPeople().containsKey(dnFull)){
+ PersonRef pr = ldapManager.getParentPeople().get(dnFull).iterator().next();
+
+ for (String classDn : pr.getClassDns()){
+ String className = classDn.split(",")[0].split("=")[1];
+ o.setDivision(className);
+ break;
+ }
+ }
+
+
+
+
+ String uid = Utils.getValue(attrs,
+ "ENTPersonJointure");
+
+ PersonRef pr = ldapManager.getJoinPeople().get(
+ uid);
+
+ String login = pr.getLogin();
+ o.setLogin(login);
+ description = String
+ .format("LOGIN : %s", login);
+ } else {
+ description = String.format("NOM : %s", Utils
+ .getValue(attrs,
+ "ENTStructureNomCourant"));
+ }
+ o.setDescription(description);
+
+
+ Beans.getLogDAO().write(o);
+ logger.debug(description);
+
+ } else {
+ modifToAdd.add(Utils.convertModifyToAdd(mr));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ modifyGroupsToLDAP();
+
+ }
+
+ // HERE We add modifyRequest Which are addRequest in fact
+
+ if (!modifToAdd.isEmpty()) {
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+ ldapManager.buildEtabRef();
+ mapGroups.clear();
+ for (AddRequest ar : modifToAdd) {
+ Map<String, Attributes> a = buildAttributes(ar);
+ String dn = a.keySet().iterator().next();
+ Attributes attrs = a.values().iterator().next();
+
+
+ ldapManager.add(dn, attrs);
+
+ String dnFull = String.format("%s,%s", dn, ldapManager
+ .getSuffix());
+
+ logger.debug("traitement modifyToAdd de "+dnFull);
+
+ Operation o = Utils.buildOperation(attrs);
+ int cat = getCategoryEntity(ar, Utils.getStringValues(attrs, "objectclass"));
+
+ o.setTypeEntity(cat);
+
+ o.setType(Operation.ADD);
+
+ String description = "";
+
+ if (isPerson(o.getTypeEntity())) {
+ String password = "";
+
+ password = addUserPWD.get(o.getLogin());
+
+ o.setPassword(password);
+
+
+ if (cat == Operation.ELEVE){
+ Set<String> classNames = Utils.getStringValues(attrs, "ENTEleveClasses");
+ for (String classDn : classNames){
+
+ String c = classDn.split(",")[0].split("=")[1];
+
+ o.setDivision(c);
+ break;
+ }
+ }
+ else if (cat == Operation.PARENT && ldapManager.getParentPeople().containsKey(dnFull)){
+ PersonRef pr = ldapManager.getParentPeople().get(dnFull).iterator().next();
+
+ for (String classDn : pr.getClassDns()){
+ String className = classDn.split(",")[0].split("=")[1];
+ o.setDivision(className);
+ break;
+ }
+ }
+
+ } else {
+ description = String.format("NOM : %s", Utils.getValue(
+ attrs, "ENTStructureNomCourant"));
+ }
+
+ o.setDescription(description);
+
+ Beans.getLogDAO().write(o);
+ logger.debug("modifytoAdd logged "+dnFull);
+
+ }
+
+ addGroupsToLDAP();
+ }
+
+ if (fac.getDeleteRequest() != null) {
+
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+ ldapManager.buildEtabRef();
+ mapGroups.clear();
+
+ for (DeleteRequest dr : fac.getDeleteRequest()) {
+
+ Set<String> objectClasses = new HashSet<String>();
+ String cat = dr.getCategory();
+
+ if (cat.equals("categoriePersonne")) {
+
+ // Here a person ...
+
+ objectClasses.add("inetOrgPerson");
+
+ } else {
+ objectClasses.add("organizationalUnit");
+ }
+ String dn = buildDn(dr.getIdentifier().getId(),
+ objectClasses, false);
+ String dnFull = buildDn(dr.getIdentifier().getId(),
+ objectClasses, true);
+
+ logger.debug("traitement deleteRequest de "+dnFull);
+
+ if (ldapManager.getDnPeople().containsKey(dnFull)) {
+
+ if (cat.equals("categoriePersonne")) {
+ generateGroups(dnFull);
+ }
+
+ // DONT DELETE REEL
+
+ //ldapManager.delete(dn);
+
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ BasicAttribute shadowExpire = new BasicAttribute("ENTExpireAccount");
+ shadowExpire.add(""+Utils.computeExpirationTime(expirationPeriod));
+ sattrs.add(shadowExpire);
+
+ BasicAttribute shadowFlag = new BasicAttribute("ENTValidAccount");
+ shadowFlag.add("1");
+ sattrs.add(shadowFlag);
+
+
+ ldapManager.modify(dn, sattrs, "replace");
+
+ logger.debug("deleteRequest done de "+dnFull);
+
+
+
+ Operation o = new Operation();
+
+ o.setType(Operation.DEL);
+
+ PersonRef pr = ldapManager.getDnPeople().get(dnFull);
+
+ String description = "";
+ String login = pr.getLogin();
+ String name = pr.getCn();
+ String numEtabDn = pr.getNumEtabDn();
+
+ Long numEt = new Long(0);
+ try {
+ String numEtab = Utils.convertDNToJointure(numEtabDn);
+ numEt = new Long(numEtab);
+ } catch (Exception e) {
+ logger.debug("recup etab impossible pour " + name + " avec " + numEtabDn);
+ }
+
+ o.setNumEtab(numEt);
+ o.setNumEntity(new Long(pr.getId()));
+ //o.setTypeEntity();
+
+ description = String.format("NOM : %s , LOGIN : %s",
+ name, login);
+
+ o.setDescription(description);
+
+ Beans.getLogDAO().write(o);
+
+ logger.debug("deleteRequest logged de "+dnFull);
+ } else {
+ Event e = new Event();
+ e.setSource(Event.XML);
+ e.setNumEntity(new Long(dr.getIdentifier().getId()));
+ e.setNumEtab(new Long(0));
+ e.setType(Event.MISSING);
+
+ e
+ .setDescription("Suppression impossible : l'entité n'existe pas dans l'annuaire LDAP");
+ Beans.getLogDAO().write(e);
+ logger.debug(e.getDescription());
+ }
+ }
+
+ deleteGroupsToLDAP();
+
+ }
+ }
+
+
+
+ // si complet on enleve le mec de ma liste en haut
+ if (isCompletProcess) {
+
+
+
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+ ldapManager.buildEtabRef();
+ mapGroups.clear();
+
+ int count = 0;
+ for (String dn: allLDAPDNPeople) {
+
+ logger.debug("On supprime car plus dans le complet: " + dn);
+ count ++;
+
+ Set<String> objectClasses = new HashSet<String>();
+ objectClasses.add("inetOrgPerson");
+
+ String dnFull = String.format("%s,%s", dn, ldapManager
+ .getSuffix());
+
+ logger.debug("traitement deleteRequest de "+dnFull);
+
+ generateGroups(dnFull);
+
+ // DONT DELETE REEL
+
+ //ldapManager.delete(dn);
+
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ BasicAttribute shadowExpire = new BasicAttribute("ENTExpireAccount");
+ shadowExpire.add(""+Utils.computeExpirationTime(expirationPeriod));
+ sattrs.add(shadowExpire);
+
+ BasicAttribute shadowFlag = new BasicAttribute("ENTValidAccount");
+ shadowFlag.add("1");
+ sattrs.add(shadowFlag);
+
+ ldapManager.modify(dn, sattrs, "replace");
+
+ logger.debug("deleteRequest done de "+dnFull);
+
+ Operation o = new Operation();
+
+ o.setType(Operation.DEL);
+
+ PersonRef pr = ldapManager.getDnPeople().get(dnFull);
+
+ String description = "";
+ String login = pr.getLogin();
+ String name = pr.getCn();
+ String numEtabDn = pr.getNumEtabDn();
+
+ Long numEt = new Long(0);
+ try {
+ String numEtab = Utils.convertDNToJointure(numEtabDn);
+ numEt = new Long(numEtab);
+ } catch (Exception e) {
+ logger.debug("recup etab impossible pour " + name + " avec " + numEtabDn);
+ }
+
+ o.setNumEtab(numEt);
+ o.setNumEntity(new Long(pr.getId()));
+ //o.setTypeEntity();
+
+ description = String.format("NOM : %s , LOGIN : %s",
+ name, login);
+
+ o.setDescription(description);
+
+ Beans.getLogDAO().write(o);
+
+ logger.debug("deleteRequest logged de "+dnFull);
+
+ }
+
+ deleteGroupsToLDAP();
+
+ logger.debug("On a supprime nbCount: " + count);
+
+
+ }
+
+
+
+
+ ldapManager.buildPersonRef();
+ ldapManager.buildGroupRef();
+
+ this.createAllMembersGroup();
+ try{
+ //this.createReportAccessGroup();
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+
+
+
+
+
+
+ }
+
+ /**
+ * Delete groups to ldap.
+ */
+ public void deleteGroupsToLDAP() {
+ for (Entry<String, Group> entry : mapGroups.entrySet()) {
+ String name = entry.getKey();
+ Group group = entry.getValue();
+
+ String dn = String.format("cn=%s,%s", Utils.fixDN(name),
+ ldapManager.getBranchGroups());
+
+ logger.debug("(deleteGroupsToLDAP) DEBUT TRAITEMANT DU GRP: " + dn);
+
+ BasicAttribute memberAttr = new BasicAttribute("member");
+
+ if (ldapManager.getIdGroups().containsKey(name)) {
+ Set<String> members = new HashSet<String>();
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+ // members.addAll(gr.getMembers());
+ if (!group.getMembers().isEmpty()) {
+ members.addAll(group.getMembers());
+ } else {
+ members.add("uid=system_fake_user");
+ }
+ for (String userDn : members) {
+ memberAttr.add(userDn);
+ }
+ sattrs.add(memberAttr);
+
+ ldapManager.modify(dn, sattrs, "replace");
+ }
+
+ }
+ }
+
+ /**
+ * Modify groups to ldap.
+ */
+ public void modifyGroupsToLDAP() {
+ // Add Classes and Groupes
+ logger.debug("modifyGroupsToLDAP");
+ for (Entry<String, Group> entry : mapGroups.entrySet()) {
+ String name = entry.getKey();
+ Group group = entry.getValue();
+
+ if (name.equals("fakeDn")) {
+ continue;
+ }
+
+ String dn = String.format("cn=%s,%s", Utils.fixDN(name),
+ ldapManager.getBranchGroups());
+
+ logger.debug("(modifyGroupsToLDAP)DEBUT TRAITEMANT DU GRP: " + dn);
+
+ BasicAttribute memberAttr = new BasicAttribute("member");
+
+ if (ldapManager.getIdGroups().containsKey(Utils.fixDN(name))) {
+ // Group already exist so Modify Group
+
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+ Set<String> members = new HashSet<String>();
+
+ // members.addAll(gr.getMembers());
+ if (!group.getMembers().isEmpty()) {
+ members.addAll(group.getMembers());
+ } else {
+ members.add("uid=system_fake_user");
+ }
+ for (String userDn : members) {
+ memberAttr.add(userDn);
+ }
+ sattrs.add(memberAttr);
+
+ ldapManager.modify(dn, sattrs, "replace");
+ logger.debug("(modifyGroupsToLDAP) GRP modified: " + dn);
+
+ } else {
+ // Add Group
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+ objectClasses.add("groupOfNames");
+
+ if (group.getType().equals(CLASS)) {
+ objectClasses.add("ENTClasse");
+ } else {
+ objectClasses.add("ENTGroupe");
+ }
+ Attributes attrs = new BasicAttributes();
+ BasicAttribute ocattr = new BasicAttribute("objectclass");
+ for (String oc : objectClasses) {
+ ocattr.add(oc);
+ }
+ attrs.put(ocattr);
+
+ attrs.put("cn", Utils.fixDN(name));
+
+ attrs.put("owner", group.getOwner());
+
+ /* System.out.println("In Modify : Add Group CN : " + name
+ + " Members : " + group.getMembers());
+*/
+ for (String userDn : group.getMembers()) {
+ memberAttr.add(userDn);
+ }
+
+ attrs.put(memberAttr);
+ ldapManager.add(dn, attrs);
+
+ logger.debug("(modifyGroupsToLDAP) GRP added: " + dn);
+
+ Operation o = Utils.buildOperation(attrs);
+ o.setType(Operation.ADD);
+
+ String description = "";
+
+ if (group.getType().equals(CLASS)) {
+ o.setTypeEntity(Operation.CLASS);
+ description = String.format("Classe : %s, (%d)", Utils
+ .fixDN(name), memberAttr.size());
+ } else {
+ description = String.format("Groupe : %s, (%d)", Utils
+ .fixDN(name), memberAttr.size());
+ }
+
+ o.setDescription(description);
+ Beans.getLogDAO().write(o);
+
+ logger.debug("(modifyGroupsToLDAP) GRP logged: " + dn);
+
+ }
+
+ }
+
+ }
+
+ /**
+ * Adds the groups to ldap.
+ */
+ public void addGroupsToLDAP() {
+ // Add Classes and Groupes
+ logger.debug("addGroupsToLDAP");
+ for (Entry<String, Group> entry : mapGroups.entrySet()) {
+ String name = entry.getKey();
+ Group group = entry.getValue();
+
+ logger.debug("addGroupsToLDAP name:" + name);
+
+ String dn = String.format("cn=%s,%s", Utils.fixDN(name),
+ ldapManager.getBranchGroups());
+
+ logger.debug("(addGroupsToLDAP)DEBUT TRAITEMANT DU GRP: " + dn);
+
+ BasicAttribute memberAttr = new BasicAttribute("member");
+
+ if (ldapManager.getIdGroups().containsKey(name)) {
+ // Group already exist so Modify Group
+ logger.debug("Group already exist so Modify Group");
+
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ for (String userDn : group.getMembers()) {
+ logger.debug("Group already exist so Modify Group: " + userDn);
+ memberAttr.add(userDn);
+ }
+ sattrs.add(memberAttr);
+
+ ldapManager.modify(dn, sattrs, "replace");
+ logger.debug("(addGroupsToLDAP)GRP MODIFIED (REPLACE): " + dn);
+
+ } else {
+ logger.debug("Add Group");
+
+ // Add Group
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+ objectClasses.add("groupOfNames");
+
+ if (group.getType().equals(CLASS)) {
+ objectClasses.add("ENTClasse");
+ } else {
+ objectClasses.add("ENTGroupe");
+ }
+ Attributes attrs = new BasicAttributes();
+ BasicAttribute ocattr = new BasicAttribute("objectclass");
+ for (String oc : objectClasses) {
+ ocattr.add(oc);
+ }
+ attrs.put(ocattr);
+
+ attrs.put("cn", Utils.fixDN(name));
+ attrs.put("description", Utils.fixDN(name));
+ attrs.put(memberAttr);
+ attrs.put("owner", group.getOwner());
+ for (String userDn : group.getMembers()) {
+ memberAttr.add(userDn);
+ }
+ ldapManager.add(dn, attrs);
+
+ logger.debug("(addGroupsToLDAP)GRP ADDED: " + dn);
+
+ Operation o = Utils.buildOperation(attrs);
+ o.setType(Operation.ADD);
+
+ String description = "";
+
+ if (group.getType().equals(CLASS)) {
+ o.setTypeEntity(Operation.CLASS);
+ description = String.format("Classe : %s, (%d)", Utils
+ .fixDN(name), memberAttr.size());
+ } else {
+ description = String.format("Groupe : %s, (%d)", Utils
+ .fixDN(name), memberAttr.size());
+ }
+
+ o.setDescription(description);
+ Beans.getLogDAO().write(o);
+
+ logger.debug("(addGroupsToLDAP)GRP OPERATION FINISHED AND LOG MADE: " + dn);
+ }
+
+ }
+ }
+
+ /**
+ * Generate groups.
+ *
+ * @param dnFull the dn full
+ */
+ private void generateGroups(String dnFull) {
+
+ PersonRef pr = ldapManager.getDnPeople().get(dnFull);
+ if (pr != null) {
+ Set<String> groupDns = new HashSet<String>();
+
+ groupDns.addAll(pr.getClassDns());
+ groupDns.addAll(pr.getGroupDns());
+
+ for (String gdn : groupDns) {
+ String classname = "";
+ try {
+ classname = Utils.fixDN(gdn.split(",")[0].split("=")[1]);
+ }
+ catch(Exception exc) {
+ System.out.println("error in handle class: '" + gdn + "'");
+ continue;
+ }
+ if (classname.equals("fakeDn")) {
+ continue;
+ }
+
+ Group classe = mapGroups.get(classname);
+
+ if (classe == null) {
+ classe = new Group();
+ classe.setId(classname);
+
+ // Build real existing Group for modify
+ GroupRef gr = ldapManager.getIdGroups().get(classname);
+ if (gr != null) {
+ classe.setMembers(gr.getMembers());
+ }
+ mapGroups.put(classname, classe);
+ }
+ classe.deleteMember(dnFull);
+
+ }
+ }
+
+ }
+
+ /**
+ * Builds the attributes.
+ *
+ * @param ar the ar
+ *
+ * @return the map< string, attributes>
+ */
+ private Map<String, Attributes> buildAttributes(AddRequest ar) {
+
+ logger.debug("buildAttributes");
+ String structRattach = "";
+
+
+ Map<String, Attributes> map = new HashMap<String, Attributes>();
+
+ Attributes attrs = new BasicAttributes();
+
+ // Compute Object Classes for new Object
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+
+ objectClasses.addAll(ldapManager.getObjectClassesByAttributeNames(ar
+ .getAttributeNames()));
+
+
+
+ BasicAttribute ocattr = new BasicAttribute("objectclass");
+ for (String oc : objectClasses) {
+ ocattr.add(oc);
+ }
+
+ attrs.put(ocattr);
+
+ // build dn
+
+ String dn = buildDn(ar.getIdentifier().getId(), objectClasses, false);
+
+ String dnFull = buildDn(ar.getIdentifier().getId(), objectClasses, true);
+
+ logger.debug("buildAttributes build dn full: " + dnFull);
+
+ if (objectClasses.contains("ENTPerson")) {
+ generateMissingAttributesForUser(ar, attrs);
+
+ Set<String> classNames = generateGroups(dnFull, ar, CLASS);
+
+ classNames.addAll(generateGroups(dnFull, ar, GROUP));
+
+ buildProfils(ar, objectClasses, attrs);
+ logger.debug("buildAttributes apres build profil");
+
+ int cat = this.getCategoryEntity(ar, null);
+ if (cat==Operation.PARENT) {
+ ocattr.add("ENTAuxPersRelEleve");
+ }
+ if (ldapManager.getParentPeople().containsKey(dnFull)){
+
+
+ BasicAttribute ba = new BasicAttribute("ENTAuxPersRelEleveEleve");
+
+ for (PersonRef pr : ldapManager.getParentPeople().get(dnFull)){
+ ba.add(pr.getDn());
+ structRattach = pr.getNumEtabDn();
+ }
+
+ attrs.put(ba);
+
+
+ }
+
+ if (structRattach.equals("")){
+ for (String className : classNames){
+ structRattach = computeDN("ENTPersonStructRattach", className.split("\\$")[0]);
+ break;
+ }
+ }
+ // si tjs pas de structRattach on utilise ENTPersonFonctions pour voir!
+ if (structRattach.equals("")){
+ Attr a = ar.getAttributeByName("ENTPersonFonctions");
+ if (a != null){
+ for (String v : a.getValue()){
+ try {
+ String structEvaluated = v.split("\\$")[0];
+ // pour voir si on a bien un etab!
+ Long.valueOf(structEvaluated);
+ structRattach = computeDN("ENTPersonStructRattach", structEvaluated);
+ break;
+ }
+ catch(Exception exc) {}
+ }
+ }
+ }
+ // fin du test
+
+
+ }
+
+ // Add attributes
+ logger.debug("buildAttributes avant le for");
+ for (Attr attr : ar.getRawAttributes()) {
+ if (ldapManager.getExtAttrMap().containsKey(attr.getName())) {
+ ExtAttribute ea = ldapManager.getExtAttrMap().get(
+ attr.getName());
+
+ if (attr.getValue() != null && !attr.getValue().isEmpty()) {
+
+ boolean add = false;
+
+ BasicAttribute ba = new BasicAttribute(attr.getName());
+
+ for (String value : attr.getValue()) {
+
+ String v = value;
+
+ if (v != null && !v.equals("")) {
+ if (ea.isDn()) {
+ v = computeDN(attr.getName(), v);
+
+ } else {
+ v = computeValue(ea, v);
+ }
+
+
+
+ ba.add(v);
+
+ add = true;
+
+ }
+ else {
+ // cas d'une mise a zero d'une valeur DN (group, PP, MEF,...)
+ if (attr.getName().equals("ENTAuxEnsClassesPrincipal")) {
+ v = computeDN(attr.getName(), "fakeDn");
+ ba.add(v);
+ add = true;
+ }
+ }
+ }
+ if (add) {
+ attrs.put(ba);
+ }
+ }
+
+ } else {
+ //System.out.println("Attribute not found in ldap schema : "
+ // + attr.getName());
+ }
+ }
+
+ if (objectClasses.contains("ENTPerson") && !structRattach.equals("") ){
+
+
+ // System.out.println("HERE STRUCTRATTACH : " + structRattach);
+
+ Attribute aa = attrs.get("ENTPersonStructRattach");
+
+ //System.out.println("AA : " + aa);
+ if (aa != null){
+ //System.out.println("AA size : " + aa.size());
+ }
+ if (aa == null || aa.size() == 0){
+
+ BasicAttribute ba2 = new BasicAttribute("ENTPersonStructRattach");
+ ba2.add(structRattach);
+ attrs.put(ba2);
+ }
+ }
+
+ map.put(dn, attrs);
+
+ logger.debug("buildAttributes end");
+
+ return map;
+ }
+
+ private void buildProfils(AddRequest ar, Set<String> objectClasses,
+ Attributes attrs) {
+
+ logger.debug("buildProfils begin");
+ int cat = this.getCategoryEntity(ar, null);
+
+ BasicAttribute ba = new BasicAttribute("ENTPersonProfils");
+
+ if (cat == Operation.ELEVE){
+ ba.add("National_1");
+ }else if (cat == Operation.PARENT){
+ ba.add("National_2");
+ }else{
+
+ Attr a = ar.getAttributeByName("ENTPersonFonctions");
+ if (a != null){
+ for (String v : a.getValue()){
+ logger.debug("buildProfils with: " + v);
+ if (v!= null && !v.equals("")){
+ if (v.contains("$ENS$") || v.contains("$CTR$")){
+ ba.add("National_3");
+ break;
+ }
+
+ if (v.contains("$AED$") || v.contains("$EDU$")){
+ ba.add("National_5");
+ break;
+ }
+ if (v.contains("$DIRECTION$")){
+ ba.add("National_4");
+ break;
+ }
+ if (v.contains("$ORI$") || v.contains("$ADF$") || v.contains("$DOC$") || v.contains("$LAB$")){
+ ba.add("National_6");
+ break;
+ }
+ }}
+ }
+ }
+
+ if (ba.size() != 0){
+ attrs.put(ba);
+ }
+ logger.debug("buildProfils end");
+
+ }
+
+ private void buildProfils(ModifyRequest mr, Set<String> objectClasses,
+ Attributes attrs) {
+
+
+ int cat = this.getCategoryEntity(mr, null);
+
+ BasicAttribute ba = new BasicAttribute("ENTPersonProfils");
+
+ if (cat == Operation.ELEVE){
+ ba.add("National_1");
+ }else if (cat == Operation.PARENT){
+ ba.add("National_2");
+ }else{
+
+ Modif a = mr.getAttributeByName("ENTPersonFonctions");
+ if (a != null){
+ for (String v : a.getValue()){
+ if (v!= null && !v.equals("")){
+ if (v.contains("$ENS$") || v.contains("$CTR$")){
+ ba.add("National_3");
+ break;
+ }
+
+ if (v.contains("$AED$") || v.contains("$EDU$")){
+ ba.add("National_5");
+ break;
+ }
+ if (v.contains("$DIRECTION$")){
+ ba.add("National_4");
+ break;
+ }
+ if (v.contains("$ORI$") || v.contains("$ADF$") || v.contains("$DOC$") || v.contains("$LAB$")){
+ ba.add("National_6");
+ break;
+ }
+ }}
+ }
+ }
+
+ if (ba.size() != 0){
+ attrs.put(ba);
+ }
+
+ }
+
+ /**
+ * Builds the attributes.
+ *
+ * @param mr the mr
+ *
+ * @return the map< string, attributes>
+ */
+ private Map<String, Attributes> buildAttributes(ModifyRequest mr) {
+
+ String structRattach = "";
+ Map<String, Attributes> map = new HashMap<String, Attributes>();
+
+ Attributes attrs = new BasicAttributes();
+
+ // Compute Object Classes for new Object
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+
+ objectClasses.addAll(ldapManager.getObjectClassesByAttributeNames(mr
+ .getAttributeNames()));
+
+
+
+ // build dn
+
+ String dn = buildDn(mr.getIdentifier().getId(), objectClasses, false);
+
+ String dnFull = buildDn(mr.getIdentifier().getId(), objectClasses, true);
+
+ logger.debug("buildAttributes modifyRequest de "+dnFull);
+
+ if (ldapManager.getDnPeople().containsKey(dnFull)
+ || ldapManager.getDnEtabs().containsKey(dnFull)) {
+
+ logger.debug("buildAttributes modifyRequest found in getDnPeople");
+
+ if (objectClasses.contains("ENTPerson")) {
+
+ logger.debug("buildAttributes modifyRequest is a person");
+
+ generateMissingModificationsForUser(mr, attrs);
+ Set<String> classNames = generateGroups(dnFull, mr);
+
+ buildProfils(mr, objectClasses, attrs);
+
+ if (ldapManager.getParentPeople().containsKey(dnFull)){
+ BasicAttribute ba = new BasicAttribute("ENTAuxPersRelEleveEleve");
+ for (PersonRef pr : ldapManager.getParentPeople().get(dnFull)){
+ ba.add(pr.getDn());
+ structRattach = pr.getNumEtabDn();
+ }
+ attrs.put(ba);
+ }
+
+ if (structRattach.equals("")){
+ for (String className : classNames){
+ structRattach = computeDN("ENTPersonStructRattach", className.split("\\$")[0]);
+ break;
+ }
+ }
+ // si tjs pas de structRattach on utilise ENTPersonFonctions pour voir!
+ if (structRattach.equals("")){
+ Modif m = mr.getAttributeByName("ENTPersonFonctions");
+ if (m != null){
+ for (String v : m.getValue()){
+ try {
+ String structEvaluated = v.split("\\$")[0];
+ // pour voir si on a bien un etab!
+ Long.valueOf(structEvaluated);
+ structRattach = computeDN("ENTPersonStructRattach", structEvaluated);
+ break;
+ }
+ catch(Exception exc) {}
+ }
+ }
+ }
+ // fin du test
+ }
+
+ // Modify attributes
+ for (Modif attr : mr.getRawModifications()) {
+ if (ldapManager.getExtAttrMap().containsKey(attr.getName())) {
+ ExtAttribute ea = ldapManager.getExtAttrMap().get(
+ attr.getName());
+
+ if (attr.getValue() != null && !attr.getValue().isEmpty()) {
+
+ boolean add = false;
+
+ BasicAttribute ba = new BasicAttribute(attr.getName());
+
+ for (String value : attr.getValue()) {
+
+ String v = value;
+
+ if (v != null && !v.equals("")) {
+ if (ea.isDn()) {
+ v = computeDN(attr.getName(), v);
+ } else {
+ v = computeValue(ea, v);
+ }
+ ba.add(v);
+ add = true;
+ }
+ else {
+ // cas d'une mise a zero d'une valeur DN (group, PP, MEF,...)
+ if (attr.getName().equals("ENTAuxEnsClassesPrincipal")) {
+ v = computeDN(attr.getName(), "fakeDn");
+ ba.add(v);
+ add = true;
+ }
+ }
+ }
+ if (add) {
+ attrs.put(ba);
+ }
+ }
+
+ } else {
+ //System.out.println("Attribute not found in ldap schema : "
+ // + attr.getName());
+ }
+ }
+ } else {
+ attrs = null;
+ }
+
+
+ if (objectClasses.contains("ENTPerson") && !structRattach.equals("")){
+
+ Attribute aa = attrs.get("ENTPersonStructRattach");
+
+ if (aa == null || aa.size() == 0){
+ BasicAttribute ba2 = new BasicAttribute("ENTPersonStructRattach");
+ ba2.add(structRattach);
+ attrs.put(ba2);
+ }
+ }
+
+
+ map.put(dn, attrs);
+
+ return map;
+ }
+
+ /**
+ * Generate groups.
+ *
+ * @param dn the dn
+ * @param ar the ar
+ * @param style the style
+ */
+ private Set<String> generateGroups(String dn, AddRequest ar, String style) {
+
+
+ Set<String> classNames = new HashSet<String>();
+
+ String[] lcs = null;
+ if (style.equals(CLASS)) {
+ lcs = new String[] { "ENTEleveClasses", "ENTAuxEnsClasses",
+ "ENTAuxEnsClassesPrincipal" };
+ } else {
+ lcs = new String[] { "ENTEleveGroupes", "ENTAuxEnsGroupes" };
+ }
+
+ for (String styleAttr : lcs) {
+
+ Attr attr = ar.getAttributeByName(styleAttr);
+ if (attr != null) {
+ List<String> lc = attr.getValue();
+
+ if (lc != null) {
+ for (String classname : lc) {
+
+ if (classname != null && !classname.equals("") && !classname.equals("fakeDn")) {
+
+ Group classe = mapGroups
+ .get(Utils.fixDN(classname));
+ if (classe == null) {
+ classe = new Group();
+ classe.setId(Utils.fixDN(classname));
+ classe.setType(style);
+
+ String idEtab = "";
+ try {
+ idEtab = Utils.fixDN(classname
+ .split("\\$")[0]);
+ }
+ catch (Exception exc) {
+ System.out.println("error in handle idEtab for: " + classname);
+ continue;
+ }
+
+
+ String owner = String.format("ou=%s,%s,%s",
+ idEtab, ldapManager
+ .getBranchEtablissements(),
+ ldapManager.getSuffix());
+ classe.setOwner(owner);
+
+ // Build real existing Group for modify
+ GroupRef gr = ldapManager.getIdGroups().get(
+ Utils.fixDN(classname));
+ if (gr != null) {
+ classe.setMembers(gr.getMembers());
+ }
+
+
+
+ mapGroups.put(Utils.fixDN(classname), classe);
+ }
+ classNames.add(Utils.fixDN(classname));
+ classe.addMember(dn);
+ }
+ }
+ }
+ }
+ }
+
+ return classNames;
+
+ }
+
+ /**
+ * Generate groups.
+ *
+ * @param dn the dn
+ * @param mr the mr
+ */
+ private Set<String> generateGroups(String dn, ModifyRequest mr) {
+
+ logger.debug("generateGroups modifyRequest");
+
+ Set<String> classNames = new HashSet<String>();
+
+ // Current LDAP Datas
+ PersonRef pr = ldapManager.getDnPeople().get(dn);
+
+ if (pr != null) {
+
+ logger.debug("generateGroups on a un pr");
+
+ Set<String> groupDns = new HashSet<String>();
+
+ groupDns.addAll(pr.getClassDns());
+ groupDns.addAll(pr.getGroupDns());
+
+ Set<String> currentLDAPGroupsDN = new HashSet<String>();
+ if (ldapManager.getDnMemberGroups()!=null && ldapManager.getDnMemberGroups().containsKey(dn)) {
+ currentLDAPGroupsDN = ldapManager.getDnMemberGroups().get(dn);
+ }
+
+ //
+
+ String[] lcs = new String[] { "ENTEleveClasses",
+ "ENTAuxEnsClasses", "ENTAuxEnsClassesPrincipal",
+ "ENTEleveGroupes", "ENTAuxEnsGroupes" };
+
+ String style = "";
+
+ Set<String> newGroupDns = new HashSet<String>();
+
+ int index = 0;
+
+ for (String styleAttr : lcs) {
+
+ // Determine si c'est une classe ou un groupe
+ if (index < 3) {
+ style = CLASS;
+ } else {
+ style = GROUP;
+ }
+
+ Modif attr = mr.getAttributeByName(styleAttr);
+ if (attr != null) {
+ List<String> lc = attr.getValue();
+ logger.debug("generateGroups on a un attr");
+ if (lc != null) {
+ logger.debug("generateGroups on a un lc");
+ for (String classname : lc) {
+ logger.debug("generateGroups on a une classe: " + classname);
+ if (classname != null && !classname.equals("") && !classname.equals("fakeDn")) {
+
+ // Verification que c'est bien une modif
+
+ String classDn = String.format("cn=%s,%s,%s",
+ Utils.fixDN(classname), ldapManager
+ .getBranchGroups(), ldapManager
+ .getSuffix());
+ newGroupDns.add(classDn);
+
+ logger.debug("11111");
+ if (!groupDns.contains(classDn) || !currentLDAPGroupsDN.contains(classDn)) {
+
+ logger.debug("new");
+
+ Group classe = mapGroups.get(Utils
+ .fixDN(classname));
+ if (classe == null) {
+ logger.debug("2222222");
+ classe = new Group();
+ classe.setId(Utils.fixDN(classname));
+ classe.setType(style);
+
+ String idEtab = "";
+ try {
+ idEtab = Utils.fixDN(classname
+ .split("\\$")[0]);
+ }
+ catch (Exception exc) {
+ System.out.println("error in handle idEtab for: " + classname);
+ continue;
+ }
+
+ String owner = String
+ .format(
+ "ou=%s,%s,%s",
+ idEtab,
+ ldapManager
+ .getBranchEtablissements(),
+ ldapManager.getSuffix());
+ classe.setOwner(owner);
+
+ // Build real existing Group for modify
+ GroupRef gr = ldapManager.getIdGroups()
+ .get(Utils.fixDN(classname));
+ if (gr != null) {
+ classe.setMembers(gr.getMembers());
+ }
+
+
+ logger.debug("on put dans mapgroup");
+ mapGroups.put(Utils.fixDN(classname),
+ classe);
+ }
+
+ classe.addMember(dn);
+ }
+ classNames.add(Utils.fixDN(classname));
+ logger.debug("3333333333");
+ }
+ }
+ }
+ }
+
+ index++;
+
+ }
+
+
+ groupDns.removeAll(newGroupDns);
+ currentLDAPGroupsDN.removeAll(newGroupDns);
+ groupDns.addAll(currentLDAPGroupsDN);
+
+ // Now Need to modify oldGroups
+ logger.debug("old grps");
+ for (String gdn : groupDns) {
+
+ String classname = "";
+ try {
+ classname = Utils.fixDN(gdn.split(",")[0].split("=")[1]);
+ }
+ catch(Exception exc) {
+ System.out.println("error in handle class (old): '" + gdn + "'");
+ continue;
+ }
+ if (classname.equals("fakeDn")) {
+ continue;
+ }
+
+ if (pr.getClassDns().contains(gdn)) {
+ style = CLASS;
+ } else {
+ style = GROUP;
+ }
+
+ Group classe = mapGroups.get(classname);
+
+ if (classe == null) {
+ classe = new Group();
+ classe.setId(classname);
+ classe.setType(style);
+ String idEtab = "";
+ try {
+ idEtab = Utils.fixDN(classname
+ .split("\\$")[0]);
+ }
+ catch (Exception exc) {
+ System.out.println("error in handle idEtab for: " + classname);
+ continue;
+ }
+ String owner = String.format("ou=%s,%s,%s", idEtab,
+ ldapManager.getBranchEtablissements(), ldapManager
+ .getSuffix());
+ classe.setOwner(owner);
+
+ // Build real existing Group for modify
+ GroupRef gr = ldapManager.getIdGroups().get(classname);
+ if (gr != null) {
+ classe.setMembers(gr.getMembers());
+ }
+ mapGroups.put(classname, classe);
+ }
+ classe.deleteMember(dn);
+
+ }
+
+ } else {
+ System.out.println("MODIFY Dn :" + dn + " NOT FOUND in LDAP");
+ }
+
+ return classNames;
+ }
+
+ /**
+ * Generate missing attributes for user.
+ *
+ * @param ar the ar
+ * @param attrs the attrs
+ */
+ private void generateMissingAttributesForUser(AddRequest ar,
+ Attributes attrs) {
+
+ logger.debug("generateMissingAttributesForUser begin");
+ // uid value
+ attrs.put("uid", ar.getIdentifier().getId());
+
+ // Generate login
+ String login = "";
+
+ String prenom = ar.getAttributeByName("givenName").getValue()
+ .iterator().next();
+ String nom = ar.getAttributeByName("sn").getValue().iterator().next();
+
+ login = generateLogin(prenom, nom);
+
+ attrs.put("ENTPersonLogin", login);
+
+ // CN
+
+ String cn = nom + " " + prenom;
+
+ attrs.put("cn", cn);
+ attrs.put("displayName", cn);
+
+ String pwd = generatePassword();
+
+ addUserPWD.put(login, pwd);
+
+ String password = ldapManager.getEncyptedPassword(pwd);
+
+ BasicAttribute ba = new BasicAttribute("userPassword");
+ ba.add(password);
+ attrs.put(ba);
+
+ BasicAttribute shadowExpire = new BasicAttribute("ENTExpireAccount");
+ shadowExpire.add("-1");
+ attrs.put(shadowExpire);
+
+ BasicAttribute shadowFlag = new BasicAttribute("ENTValidAccount");
+ shadowFlag.add("-1");
+ attrs.put(shadowFlag);
+ logger.debug("generateMissingAttributesForUser end");
+
+ }
+
+ /**
+ * Generate login.
+ *
+ * @param prenom the prenom
+ * @param nom the nom
+ *
+ * @return the string
+ */
+ private String generateLogin(String prenom, String nom) {
+ logger.debug("generateLogin begin");
+ String p = Utils.quoteString(prenom);
+ String n = Utils.quoteString(nom);
+
+ if (n.length() > 5) {
+ n = n.substring(0, 5);
+
+ }
+ String preLogin = "";
+
+ if (p.length() > 0) {
+ char firstLetter = p.toCharArray()[0];
+
+ preLogin = firstLetter + n;
+ } else {
+ preLogin = n;
+ }
+
+ preLogin = StringUtils.lowerCase(preLogin);
+
+ String finalLogin = preLogin;
+
+ logger.debug("generateLogin with "+finalLogin);
+
+ int index = 0;
+
+ while (ldapManager.getLoginPeople().containsKey(finalLogin)
+ || generatedLogins.containsKey(finalLogin)) {
+ index++;
+ finalLogin = preLogin + index;
+ }
+ logger.debug("generateLogin found "+finalLogin);
+
+ generatedLogins.put(finalLogin, "");
+
+ return finalLogin;
+
+ }
+
+ /**
+ * Generate number.
+ *
+ * @return the int
+ */
+ private int generateNumber() {
+
+ return RandomUtils.nextInt(99);
+
+ }
+
+ /**
+ * Generate password.
+ *
+ * @return the string
+ */
+ private String generatePassword() {
+
+ return new PasswordGenerator().getPassword();
+ }
+
+ /**
+ * Generate missing modifications for user.
+ *
+ * @param ar the ar
+ * @param attrs the attrs
+ */
+ private void generateMissingModificationsForUser(ModifyRequest ar,
+ Attributes attrs) {
+
+ // uid value
+ // attrs.put("uid", ar.getIdentifier().getId());
+
+ // Generate login
+ String login = "";
+
+ String prenom = ar.getAttributeByName("givenName").getValue()
+ .iterator().next();
+ String nom = ar.getAttributeByName("sn").getValue().iterator().next();
+
+ login = prenom + "." + nom;
+
+ // attrs.put("ENTPersonLogin" , login);
+
+ // CN
+
+ String cn = nom + " " + prenom;
+
+ attrs.put("cn", cn);
+ attrs.put("displayName", cn);
+
+ attrs.put("ENTValidAccount", "-1");
+ attrs.put("ENTExpireAccount", "-1");
+
+
+ }
+
+ /**
+ * Builds the dn.
+ *
+ * @param id the id
+ * @param objectClasses the object classes
+ * @param full the full
+ *
+ * @return the string
+ */
+ private String buildDn(String id, Set<String> objectClasses, boolean full) {
+
+ String dn = "";
+ String idStyle = "";
+ String branch = "";
+
+ String suffix = ldapManager.getSuffix();
+ if (objectClasses.contains("inetOrgPerson")) {
+ idStyle = "uid";
+ branch = ldapManager.getBranchPeople();
+ } else if (objectClasses.contains("organizationalUnit")) {
+ idStyle = "ou";
+ branch = ldapManager.getBranchEtablissements();
+ } else if (objectClasses.contains("groupOfNames")) {
+ idStyle = "cn";
+ branch = ldapManager.getBranchGroups();
+ }
+
+ id = Utils.fixDN(id);
+ if (full) {
+ dn = String.format("%s=%s,%s,%s", idStyle, id, branch, suffix);
+ } else {
+ dn = String.format("%s=%s,%s", idStyle, id, branch);
+ }
+ return dn;
+
+ }
+
+ /**
+ * Compute dn.
+ *
+ * @param attrName the attr name
+ * @param value the value
+ *
+ * @return the string
+ */
+ private String computeDN(String attrName, String value) {
+
+ String dn = "";
+
+ String branch = "";
+
+ String suffix = ldapManager.getSuffix();
+
+ String idStyle = "";
+
+ if (sconetManager.getAttrRefToUser().contains(attrName)) {
+ branch = ldapManager.getBranchPeople();
+ idStyle = "uid";
+ } else if (sconetManager.getAttrRefToClassGroup().contains(attrName)) {
+ branch = ldapManager.getBranchGroups();
+ idStyle = "cn";
+ } else if (sconetManager.getAttrRefToEtab().contains(attrName)) {
+ branch = ldapManager.getBranchEtablissements();
+ idStyle = "ou";
+ }
+
+ String v = Utils.fixDN(value);
+
+ dn = String.format("%s=%s,%s,%s", idStyle, v, branch, suffix);
+ return dn;
+ }
+
+ /**
+ * Compute value.
+ *
+ * @param ea the ea
+ * @param value the value
+ *
+ * @return the string
+ */
+ private String computeValue(ExtAttribute ea, String value) {
+
+ if (ea.getName().equals("ENTPersonDateNaissance")) {
+ return computeDate(value);
+ }
+
+ return value;
+
+ }
+
+ /**
+ * Compute date.
+ *
+ * @param value the value
+ *
+ * @return the string
+ */
+ private String computeDate(String value) {
+
+ SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy");
+
+ Date d = null;
+ try {
+ d = f.parse(value);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
+
+ String v = dateFormat.format(d).concat("Z");
+ return v;
+
+ }
+
+
+ public void createReportAccessGroup(){
+ String cn = Utils.fixDN(ldapManager.getGroupReportAccess());
+ String dn = String
+ .format("cn=%s,%s", cn, ldapManager.getBranchGroups());
+
+ logger.debug("createReportAccessGroup begin");
+
+ String description = "Groupe des membres ayant droit d'accès aux reports";
+
+ String businessCategory = "user";
+
+ BasicAttribute memberAttr = new BasicAttribute("member");
+
+ List<String> managerEtabDns = ldapManager.getManagerEtabDns();
+
+ if (ldapManager.getIdGroups().containsKey(cn)) {
+ // Group already exist so Modify Group
+
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ for (String userDn :managerEtabDns) {
+ memberAttr.add(userDn);
+ }
+ sattrs.add(memberAttr);
+
+ ldapManager.modify(dn, sattrs, "replace");
+
+ } else {
+ // Add Group
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+ objectClasses.add("groupOfNames");
+
+ Attributes attrs = new BasicAttributes();
+ BasicAttribute ocattr = new BasicAttribute("objectclass");
+ for (String oc : objectClasses) {
+ ocattr.add(oc);
+ }
+ attrs.put(ocattr);
+
+ attrs.put("cn", cn);
+ attrs.put("description", description);
+ attrs.put("businessCategory", businessCategory);
+ attrs.put(memberAttr);
+
+ for (String userDn : managerEtabDns) {
+ memberAttr.add(userDn);
+ }
+ ldapManager.add(dn, attrs);
+
+
+ }
+
+ logger.debug("createReportAccessGroup end");
+
+ }
+
+
+
+ /**
+ * Creates the all members group.
+ */
+ public void createAllMembersGroup() {
+ String cn = Utils.fixDN(ldapManager.getGroupMemberName());
+ String dn = String
+ .format("cn=%s,%s", cn, ldapManager.getBranchGroups());
+
+ logger.debug("createAllMembersGroup begin");
+
+ String description = "Groupe des membres de l'ENT";
+
+ BasicAttribute memberAttr = new BasicAttribute("member");
+
+ if (ldapManager.getIdGroups().containsKey(cn)) {
+ // Group already exist so Modify Group
+ logger.debug("cds exist --> on repeuple");
+ Set<BasicAttribute> sattrs = new HashSet<BasicAttribute>();
+
+ for (String userDn : ldapManager.getDnPeople().keySet()) {
+ memberAttr.add(userDn);
+ }
+ sattrs.add(memberAttr);
+
+ ldapManager.modify(dn, sattrs, "replace");
+ logger.debug("cds members modified");
+
+ } else {
+ // Add Group
+ logger.debug("CDS GRP NOT FOUND WHYYYYY");
+ Set<String> objectClasses = new HashSet<String>();
+
+ objectClasses.add("top");
+ objectClasses.add("groupOfNames");
+
+ Attributes attrs = new BasicAttributes();
+ BasicAttribute ocattr = new BasicAttribute("objectclass");
+ for (String oc : objectClasses) {
+ ocattr.add(oc);
+ }
+ attrs.put(ocattr);
+
+ attrs.put("cn", cn);
+ attrs.put("description", description);
+ attrs.put(memberAttr);
+
+ for (String userDn : ldapManager.getDnPeople().keySet()) {
+ memberAttr.add(userDn);
+ }
+ ldapManager.add(dn, attrs);
+
+ /*
+ * Operation o = Utils.buildOperation(attrs);
+ * o.setType(Operation.ADD);
+ *
+ * String description = "";
+ *
+ * if (group.getType().equals(CLASS)){
+ * o.setTypeEntity(Operation.CLASS); description =
+ * String.format("Classe : %s, (%d)", Utils.fixDN(name),
+ * memberAttr.size()); }else{ description =
+ * String.format("Groupe : %s, (%d)", Utils.fixDN(name),
+ * memberAttr.size()); }
+ *
+ * o.setDescription(description); Beans.getLogDAO().write(o);
+ */
+ }
+
+ }
+
+
+ public int getCategoryEntity(IRequest ar, Set<String> objectClasses){
+
+ int cat = -1;
+
+
+ if (ar != null){
+
+
+ String category = ar.getCategory();
+
+ if (category.equals("Eleve")){
+ cat = Operation.ELEVE;
+ }else if (category.equals("PersEducNat")){
+ cat = Operation.PERSONEDU;
+ }else if (category.equals("PersRelEleve")){
+ cat = Operation.PARENT;
+ }
+
+ }else if (objectClasses != null){
+
+
+
+
+ if (objectClasses.contains("ENTEtablissement")){
+ return Operation.ETAB;
+ }
+
+ if (objectClasses.contains("ENTGroupe")){
+ return Operation.GROUP;
+ }
+
+ if (objectClasses.contains("ENTClasse")){
+ return Operation.CLASS;
+ }
+ }
+
+
+ return cat;
+ }
+
+
+ public boolean isPerson(int cat){
+ if (cat == Operation.PARENT || cat == Operation.ELEVE || cat == Operation.PERSONEDU){
+ return true;
+ }
+ return false;
+ }
+
+ public int getExpirationPeriod() {
+ return expirationPeriod;
+ }
+
+ public void setExpirationPeriod(int expirationPeriod) {
+ this.expirationPeriod = expirationPeriod;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.manager;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import com.pentila.sconet.model.xml.AddRequest;
+import com.pentila.sconet.model.xml.Attr;
+import com.pentila.sconet.model.xml.Attributes;
+import com.pentila.sconet.model.xml.DeleteRequest;
+import com.pentila.sconet.model.xml.FicAlimMENESR;
+import com.pentila.sconet.model.xml.Identifier;
+import com.pentila.sconet.model.xml.Modif;
+import com.pentila.sconet.model.xml.Modifications;
+import com.pentila.sconet.model.xml.ModifyRequest;
+import com.pentila.sconet.model.xml.OperationalAttributes;
+import com.pentila.sconet.model.xml.Value;
+import com.pentila.sconet.util.Utils;
+import com.thoughtworks.xstream.XStream;
+
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SconetManager.
+ */
+public class SconetManager {
+
+ /** The array attr ref to user. */
+ String[] arrayAttrRefToUser = new String[] { "ENTElevePere",
+ "ENTEleveMere", "ENTEleveParents", "ENTElevePersRelEleve1",
+ "ENTElevePersRelEleve2", "ENTEleveAutoriteParentale",
+ "ENTEleveEnsRespStage", "ENTEleveEnsTutStage",
+ "ENTEleveEntrTutStage", "ENTEleveEntrAutres",
+ "ENTAuxPersRelEleveEleve", "ENTAuxPersRelEleveRepresentant",
+ "ENTAuxEnsRespStage", "ENTAuxEnsTutStage",
+ "ENTStructureResponsable", "ENTStructureContactENT",
+ "ENTAppliProprietaire" };
+
+ /** The array attr ref to etab. */
+ String[] arrayAttrRefToEtab = new String[] { "ENTStructureJointure",
+ "ENTPersonStructRattach", "ENTAuxEnsMEF",
+ "ENTEtablissemebtStructRattachAdmin",
+ "ENTEtablissementStructRattachFctl", "ENTEntrepriseEtabs" };
+
+ /** The array attr ref to class group. */
+ String[] arrayAttrRefToClassGroup = new String[] { "ENTEleveClasses",
+ "ENTEleveGroupes", "ENTAuxEnsMatiereEnseignEtab",
+ "ENTAuxEnsClassesPrincipal", "ENTAuxEnsGroupes", "ENTAuxEnsClasses" };
+
+ /** The attr ref to user. */
+ List<String> attrRefToUser;
+
+ /** The attr ref to etab. */
+ List<String> attrRefToEtab;
+
+ /** The attr ref to class group. */
+ List<String> attrRefToClassGroup;
+
+ /** The xs. */
+ XStream xs;
+
+ /** The LFS. */
+ List<FicAlimMENESR> LFS = new ArrayList<FicAlimMENESR>();
+
+ /** The files location. */
+ private String filesLocation;
+
+ /** The files archive location. */
+ private String filesArchiveLocation;
+
+ private Boolean filesArchiveMove;
+
+ /**
+ * Gets the file location.
+ *
+ * @return the file location
+ */
+ public String getFileLocation() {
+ return filesLocation;
+ }
+
+ /**
+ * Sets the files location.
+ *
+ * @param filesLocation the new files location
+ */
+ public void setFilesLocation(String filesLocation) {
+ this.filesLocation = filesLocation;
+ }
+
+ /**
+ * Instantiates a new sconet manager.
+ */
+ public SconetManager() {
+ xs = new XStream(new DomDriver());
+
+ // addRequest TAG
+ xs.addImplicitCollection(OperationalAttributes.class, "atts",
+ Attr.class);
+ xs.addImplicitCollection(Attributes.class, "atts", Attr.class);
+ xs.addImplicitCollection(Modifications.class, "modifs", Modif.class);
+ xs.addImplicitCollection(FicAlimMENESR.class, "addRequest",
+ AddRequest.class);
+ xs.addImplicitCollection(FicAlimMENESR.class, "modifyRequest",
+ ModifyRequest.class);
+ xs.addImplicitCollection(FicAlimMENESR.class, "deleteRequest",
+ DeleteRequest.class);
+ xs.addImplicitCollection(Attr.class, "value", String.class);
+ xs.addImplicitCollection(Modif.class, "value", String.class);
+
+ xs.alias("ficAlimMENESR", FicAlimMENESR.class);
+ xs.alias("addRequest", AddRequest.class);
+ xs.alias("identifier", Identifier.class);
+ xs.alias("operationalAttributes", OperationalAttributes.class);
+ xs.alias("attributes", Attributes.class);
+ xs.alias("attr", Attr.class);
+ xs.alias("value", Value.class);
+ xs.useAttributeFor(Attr.class, "name");
+
+ // ModifyRequest TAG
+ xs.alias("modifyRequest", ModifyRequest.class);
+ xs.alias("modifications", Modifications.class);
+ xs.alias("modification", Modif.class);
+ xs.useAttributeFor(Modif.class, "name");
+ xs.useAttributeFor(Modif.class, "operation");
+
+ // deleteRequest TAG
+ xs.alias("deleteRequest", DeleteRequest.class);
+
+ attrRefToUser = Arrays.asList(arrayAttrRefToUser);
+ attrRefToEtab = Arrays.asList(arrayAttrRefToEtab);
+ attrRefToClassGroup = Arrays.asList(arrayAttrRefToClassGroup);
+
+ }
+
+ /**
+ * Gets the fic alim menesr.
+ *
+ * @param fis the fis
+ *
+ * @return the fic alim menesr
+ */
+ public FicAlimMENESR getFicAlimMENESR(FileInputStream fis) {
+ FicAlimMENESR o = (FicAlimMENESR) xs.fromXML(fis);
+ return o;
+ }
+
+ /**
+ * Load files.
+ */
+ public void loadFiles() {
+
+ // fichier a charger et synchro avec le repo
+ File dir = new File(this.filesLocation);
+ File[] wantedFiles = dir.listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".xml");
+ }
+
+ });
+ List<File> lfs = Arrays.asList(wantedFiles);
+ File[] unwantedFiles = null;
+ List<String> unWantedNames = new ArrayList<String>();
+
+ if (!this.filesArchiveMove) {
+ // fichiers d archive pour voir si il faut faire la synchro
+ File archiveDir = new File(this.filesArchiveLocation);
+ unwantedFiles = archiveDir.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".xml");
+ }
+ });
+ List<File> lfsun = Arrays.asList(unwantedFiles);
+ for (File unWanted: lfsun) {
+ unWantedNames.add(unWanted.getName());
+ }
+ }
+
+
+
+ Collections.sort(lfs, new Comparator<File>() {
+
+ public int compare(File o1, File o2) {
+
+ String filename1 = o1.getName();
+ String filename2 = o2.getName();
+
+ Date d1 = Utils.getDateFromFilename(filename1);
+ Date d2 = Utils.getDateFromFilename(filename2);
+ int i = d1.compareTo(d2);
+
+ if (i!=0){
+ return i;
+ }else{
+ // i == 0;
+ if (filename1.contains("Complet") && filename2.contains("Complet") || filename1.contains("Delta") && filename2.contains("Delta")){
+
+ int l1 = getLevel(filename1);
+ int l2 = getLevel(filename2);
+
+
+
+ return l1 - l2;
+
+
+ }else if (filename1.contains("Complet")){
+ return -1;
+ }else{
+ return 1;
+ }
+ }
+
+ }
+
+ });
+
+
+ List<File> filesToCopy = new ArrayList<File>();
+
+ for (File f : lfs) {
+ if (!this.filesArchiveMove) {
+ // si le fichier est deja en archive on zappe
+ if (unWantedNames.contains(f.getName())) {
+ continue;
+ }
+ filesToCopy.add(f);
+ }
+
+ try {
+ FicAlimMENESR obj = getFicAlimMENESR(new FileInputStream(f));
+
+ if (f.getName().contains("Complet")) {
+ obj.setComplet(true);
+ }
+
+ LFS.add(obj);
+ } catch (Exception e) {
+ // on supprime tous les obj du LFS
+ LFS.clear();
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ // on sort de la boucle
+ break;
+ }
+ }
+
+ if (this.filesArchiveMove) {
+ moveToArchive(lfs);
+ }
+ else {
+ try {
+ copyToArchive(filesToCopy);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ }
+
+ private int getLevel(String filename){
+
+ if (filename.contains("_EtabEducNat_")){
+ return 0;
+ }else if (filename.contains("_Eleve_")){
+ return 1;
+ }else if (filename.contains("_PersEducNat_")){
+ return 2;
+ }else{
+ return 3;
+ }
+
+ }
+
+
+
+ /**
+ * Gets the lFS.
+ *
+ * @return the lFS
+ */
+ public List<FicAlimMENESR> getLFS() {
+ return LFS;
+ }
+
+ /**
+ * Sets the lFS.
+ *
+ * @param lFS the new lFS
+ */
+ public void setLFS(List<FicAlimMENESR> lFS) {
+ LFS = lFS;
+ }
+
+ /**
+ * Gets the attr ref to user.
+ *
+ * @return the attr ref to user
+ */
+ public List<String> getAttrRefToUser() {
+ return attrRefToUser;
+ }
+
+ /**
+ * Sets the attr ref to user.
+ *
+ * @param attrRefToUser the new attr ref to user
+ */
+ public void setAttrRefToUser(List<String> attrRefToUser) {
+ this.attrRefToUser = attrRefToUser;
+ }
+
+ /**
+ * Gets the attr ref to etab.
+ *
+ * @return the attr ref to etab
+ */
+ public List<String> getAttrRefToEtab() {
+ return attrRefToEtab;
+ }
+
+ /**
+ * Sets the attr ref to etab.
+ *
+ * @param attrRefToEtab the new attr ref to etab
+ */
+ public void setAttrRefToEtab(List<String> attrRefToEtab) {
+ this.attrRefToEtab = attrRefToEtab;
+ }
+
+ /**
+ * Gets the attr ref to class group.
+ *
+ * @return the attr ref to class group
+ */
+ public List<String> getAttrRefToClassGroup() {
+ return attrRefToClassGroup;
+ }
+
+ /**
+ * Sets the attr ref to class group.
+ *
+ * @param attrRefToClassGroup the new attr ref to class group
+ */
+ public void setAttrRefToClassGroup(List<String> attrRefToClassGroup) {
+ this.attrRefToClassGroup = attrRefToClassGroup;
+ }
+
+ /**
+ * Gets the files archive location.
+ *
+ * @return the files archive location
+ */
+ public String getFilesArchiveLocation() {
+ return filesArchiveLocation;
+ }
+
+ /**
+ * Sets the files archive location.
+ *
+ * @param filesArchiveLocation the new files archive location
+ */
+ public void setFilesArchiveLocation(String filesArchiveLocation) {
+ this.filesArchiveLocation = filesArchiveLocation;
+ }
+
+ /**
+ * Move to archive.
+ *
+ * @param lfs the lfs
+ *
+ * @return true, if successful
+ */
+ public boolean moveToArchive(List<File> lfs) {
+
+ File archiveDir = new File(this.filesArchiveLocation);
+
+ boolean success = true;
+
+ for (File file : lfs) {
+ boolean current = file
+ .renameTo(new File(archiveDir, file.getName()));
+
+ System.out.println(String.format("File %s moved to %s", file
+ .getName(), archiveDir.getAbsolutePath()));
+
+ success = success && current;
+
+ }
+ return success;
+ }
+ /**
+ * Copy to archive.
+ *
+ * @param lfs the lfs
+ *
+ * @return true, if successful
+ * @throws IOException
+ */
+ public boolean copyToArchive(List<File> lfs) throws IOException {
+
+ //File archiveDir = new File(this.filesArchiveLocation);
+
+ //boolean success = true;
+
+ for (File file : lfs) {
+ System.out.println(String.format("File %s copy to %s", file
+ .getName(), this.filesArchiveLocation+"/"+file.getName()));
+
+ File outputFile = new File(this.filesArchiveLocation+"/"+file.getName());
+
+ FileReader in = new FileReader(file);
+ FileWriter out = new FileWriter(outputFile);
+ int c;
+
+ while ((c = in.read()) != -1)
+ out.write(c);
+
+ in.close();
+ out.close();
+
+
+ }
+ return true;
+ }
+
+ public void setFilesArchiveMove(Boolean filesArchiveMove) {
+ this.filesArchiveMove = filesArchiveMove;
+ }
+
+ public Boolean getFilesArchiveMove() {
+ return filesArchiveMove;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EntityRef.
+ */
+public class EntityRef {
+
+ /** The dn. */
+ String dn;
+
+ /** The id. */
+ String id;
+
+ /**
+ * Gets the dn.
+ *
+ * @return the dn
+ */
+ public String getDn() {
+ return dn;
+ }
+
+ /**
+ * Sets the dn.
+ *
+ * @param dn the new dn
+ */
+ public void setDn(String dn) {
+ this.dn = dn;
+ }
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+
+import org.springframework.ldap.core.AttributesMapper;
+
+import com.pentila.sconet.util.Utils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EtabMapper.
+ */
+public class EtabMapper implements AttributesMapper {
+
+ /* (non-Javadoc)
+ * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
+ */
+ public EtabRef mapFromAttributes(Attributes attrs) throws NamingException {
+ EtabRef er = new EtabRef();
+
+ String ou = "";
+
+ try {
+ ou = Utils.fixDN((String) attrs.get("ou").get());
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ er.setId(ou);
+
+ return er;
+
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+/**
+ * The Class EtabRef.
+ */
+public class EtabRef extends EntityRef {
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Group.
+ */
+public class Group {
+
+ /** The id. */
+ String id;
+
+ /** The type. */
+ String type;
+
+ /** The owner. */
+ String owner;
+
+ /** The members. */
+ Set<String> members = new HashSet<String>();
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the owner.
+ *
+ * @return the owner
+ */
+ public String getOwner() {
+ return owner;
+ }
+
+ /**
+ * Sets the owner.
+ *
+ * @param owner the new owner
+ */
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * Gets the members.
+ *
+ * @return the members
+ */
+ public Set<String> getMembers() {
+ return members;
+ }
+
+ /**
+ * Sets the members.
+ *
+ * @param members the new members
+ */
+ public void setMembers(Set<String> members) {
+ this.members = members;
+ }
+
+ /**
+ * Adds the member.
+ *
+ * @param dn the dn
+ */
+ public void addMember(String dn) {
+ this.members.add(dn);
+ }
+
+ /**
+ * Delete member.
+ *
+ * @param dn the dn
+ */
+ public void deleteMember(String dn) {
+ this.members.remove(dn);
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+
+import org.springframework.ldap.core.AttributesMapper;
+
+import com.pentila.sconet.util.Utils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GroupMapper.
+ */
+public class GroupMapper implements AttributesMapper {
+
+ /* (non-Javadoc)
+ * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
+ */
+ public GroupRef mapFromAttributes(Attributes attrs) throws NamingException {
+ GroupRef er = new GroupRef();
+
+ String cn = "";
+
+ try {
+ cn = Utils.fixDN((String) attrs.get("cn").get());
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ Set<String> members = new HashSet<String>();
+
+ NamingEnumeration enumeration = attrs.get("member").getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ members.add(value);
+ }
+
+ er.setId(cn);
+
+ er.setMembers(members);
+
+ return er;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GroupRef.
+ */
+public class GroupRef extends EntityRef {
+
+ /** The members. */
+ Set<String> members = new HashSet<String>();
+
+ /**
+ * Gets the members.
+ *
+ * @return the members
+ */
+ public Set<String> getMembers() {
+ return members;
+ }
+
+ /**
+ * Sets the members.
+ *
+ * @param members the new members
+ */
+ public void setMembers(Set<String> members) {
+ this.members = members;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+
+import org.springframework.ldap.core.AttributesMapper;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PersonMapper.
+ */
+public class PersonMapper implements AttributesMapper {
+
+ /* (non-Javadoc)
+ * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
+ */
+ public PersonRef mapFromAttributes(Attributes attrs) throws NamingException {
+
+ PersonRef er = new PersonRef();
+
+ String join = "";
+
+ try {
+ join = (String) attrs.get("ENTPersonJointure").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String uid = "";
+
+ try {
+ uid = (String) attrs.get("uid").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String pwd = "";
+ try {
+ pwd = (String) attrs.get("employeeType").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String entValidAccount = "";
+ try {
+ entValidAccount = (String) attrs.get("ENTValidAccount").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String cn = "";
+ try {
+ cn = (String) attrs.get("cn").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String givenName = "";
+ try {
+ givenName = (String) attrs.get("givenName").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String sn = "";
+ try {
+ sn = (String) attrs.get("sn").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String login = "";
+ try {
+ login = (String) attrs.get("ENTPersonLogin").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ String numEtabDn = "";
+ try {
+ numEtabDn = (String) attrs.get("ENTPersonStructRattach").get();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ Set<String> entPersonProfils = new HashSet<String>();
+
+ Attribute aProfils = attrs.get("ENTPersonProfils");
+ if (aProfils != null) {
+ NamingEnumeration enumeration = aProfils.getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ entPersonProfils.add(value);
+ }
+ }
+
+ String[] lgs = new String[] { "ENTEleveGroupes", "ENTAuxEnsGroupes" };
+
+ Set<String> groups = new HashSet<String>();
+
+ for (String attrName : lgs) {
+ Attribute a = attrs.get(attrName);
+ if (a != null) {
+ NamingEnumeration enumeration = a.getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ groups.add(value);
+ }
+ }
+
+ }
+ String[] lcs = new String[] { "ENTEleveClasses", "ENTAuxEnsClasses",
+ "ENTAuxEnsClassesPrincipal" };
+
+ Set<String> classes = new HashSet<String>();
+
+ for (String attrName : lcs) {
+ Attribute a = attrs.get(attrName);
+ if (a != null) {
+ NamingEnumeration enumeration = a.getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ classes.add(value);
+ }
+ }
+
+ }
+
+ Set<String> parentDns = new HashSet<String>();
+ String[] lrs = new String[] { "ENTEleveParents", "ENTElevePersRelEleve1", "ENTElevePersRelEleve2" };
+ for (String attrName : lrs){
+
+ Attribute a = attrs.get(attrName);
+ if (a != null) {
+ NamingEnumeration enumeration = a.getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ parentDns.add(value);
+ }
+ }
+ }
+
+ Set<String> elevesDn = new HashSet<String>();
+ Attribute elevesAttrs = attrs.get("ENTAuxPersRelEleveEleve");
+ if (elevesAttrs != null) {
+ NamingEnumeration enumeration = elevesAttrs.getAll();
+ while (enumeration.hasMoreElements()) {
+ String value = (String) enumeration.nextElement();
+ elevesDn.add(value);
+ }
+ }
+
+
+
+ er.setId(uid);
+ er.setJoin(join);
+ er.setLogin(login);
+ er.setCn(cn);
+ er.setGroupDns(groups);
+ er.setClassDns(classes);
+ er.setNumEtabDn(numEtabDn);
+ er.setParentDns(parentDns);
+
+ er.setPassword(pwd);
+ er.setGivenName(givenName);
+ er.setSn(sn);
+ er.setEntPersonProfils(entPersonProfils);
+ er.setElevesDn(elevesDn);
+
+ return er;
+
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.ldap;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PersonRef.
+ */
+public class PersonRef extends EntityRef {
+
+ /** The join. */
+ String join;
+
+ /** The login. */
+ String login;
+
+ /** The password. */
+ String password;
+
+ /** The num etab dn. */
+ String numEtabDn;
+
+ /** The cn. */
+ String cn;
+
+ /** The groups. */
+ Set<String> groups = new HashSet<String>();
+
+ /** The classes. */
+ Set<String> classes = new HashSet<String>();
+
+ Set<String> parentDns = new HashSet<String>();
+
+ Set<String> elevesDn = new HashSet<String>();
+
+ /** The givenName. */
+ String givenName;
+
+ /** The sn. */
+ String sn;
+
+ /** The ENTPersonProfils */
+ Set<String> entPersonProfils = new HashSet<String>();
+
+ String ENTValidAccount = "";
+
+ /**
+ * Gets the login.
+ *
+ * @return the login
+ */
+ public String getLogin() {
+ return login;
+ }
+
+ /**
+ * Sets the login.
+ *
+ * @param login the new login
+ */
+ public void setLogin(String login) {
+ this.login = login;
+ }
+
+ /**
+ * Gets the join.
+ *
+ * @return the join
+ */
+ public String getJoin() {
+ return join;
+ }
+
+ /**
+ * Sets the join.
+ *
+ * @param join the new join
+ */
+ public void setJoin(String join) {
+ this.join = join;
+ }
+
+ /**
+ * Gets the group dns.
+ *
+ * @return the group dns
+ */
+ public Set<String> getGroupDns() {
+ return groups;
+ }
+
+ /**
+ * Sets the group dns.
+ *
+ * @param groups the new group dns
+ */
+ public void setGroupDns(Set<String> groups) {
+ this.groups = groups;
+ }
+
+ /**
+ * Gets the class dns.
+ *
+ * @return the class dns
+ */
+ public Set<String> getClassDns() {
+ return classes;
+ }
+
+ /**
+ * Sets the class dns.
+ *
+ * @param classes the new class dns
+ */
+ public void setClassDns(Set<String> classes) {
+ this.classes = classes;
+ }
+
+ /**
+ * Gets the num etab dn.
+ *
+ * @return the num etab dn
+ */
+ public String getNumEtabDn() {
+ return numEtabDn;
+ }
+
+ /**
+ * Sets the num etab dn.
+ *
+ * @param numEtabDn the new num etab dn
+ */
+ public void setNumEtabDn(String numEtabDn) {
+ this.numEtabDn = numEtabDn;
+ }
+
+ /**
+ * Gets the cn.
+ *
+ * @return the cn
+ */
+ public String getCn() {
+ return cn;
+ }
+
+ /**
+ * Sets the cn.
+ *
+ * @param cn the new cn
+ */
+ public void setCn(String cn) {
+ this.cn = cn;
+ }
+
+ public Set<String> getParentDns() {
+ return parentDns;
+ }
+
+ public void setParentDns(Set<String> parentDns) {
+ this.parentDns = parentDns;
+ }
+
+ /**
+ * @return the password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param password the password to set
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return the givenName
+ */
+ public String getGivenName() {
+ return givenName;
+ }
+
+ /**
+ * @param givenName the givenName to set
+ */
+ public void setGivenName(String givenName) {
+ this.givenName = givenName;
+ }
+
+ /**
+ * @return the sn
+ */
+ public String getSn() {
+ return sn;
+ }
+
+ /**
+ * @param sn the sn to set
+ */
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ /**
+ * @return the entPersonProfils
+ */
+ public Set<String> getEntPersonProfils() {
+ return entPersonProfils;
+ }
+
+ /**
+ * @param entPersonProfils the entPersonProfils to set
+ */
+ public void setEntPersonProfils(Set<String> entPersonProfils) {
+ this.entPersonProfils = entPersonProfils;
+ }
+
+ /**
+ * @return the elevesDns
+ */
+ public Set<String> getElevesDn() {
+ return elevesDn;
+ }
+
+ /**
+ * @param elevesDns the elevesDns to set
+ */
+ public void setElevesDn(Set<String> elevesDn) {
+ this.elevesDn = elevesDn;
+ }
+
+ /**
+ * @return the eNTValidAccount
+ */
+ public String getENTValidAccount() {
+ return ENTValidAccount;
+ }
+
+ /**
+ * @param eNTValidAccount the eNTValidAccount to set
+ */
+ public void setENTValidAccount(String eNTValidAccount) {
+ ENTValidAccount = eNTValidAccount;
+ }
+
+
+}
--- /dev/null
+package com.pentila.sconet.model.log;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Event.
+ */
+@Entity
+@Table(name = "event")
+public class Event {
+ // Event Type
+ /** The ERROR. */
+ public static int ERROR = 0;
+
+ /** The WARN. */
+ public static int WARN = 1;
+
+ /** The MISSING. */
+ public static int MISSING = 2;
+
+ /** The INFO. */
+ public static int INFO = 3;
+
+ // Source
+ /** The LDAP. */
+ public static int LDAP = 4;
+
+ /** The XML. */
+ public static int XML = 5;
+
+ /**
+ * Instantiates a new event.
+ */
+ public Event() {
+ timestamp = new Date();
+ }
+
+ /** The id. */
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ Long id;
+
+ /** The type. */
+ @Column(name = "type")
+ Integer type;
+
+ /** The source. */
+ @Column(name = "source")
+ Integer source;
+
+ /** The num etab. */
+ @Column(name = "numetab")
+ Long numEtab;
+
+ /** The num entity. */
+ @Column(name = "numentity")
+ Long numEntity;
+
+ /** The description. */
+ @Column(name = "description")
+ String description;
+
+ /** The timestamp. */
+ @Column(name = "timestamp")
+ Date timestamp;
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public Integer getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the num etab.
+ *
+ * @return the num etab
+ */
+ public Long getNumEtab() {
+ return numEtab;
+ }
+
+ /**
+ * Sets the num etab.
+ *
+ * @param numEtab the new num etab
+ */
+ public void setNumEtab(Long numEtab) {
+ this.numEtab = numEtab;
+ }
+
+ /**
+ * Gets the num entity.
+ *
+ * @return the num entity
+ */
+ public Long getNumEntity() {
+ return numEntity;
+ }
+
+ /**
+ * Sets the num entity.
+ *
+ * @param numEntity the new num entity
+ */
+ public void setNumEntity(Long numEntity) {
+ this.numEntity = numEntity;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the source.
+ *
+ * @return the source
+ */
+ public Integer getSource() {
+ return source;
+ }
+
+ /**
+ * Sets the source.
+ *
+ * @param source the new source
+ */
+ public void setSource(Integer source) {
+ this.source = source;
+ }
+
+ /**
+ * Gets the timestamp.
+ *
+ * @return the timestamp
+ */
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * Sets the timestamp.
+ *
+ * @param timestamp the new timestamp
+ */
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.log;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Operation.
+ */
+@Entity
+@Table(name = "operation")
+public class Operation {
+
+ // Type operation
+ /** The ADD. */
+ public static int ADD = 0;
+
+ /** The MOD. */
+ public static int MOD = 1;
+
+ /** The DEL. */
+ public static int DEL = 2;
+
+ // type entity
+ /** The PERSON. */
+
+
+ public static int ELEVE = 4;
+
+ public static int PERSONEDU = 5;
+
+
+
+ public static int PARENT = 8;
+
+
+
+ /** The ETAB. */
+ public static int ETAB = 10;
+
+ /** The GROUP. */
+ public static int GROUP = 11;
+
+ /** The CLASS. */
+ public static int CLASS = 12;
+
+ /**
+ * Instantiates a new operation.
+ */
+ public Operation() {
+ timestamp = new Date();
+ }
+
+ /** The id. */
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ Long id;
+
+ /** The name. */
+ @Column(name = "name")
+ String name ="";
+ @Column(name="prenom")
+ String prenom = "";
+
+ @Column(name="mail")
+ String mail = "";
+
+ @Column(name="login")
+ String login ="";
+
+ @Column(name="password")
+ String password = "";
+
+
+ @Column(name="division")
+ String division ="";
+
+ @Column(name="fonctions")
+ String fonctions ="";
+
+ /** The description. */
+ @Column(name = "description")
+ String description;
+
+ /** The type. */
+ @Column(name = "type")
+ Integer type;
+
+ /** The num etab. */
+ @Column(name = "numetab")
+ Long numEtab;
+
+ /** The num entity. */
+ @Column(name = "numentity")
+ Long numEntity;
+
+ /** The type entity. */
+ @Column(name = "typeentity")
+ Integer typeEntity;
+
+ /** The timestamp. */
+ @Column(name = "timestamp")
+ Date timestamp;
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the timestamp.
+ *
+ * @return the timestamp
+ */
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * Sets the timestamp.
+ *
+ * @param timestamp the new timestamp
+ */
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public Integer getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the num etab.
+ *
+ * @return the num etab
+ */
+ public Long getNumEtab() {
+ return numEtab;
+ }
+
+ /**
+ * Sets the num etab.
+ *
+ * @param numEtab the new num etab
+ */
+ public void setNumEtab(Long numEtab) {
+ this.numEtab = numEtab;
+ }
+
+ /**
+ * Gets the num entity.
+ *
+ * @return the num entity
+ */
+ public Long getNumEntity() {
+ return numEntity;
+ }
+
+ /**
+ * Sets the num entity.
+ *
+ * @param numEntity the new num entity
+ */
+ public void setNumEntity(Long numEntity) {
+ this.numEntity = numEntity;
+ }
+
+ /**
+ * Gets the type entity.
+ *
+ * @return the type entity
+ */
+ public Integer getTypeEntity() {
+ return typeEntity;
+ }
+
+ /**
+ * Sets the type entity.
+ *
+ * @param typeEntity the new type entity
+ */
+ public void setTypeEntity(Integer typeEntity) {
+ this.typeEntity = typeEntity;
+ }
+
+ public String getPrenom() {
+ return prenom;
+ }
+
+ public void setPrenom(String prenom) {
+ this.prenom = prenom;
+ }
+
+ public String getMail() {
+ return mail;
+ }
+
+ public void setMail(String mail) {
+ this.mail = mail;
+ }
+
+ public String getLogin() {
+ return login;
+ }
+
+ public void setLogin(String login) {
+ this.login = login;
+ }
+
+ public String getDivision() {
+ return division;
+ }
+
+ public void setDivision(String division) {
+ this.division = division;
+ }
+
+ public String getFonctions() {
+ return fonctions;
+ }
+
+ public void setFonctions(String fonctions) {
+ this.fonctions = fonctions;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.log;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Operation.
+ */
+@Entity
+@Table(name = "userInfo")
+public class User {
+
+ // type entity
+ /** The PERSON. */
+
+
+ public static int ELEVE = 4;
+
+ public static int PERSONEDU = 5;
+
+
+
+ public static int PARENT = 8;
+
+
+
+ /** The ETAB. */
+ public static int ETAB = 10;
+
+ /** The GROUP. */
+ public static int GROUP = 11;
+
+ /** The CLASS. */
+ public static int CLASS = 12;
+
+ /**
+ * Instantiates a new operation.
+ */
+ public User() {
+ timestamp = new Date();
+ }
+
+ /** The id. */
+ @Id
+ String uid = "";
+
+ /** The name. */
+ @Column(name = "name")
+ String name ="";
+ @Column(name="prenom")
+ String prenom = "";
+
+ @Column(name="mail")
+ String mail = "";
+
+ @Column(name="login")
+ String login ="";
+
+ @Column(name="password")
+ String password = "";
+
+
+ @Column(name="division")
+ String division ="";
+
+ @Column(name="fonctions")
+ String fonctions ="";
+
+ /** The description. */
+ @Column(name = "description")
+ String description;
+
+ /** The num etab. */
+ @Column(name = "numetab")
+ Long numEtab;
+
+ /** The num entity. */
+ @Column(name = "numentity")
+ Long numEntity;
+
+ /** The type entity. */
+ @Column(name = "typeentity")
+ Integer typeEntity;
+
+ /** The entValidAccount entity. */
+ @Column(name = "entvalidaccount")
+ Integer entvalidaccount;
+
+ /** The timestamp. */
+ @Column(name = "timestamp")
+ Date timestamp;
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getUid() {
+ return uid;
+ }
+
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the timestamp.
+ *
+ * @return the timestamp
+ */
+ public Date getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * Sets the timestamp.
+ *
+ * @param timestamp the new timestamp
+ */
+ public void setTimestamp(Date timestamp) {
+ this.timestamp = timestamp;
+ }
+
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the num etab.
+ *
+ * @return the num etab
+ */
+ public Long getNumEtab() {
+ return numEtab;
+ }
+
+ /**
+ * Sets the num etab.
+ *
+ * @param numEtab the new num etab
+ */
+ public void setNumEtab(Long numEtab) {
+ this.numEtab = numEtab;
+ }
+
+ /**
+ * Gets the num entity.
+ *
+ * @return the num entity
+ */
+ public Long getNumEntity() {
+ return numEntity;
+ }
+
+ /**
+ * Sets the num entity.
+ *
+ * @param numEntity the new num entity
+ */
+ public void setNumEntity(Long numEntity) {
+ this.numEntity = numEntity;
+ }
+
+ /**
+ * Gets the type entity.
+ *
+ * @return the type entity
+ */
+ public Integer getTypeEntity() {
+ return typeEntity;
+ }
+
+ /**
+ * Sets the type entity.
+ *
+ * @param typeEntity the new type entity
+ */
+ public void setTypeEntity(Integer typeEntity) {
+ this.typeEntity = typeEntity;
+ }
+
+ public String getPrenom() {
+ return prenom;
+ }
+
+ public void setPrenom(String prenom) {
+ this.prenom = prenom;
+ }
+
+ public String getMail() {
+ return mail;
+ }
+
+ public void setMail(String mail) {
+ this.mail = mail;
+ }
+
+ public String getLogin() {
+ return login;
+ }
+
+ public void setLogin(String login) {
+ this.login = login;
+ }
+
+ public String getDivision() {
+ return division;
+ }
+
+ public void setDivision(String division) {
+ this.division = division;
+ }
+
+ public String getFonctions() {
+ return fonctions;
+ }
+
+ public void setFonctions(String fonctions) {
+ this.fonctions = fonctions;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return the entvalidaccount
+ */
+ public Integer getEntvalidaccount() {
+ return entvalidaccount;
+ }
+
+ /**
+ * @param entvalidaccount the entvalidaccount to set
+ */
+ public void setEntvalidaccount(Integer entvalidaccount) {
+ this.entvalidaccount = entvalidaccount;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang.StringUtils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddRequest.
+ */
+public class AddRequest extends RequestAbstract implements Serializable, IRequest {
+
+
+
+ /** The attributes. */
+ Attributes attributes;
+
+
+
+ /**
+ * Gets the attribute names.
+ *
+ * @return the attribute names
+ */
+ public Set<String> getAttributeNames() {
+ Set<String> as = new HashSet<String>();
+
+ for (Attr a : attributes.getAtts()) {
+ as.add(a.getName());
+ }
+ return as;
+ }
+
+ /**
+ * Gets the raw attributes.
+ *
+ * @return the raw attributes
+ */
+ public Set<Attr> getRawAttributes() {
+ return attributes.getAtts();
+ }
+
+ /**
+ * Gets the attribute by name.
+ *
+ * @param name the name
+ *
+ * @return the attribute by name
+ */
+ public Attr getAttributeByName(String name) {
+ for (Attr a : getRawAttributes()) {
+ if (a.getName().equals(name)) {
+ return a;
+ }
+ }
+ return null;
+ }
+
+
+
+ /**
+ * Gets the attributes.
+ *
+ * @return the attributes
+ */
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * Sets the attributes.
+ *
+ * @param attributes the new attributes
+ */
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.io.Serializable;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Attr.
+ */
+public class Attr implements Serializable {
+
+ /** The name. */
+ String name;
+
+ /** The value. */
+ List<String> value;
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value the new value
+ */
+ public void setValue(List<String> value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Attributes.
+ */
+public class Attributes {
+
+ /** The atts. */
+ Set<Attr> atts = new HashSet<Attr>();
+
+ /**
+ * Gets the atts.
+ *
+ * @return the atts
+ */
+ public Set<Attr> getAtts() {
+ return atts;
+ }
+
+ /**
+ * Sets the atts.
+ *
+ * @param atts the new atts
+ */
+ public void setAtts(Set<Attr> atts) {
+ this.atts = atts;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DeleteRequest.
+ */
+public class DeleteRequest {
+
+ /** The identifier. */
+ Identifier identifier;
+
+ /** The operational attributes. */
+ OperationalAttributes operationalAttributes;
+
+ /**
+ * Gets the identifier.
+ *
+ * @return the identifier
+ */
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+
+ /**
+ * Sets the identifier.
+ *
+ * @param identifier the new identifier
+ */
+ public void setIdentifier(Identifier identifier) {
+ this.identifier = identifier;
+ }
+
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
+ public String getCategory() {
+ String res = "";
+ Attr a = operationalAttributes.getAtts().iterator().next();
+ return a.getName();
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ExtAttribute.
+ */
+public class ExtAttribute {
+
+ /** The name. */
+ String name;
+
+ /** The class names. */
+ Set<String> classNames = new HashSet<String>();
+
+ /** The single value. */
+ boolean singleValue = true;
+
+ /** The must. */
+ boolean must = true;
+
+ /** The dn. */
+ boolean dn = false;;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the class names.
+ *
+ * @return the class names
+ */
+ public Set<String> getClassNames() {
+ return classNames;
+ }
+
+ /**
+ * Sets the class names.
+ *
+ * @param classNames the new class names
+ */
+ public void setClassNames(Set<String> classNames) {
+ this.classNames = classNames;
+ }
+
+ /**
+ * Checks if is single value.
+ *
+ * @return true, if is single value
+ */
+ public boolean isSingleValue() {
+ return singleValue;
+ }
+
+ /**
+ * Sets the single value.
+ *
+ * @param singleValue the new single value
+ */
+ public void setSingleValue(boolean singleValue) {
+ this.singleValue = singleValue;
+ }
+
+ /**
+ * Checks if is must.
+ *
+ * @return true, if is must
+ */
+ public boolean isMust() {
+ return must;
+ }
+
+ /**
+ * Sets the must.
+ *
+ * @param must the new must
+ */
+ public void setMust(boolean must) {
+ this.must = must;
+ }
+
+ /**
+ * Checks if is dn.
+ *
+ * @return true, if is dn
+ */
+ public boolean isDn() {
+ return dn;
+ }
+
+ /**
+ * Sets the dn.
+ *
+ * @param dn the new dn
+ */
+ public void setDn(boolean dn) {
+ this.dn = dn;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class FicAlimMENESR.
+ */
+public class FicAlimMENESR implements Serializable {
+
+ boolean complet = false;
+
+ /**
+ * @return the complet
+ */
+ public boolean isComplet() {
+ return complet;
+ }
+
+ /**
+ * @param complet the complet to set
+ */
+ public void setComplet(boolean complet) {
+ this.complet = complet;
+ }
+
+ /** The add request. */
+ List<AddRequest> addRequest = new ArrayList<AddRequest>();
+
+ /** The modify request. */
+ List<ModifyRequest> modifyRequest = new ArrayList<ModifyRequest>();
+
+ /** The delete request. */
+ List<DeleteRequest> deleteRequest = new ArrayList<DeleteRequest>();
+
+ /**
+ * Gets the adds the request.
+ *
+ * @return the adds the request
+ */
+ public List<AddRequest> getAddRequest() {
+ return addRequest;
+ }
+
+ /**
+ * Sets the adds the request.
+ *
+ * @param addRequest the new adds the request
+ */
+ public void setAddRequest(List<AddRequest> addRequest) {
+ this.addRequest = addRequest;
+ }
+
+ /**
+ * Gets the modify request.
+ *
+ * @return the modify request
+ */
+ public List<ModifyRequest> getModifyRequest() {
+ return modifyRequest;
+ }
+
+ /**
+ * Sets the modify request.
+ *
+ * @param modifyRequest the new modify request
+ */
+ public void setModifyRequest(List<ModifyRequest> modifyRequest) {
+ this.modifyRequest = modifyRequest;
+ }
+
+ /**
+ * Gets the delete request.
+ *
+ * @return the delete request
+ */
+ public List<DeleteRequest> getDeleteRequest() {
+ return deleteRequest;
+ }
+
+ /**
+ * Sets the delete request.
+ *
+ * @param deleteRequest the new delete request
+ */
+ public void setDeleteRequest(List<DeleteRequest> deleteRequest) {
+ this.deleteRequest = deleteRequest;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.Set;
+
+public interface IRequest {
+ public Identifier getIdentifier();
+ public Set<String> getAttributeNames();
+
+ public String getCategory();
+
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.io.Serializable;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Identifier.
+ */
+public class Identifier implements Serializable {
+
+ /** The id. */
+ String id;
+
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the id.
+ *
+ * @param id the new id
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.List;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Modif.
+ */
+public class Modif {
+
+ /** The name. */
+ String name;
+
+ /** The operation. */
+ String operation;
+
+ /** The value. */
+ List<String> value;
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the operation.
+ *
+ * @return the operation
+ */
+ public String getOperation() {
+ return operation;
+ }
+
+ /**
+ * Sets the operation.
+ *
+ * @param operation the new operation
+ */
+ public void setOperation(String operation) {
+ this.operation = operation;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value the new value
+ */
+ public void setValue(List<String> value) {
+ this.value = value;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Modifications.
+ */
+public class Modifications {
+
+ /** The modifs. */
+ Set<Modif> modifs = new HashSet<Modif>();
+
+ /**
+ * Gets the modifs.
+ *
+ * @return the modifs
+ */
+ public Set<Modif> getModifs() {
+ return modifs;
+ }
+
+ /**
+ * Sets the modifs.
+ *
+ * @param modifs the new modifs
+ */
+ public void setModifs(Set<Modif> modifs) {
+ this.modifs = modifs;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.HashSet;
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ModifyRequest.
+ */
+public class ModifyRequest extends RequestAbstract implements IRequest{
+
+
+ /** The modifications. */
+ Modifications modifications = new Modifications();
+
+
+
+ /**
+ * Gets the attribute names.
+ *
+ * @return the attribute names
+ */
+ public Set<String> getAttributeNames() {
+ Set<String> as = new HashSet<String>();
+
+ for (Modif a : modifications.getModifs()) {
+ as.add(a.getName());
+ }
+ return as;
+ }
+
+ /**
+ * Gets the raw modifications.
+ *
+ * @return the raw modifications
+ */
+ public Set<Modif> getRawModifications() {
+ return modifications.getModifs();
+ }
+
+ /**
+ * Gets the attribute by name.
+ *
+ * @param name the name
+ *
+ * @return the attribute by name
+ */
+ public Modif getAttributeByName(String name) {
+ for (Modif a : getRawModifications()) {
+ if (a.getName().equals(name)) {
+ return a;
+ }
+ }
+ return null;
+ }
+
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.Set;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class OperationalAttributes.
+ */
+public class OperationalAttributes {
+
+ /** The atts. */
+ Set<Attr> atts;
+
+ /**
+ * Gets the atts.
+ *
+ * @return the atts
+ */
+ public Set<Attr> getAtts() {
+ return atts;
+ }
+
+ /**
+ * Sets the atts.
+ *
+ * @param atts the new atts
+ */
+ public void setAtts(Set<Attr> atts) {
+ this.atts = atts;
+ }
+
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+import java.util.Set;
+
+import org.springframework.util.StringUtils;
+
+public class RequestAbstract implements IRequest{
+
+ /** The identifier. */
+ Identifier identifier;
+
+ /** The operational attributes. */
+ OperationalAttributes operationalAttributes;
+
+ /**
+ * Gets the identifier.
+ *
+ * @return the identifier
+ */
+ public Identifier getIdentifier() {
+ return identifier;
+ }
+
+ /**
+ * Sets the identifier.
+ *
+ * @param identifier the new identifier
+ */
+ public void setIdentifier(Identifier identifier) {
+ this.identifier = identifier;
+ }
+
+ /**
+ * Gets the operational attributes.
+ *
+ * @return the operational attributes
+ */
+ public OperationalAttributes getOperationalAttributes() {
+ return operationalAttributes;
+ }
+
+ /**
+ * Sets the operational attributes.
+ *
+ * @param operationalAttributes the new operational attributes
+ */
+ public void setOperationalAttributes(
+ OperationalAttributes operationalAttributes) {
+ this.operationalAttributes = operationalAttributes;
+ }
+
+
+ public String getCategory(){
+
+ Attr a = this.operationalAttributes.getAtts().iterator().next();
+ String aa = StringUtils.arrayToDelimitedString(a.getValue().toArray(), ",");
+ return aa;
+ }
+
+ public Set<String> getAttributeNames() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
--- /dev/null
+package com.pentila.sconet.model.xml;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Value.
+ */
+public class Value {
+
+ /** The value. */
+ String value;
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value the new value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
--- /dev/null
+/**\r
+ * @author Darron Schall\r
+ * @version 1.0\r
+ * \r
+ * Aug. 22, 2003\r
+ * \r
+ * PasswordGenerator for creating random passwords. \r
+ * \r
+ * Four password flags are available to dictate generation,\r
+ * or a template can be specificed to generate a string with \r
+ * a specified character type at each position.\r
+ * \r
+ * Revision History:\r
+ * Rev Date Who Description\r
+ * 1.0 8/22/03 darron Initial Draft\r
+ * --------------------------------------\r
+ * License For Use\r
+ * --------------------------------------\r
+ * Redistribution and use in source and binary forms, with or without modification,\r
+ * are permitted provided that the following conditions are met:\r
+ * \r
+ * 1. Redistributions of source code must retain the above copyright notice, this\r
+ * list of conditions and the following disclaimer.\r
+ * \r
+ * 2. Redistributions in binary form must reproduce the above copyright notice,\r
+ * this list of conditions and the following disclaimer in the documentation\r
+ * and/or other materials provided with the distribution.\r
+ * \r
+ * 3. The name of the author may not be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\r
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\r
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\r
+ * OF SUCH DAMAGE.\r
+ */\r
+\r
+package com.pentila.sconet.util;\r
+\r
+import java.util.ArrayList;\r
+\r
+// Re-use some existing exceptions so we don't have to create\r
+// our own.\r
+import java.util.prefs.InvalidPreferencesFormatException;\r
+import java.text.ParseException;\r
+\r
+// TODO: Auto-generated Javadoc\r
+/**\r
+ * The Class PasswordGenerator.\r
+ */\r
+public class PasswordGenerator {\r
+ \r
+ /** The length. */\r
+ private int length;\r
+\r
+ /** The lowercase included. */\r
+ private boolean lowercaseIncluded;\r
+ \r
+ /** The numbers included. */\r
+ private boolean numbersIncluded;\r
+ \r
+ /** The others included. */\r
+ private boolean othersIncluded;\r
+ \r
+ /** The uppercase included. */\r
+ private boolean uppercaseIncluded;\r
+\r
+ /** The password. */\r
+ private String password;\r
+ \r
+ /** The template. */\r
+ private String template;\r
+\r
+ /**\r
+ * Instantiates a new password generator.\r
+ */\r
+ public PasswordGenerator() {\r
+ // by default, invlude lowercase, uppercase, and numbers\r
+ // in the password, and make it 8 characters long.\r
+ password = "";\r
+ template = "";\r
+ length = 8;\r
+ lowercaseIncluded = true;\r
+ uppercaseIncluded = true;\r
+ numbersIncluded = true;\r
+ othersIncluded = false;\r
+\r
+ // start the ball rolling by generating a password so that\r
+ // we keep our data integrity\r
+ // i.e. so length matches password.length());\r
+ generatePassword();\r
+ }\r
+\r
+ /**\r
+ * Flags ok.\r
+ * \r
+ * @return true if at least one of the password generation flags is true,\r
+ * otherwise returns false\r
+ */\r
+ private boolean flagsOK() {\r
+ return lowercaseIncluded || uppercaseIncluded || numbersIncluded\r
+ || othersIncluded;\r
+ }\r
+\r
+ /**\r
+ * Random lowercase.\r
+ * \r
+ * @return a random lowercase character from 'a' to 'z'\r
+ */\r
+ private static char randomLowercase() {\r
+ return (char) (97 + (int) (Math.random() * 26));\r
+ }\r
+\r
+ /**\r
+ * Random uppercase.\r
+ * \r
+ * @return a random uppercase character from 'A' to 'Z'\r
+ */\r
+ private static char randomUppercase() {\r
+ return (char) (65 + (int) (Math.random() * 26));\r
+ }\r
+\r
+ /**\r
+ * Random other.\r
+ * \r
+ * @return a random character in this list: !"#$%&'()*+,-./\r
+ */\r
+ private static char randomOther() {\r
+ return (char) (33 + (int) (Math.random() * 15));\r
+ }\r
+\r
+ /**\r
+ * Random number.\r
+ * \r
+ * @return a random character from '0' to '9'\r
+ */\r
+ private static char randomNumber() {\r
+ return (char) (48 + (int) (Math.random() * 10));\r
+ }\r
+\r
+ /**\r
+ * Generate password.\r
+ */\r
+ public void generatePassword() /*\r
+ * throws InvalidPreferencesFormatException,\r
+ * ParseException\r
+ */{\r
+ // clear password if necessary\r
+ if (password.length() != 0) {\r
+ password = "";\r
+ }\r
+\r
+ // check to make sure at least one "type" is included\r
+ // for password generation if template is not defined\r
+\r
+ // commented out because our setters/construcor should\r
+ // ensure data integrity\r
+ // if (!flagsOK() && template.length() == 0) {\r
+ // throw new\r
+ // java.util.prefs.InvalidPreferencesFormatException("At least one flag must be on to generate a password");\r
+ // }\r
+\r
+ // we know length >= 1 here because setLength\r
+ // doesn't allow invalid lengths and the constructor\r
+ // initializes length to 8\r
+\r
+ // a template being defined overrides all flags\r
+ if (template.length() > 0) {\r
+ length = template.length();\r
+ for (int i = 0; i < length; i++) {\r
+ switch (template.charAt(i)) {\r
+ case 'a':\r
+ password += randomLowercase();\r
+ break;\r
+\r
+ case 'A':\r
+ password += randomUppercase();\r
+ break;\r
+\r
+ case 'n':\r
+ case 'N':\r
+ password += randomNumber();\r
+ break;\r
+\r
+ case 'o':\r
+ case 'O':\r
+ password += randomOther();\r
+ break;\r
+\r
+ // commented out because our setters/constructor\r
+ // should ensure data integrity\r
+ // default :\r
+ // throw new\r
+ // ParseException("Password template contains an invalid character",\r
+ // i);\r
+ }\r
+ }\r
+ } else {\r
+ // In Java we can't create an array of function references\r
+ // so I've created 4 "wrapper" classes that inherit from the\r
+ // randomCharacter interface to provide the same\r
+ // type of functionality.\r
+\r
+ // create an ArrayList to store the functions that we're allowed\r
+ // to call to generate the password, based on what the flags\r
+ // are set to.\r
+ ArrayList flags = new ArrayList();\r
+ if (lowercaseIncluded) {\r
+ flags.add(new randomLowercase());\r
+ }\r
+ if (uppercaseIncluded) {\r
+ flags.add(new randomUppercase());\r
+ }\r
+ if (othersIncluded) {\r
+ flags.add(new randomOther());\r
+ }\r
+ if (numbersIncluded) {\r
+ flags.add(new randomNumber());\r
+ }\r
+\r
+ int flagLength = flags.size();\r
+\r
+ for (int i = 0; i < length; i++) {\r
+ // get a random wrapper class from the flags ArrayList\r
+ // and cast it to our interface so we can call the execute\r
+ // method\r
+ // which just calls the function and returns its value.\r
+ password += ((randomCharacter) flags\r
+ .get((int) (Math.random() * flagLength))).execute();\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Gets the length.\r
+ * \r
+ * @return the length of the generated password\r
+ */\r
+ public int getLength() {\r
+ return length;\r
+ }\r
+\r
+ /**\r
+ * Gets the password.\r
+ * \r
+ * @return the generated password\r
+ */\r
+ public String getPassword() {\r
+ return password;\r
+ }\r
+\r
+ /**\r
+ * Gets the template.\r
+ * \r
+ * @return password template\r
+ */\r
+ public String getTemplate() {\r
+ return template;\r
+ }\r
+\r
+ /**\r
+ * Checks if is lowercase included.\r
+ * \r
+ * @return lowercaseIncluded\r
+ */\r
+ public boolean isLowercaseIncluded() {\r
+ return lowercaseIncluded;\r
+ }\r
+\r
+ /**\r
+ * Checks if is numbers included.\r
+ * \r
+ * @return numbersIncluded\r
+ */\r
+ public boolean isNumbersIncluded() {\r
+ return numbersIncluded;\r
+ }\r
+\r
+ /**\r
+ * Checks if is others included.\r
+ * \r
+ * @return othersIncluded\r
+ */\r
+ public boolean isOthersIncluded() {\r
+ return othersIncluded;\r
+ }\r
+\r
+ /**\r
+ * Checks if is uppercase included.\r
+ * \r
+ * @return uppercaseIncluded\r
+ */\r
+ public boolean isUppercaseIncluded() {\r
+ return uppercaseIncluded;\r
+ }\r
+\r
+ /**\r
+ * Sets the length.\r
+ * \r
+ * @param length , enforced to be a positive integer >= 3.\r
+ */\r
+ public void setLength(int length) {\r
+ this.length = (length < 3) ? 3 : length;\r
+ }\r
+\r
+ /**\r
+ * Sets the lowercase included.\r
+ * \r
+ * @param b the b\r
+ * \r
+ * @throws InvalidPreferencesFormatException the invalid preferences format exception\r
+ */\r
+ public void setLowercaseIncluded(boolean b)\r
+ throws InvalidPreferencesFormatException {\r
+ lowercaseIncluded = b;\r
+\r
+ // did we turn off the last flag? if so\r
+ // turn it back on and report error\r
+ if (b == false && !flagsOK()) {\r
+ lowercaseIncluded = true;\r
+ throw new InvalidPreferencesFormatException(\r
+ "At least one flag must be on to generate a password");\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the numbers included.\r
+ * \r
+ * @param b the b\r
+ * \r
+ * @throws InvalidPreferencesFormatException the invalid preferences format exception\r
+ */\r
+ public void setNumbersIncluded(boolean b)\r
+ throws InvalidPreferencesFormatException {\r
+ numbersIncluded = b;\r
+\r
+ // did we turn off the last flag? if so\r
+ // turn it back on and report error\r
+ if (b == false && !flagsOK()) {\r
+ numbersIncluded = true;\r
+ throw new InvalidPreferencesFormatException(\r
+ "At least one flag must be on to generate a password");\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the others included.\r
+ * \r
+ * @param b the b\r
+ * \r
+ * @throws InvalidPreferencesFormatException the invalid preferences format exception\r
+ */\r
+ public void setOthersIncluded(boolean b)\r
+ throws InvalidPreferencesFormatException {\r
+ othersIncluded = b;\r
+\r
+ // did we turn off the last flag? if so\r
+ // turn it back on and report error\r
+ if (b == false && !flagsOK()) {\r
+ othersIncluded = true;\r
+ throw new InvalidPreferencesFormatException(\r
+ "At least one flag must be on to generate a password");\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the template.\r
+ * \r
+ * @param template the template\r
+ * \r
+ * @throws ParseException the parse exception\r
+ */\r
+ public void setTemplate(String template) throws ParseException {\r
+ // make sure the template contains only legal characters\r
+ for (int i = 0; i < template.length(); i++) {\r
+ switch (template.charAt(i)) {\r
+ case 'a':\r
+ case 'A':\r
+ case 'n':\r
+ case 'N':\r
+ case 'o':\r
+ case 'O':\r
+ break;\r
+\r
+ default:\r
+ throw new ParseException(\r
+ "Password template contains an invalid character", i);\r
+ }\r
+ }\r
+ this.template = template;\r
+ }\r
+\r
+ /**\r
+ * Clears the password template,making generation rely on the flags.\r
+ */\r
+ public void clearTemplate() {\r
+ template = "";\r
+ }\r
+\r
+ /**\r
+ * Sets the uppercase included.\r
+ * \r
+ * @param b the b\r
+ * \r
+ * @throws InvalidPreferencesFormatException the invalid preferences format exception\r
+ */\r
+ public void setUppercaseIncluded(boolean b)\r
+ throws InvalidPreferencesFormatException {\r
+ uppercaseIncluded = b;\r
+\r
+ // did we turn off the last flag? if so\r
+ // turn it back on and report error\r
+ if (b == false && !flagsOK()) {\r
+ uppercaseIncluded = true;\r
+ throw new InvalidPreferencesFormatException(\r
+ "At least one flag must be on to generate a password");\r
+ }\r
+ }\r
+\r
+ /*--------------------------------------------------------\r
+ Wrapper classes and interface to mimic the array of \r
+ function references functionality required.\r
+ ----------------------------------------------------------*/\r
+ /**\r
+ * The Class randomLowercase.\r
+ */\r
+ private static class randomLowercase implements randomCharacter {\r
+ \r
+ /* (non-Javadoc)\r
+ * @see com.pentila.sconet.util.PasswordGenerator.randomCharacter#execute()\r
+ */\r
+ public char execute() {\r
+ return PasswordGenerator.randomLowercase();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * The Class randomUppercase.\r
+ */\r
+ private static class randomUppercase implements randomCharacter {\r
+ \r
+ /* (non-Javadoc)\r
+ * @see com.pentila.sconet.util.PasswordGenerator.randomCharacter#execute()\r
+ */\r
+ public char execute() {\r
+ return PasswordGenerator.randomUppercase();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * The Class randomOther.\r
+ */\r
+ private static class randomOther implements randomCharacter {\r
+ \r
+ /* (non-Javadoc)\r
+ * @see com.pentila.sconet.util.PasswordGenerator.randomCharacter#execute()\r
+ */\r
+ public char execute() {\r
+ return PasswordGenerator.randomOther();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * The Class randomNumber.\r
+ */\r
+ private static class randomNumber implements randomCharacter {\r
+ \r
+ /* (non-Javadoc)\r
+ * @see com.pentila.sconet.util.PasswordGenerator.randomCharacter#execute()\r
+ */\r
+ public char execute() {\r
+ return PasswordGenerator.randomNumber();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * The Interface randomCharacter.\r
+ */\r
+ private static interface randomCharacter {\r
+ \r
+ /**\r
+ * Execute.\r
+ * \r
+ * @return the char\r
+ */\r
+ char execute();\r
+ }\r
+\r
+}\r
--- /dev/null
+package com.pentila.sconet.util;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import com.pentila.sconet.model.log.Event;
+import com.pentila.sconet.model.log.Operation;
+import com.pentila.sconet.model.xml.AddRequest;
+import com.pentila.sconet.model.xml.Attr;
+import com.pentila.sconet.model.xml.Attributes;
+import com.pentila.sconet.model.xml.Modif;
+import com.pentila.sconet.model.xml.ModifyRequest;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Utils.
+ */
+public class Utils {
+
+ /**
+ * Gets the string values.
+ *
+ * @param a the a
+ *
+ * @return the string values
+ */
+ public static Set<String> getStringValues(Attribute a) {
+
+ Set<String> res = new HashSet<String>();
+ NamingEnumeration<?> m;
+ try {
+ m = a.getAll();
+
+ while (m.hasMore()) {
+ String jj = (String) m.next();
+
+ res.add(jj);
+
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+
+ return res;
+
+ }
+
+ public static Set<String> getStringValues(javax.naming.directory.Attributes a, String attrID) {
+
+
+ Set<String> s = getStringValues(a.get(attrID));
+ if (s == null){
+ s= new HashSet<String>();
+ }
+ return s;
+
+
+ }
+
+
+ /**
+ * Fix dn.
+ *
+ * @param dn the dn
+ *
+ * @return the string
+ */
+ public static String fixDN(String dn) {
+ return dn.replace(",", "");
+ }
+
+ /**
+ * Convert modify to add.
+ *
+ * @param mr the mr
+ *
+ * @return the adds the request
+ */
+ public static AddRequest convertModifyToAdd(ModifyRequest mr) {
+
+ AddRequest ar = new AddRequest();
+
+ ar.setIdentifier(mr.getIdentifier());
+
+ ar.setOperationalAttributes(mr.getOperationalAttributes());
+
+ ar.setAttributes(new Attributes());
+
+ for (Modif m : mr.getRawModifications()) {
+ Attr a = new Attr();
+ a.setName(m.getName());
+ a.setValue(m.getValue());
+ ar.getRawAttributes().add(a);
+ }
+
+ return ar;
+ }
+
+ /**
+ * Convert add to modify.
+ *
+ * @param mr the mr
+ *
+ * @return the adds the request
+ */
+ public static ModifyRequest convertAddToModify(AddRequest ar) {
+
+ ModifyRequest mr = new ModifyRequest();
+
+ mr.setIdentifier(ar.getIdentifier());
+
+ mr.setOperationalAttributes(ar.getOperationalAttributes());
+
+ //mr.setAttributes(new Attributes());
+
+
+
+ for (Attr a : ar.getRawAttributes()) {
+ Modif m = new Modif();
+ m.setName(a.getName());
+ m.setValue(a.getValue());
+ mr.getRawModifications().add(m);
+ }
+
+ return mr;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @param as the as
+ * @param attrId the attr id
+ *
+ * @return the value
+ */
+ public static String getValue(javax.naming.directory.Attributes as,
+ String attrId) {
+ try {
+
+ return (String) as.get(attrId).get();
+
+ /*
+ * BasicAttribute ba = (BasicAttribute)as.get(attrId).get();
+ * System.out.println(ba.get().getClass().getName()); return
+ * (String)ba.get();
+ */
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ //e.printStackTrace();
+ }
+
+ return "";
+ }
+
+ /**
+ * Builds the event.
+ *
+ * @param attrs the attrs
+ *
+ * @return the event
+ */
+ public static Event buildEvent(javax.naming.directory.Attributes attrs) {
+
+ Event e = new Event();
+ String ne = "";
+ String net = "";
+
+ boolean alreadySet = false;
+
+ // Try for ENTPerson
+ try {
+ try {
+ ne = getValue(attrs, "ENTPersonStructRattach");
+ ne = convertDNToJointure(ne);
+ } catch (Exception exc) {
+ ne = "0";
+ }
+ net = Utils.getValue(attrs, "ENTPersonJointure");
+ if (!net.equals("")) {
+ alreadySet = true;
+ }
+ } catch (Exception exc) {
+ ne = "0";
+ net = "0";
+ }
+
+ if (!alreadySet) {
+
+ // Try for Etablissement
+
+ try {
+ try {
+ ne = getValue(attrs, "ENTStructureJointure");
+ ne = convertDNToJointure(ne);
+ } catch (Exception exc) {
+
+ }
+
+ net = ne;
+ if (!ne.equals("")) {
+ alreadySet = true;
+ }
+ } catch (Exception ee) {
+
+ }
+ }
+
+ // group !!!
+ if (!alreadySet) {
+ try {
+ String name = getValue(attrs, "cn");
+
+ ne = name.split("\\$")[0];
+ net = "0";
+ } catch (Exception ee) {
+
+ }
+ }
+
+ if (ne.equals("")) {
+ ne = "0";
+ }
+
+ if (net.equals("")) {
+ net = "0";
+ }
+ Long numEtab = new Long(ne);
+ Long numEntity = new Long(net);
+
+ e.setNumEtab(numEtab);
+ e.setNumEntity(numEntity);
+
+ return e;
+
+ }
+
+ /**
+ * Builds the operation.
+ *
+ * @param attrs the attrs
+ *
+ * @return the operation
+ */
+ public static Operation buildOperation(
+ javax.naming.directory.Attributes attrs) {
+ // TODO Auto-generated method stub
+
+ Operation o = new Operation();
+ String ne = "";
+ String net = "";
+ String name = "";
+ String prenom ="";
+ String division ="";
+ String fonctions = "";
+ String description = "";
+ String password = "";
+ String login = "";
+ String mail = "";
+
+
+ int typeEntity = 0;
+
+ boolean alreadySet = false;
+
+ // Try for ENTPerson
+ try {
+ try {
+ ne = getValue(attrs, "ENTPersonStructRattach");
+ ne = convertDNToJointure(ne);
+ } catch (Exception e) {
+ ne = "0";
+ }
+
+ net = Utils.getValue(attrs, "ENTPersonJointure");
+
+ if (!net.equals("")) {
+ name = getValue(attrs, "sn");
+ prenom = getValue(attrs, "givenName");
+ //typeEntity = Operation.PERSON;
+ fonctions = getValue(attrs, "ENTPersonFonctions");
+
+ login = Utils.getValue(attrs, "ENTPersonLogin");
+
+ mail = Utils.getValue(attrs, "mail");
+
+
+ o.setLogin(login);
+ o.setPassword(password);
+ o.setMail(mail);
+ o.setFonctions(fonctions);
+
+ description = String.format(
+ "LOGIN : %s, PASSWORD : %s, MAIL : %s",
+ login, password, mail);
+
+
+ alreadySet = true;
+ }
+
+ } catch (Exception exc) {
+ exc.printStackTrace();
+ ne = "0";
+ net = "0";
+ }
+
+ if (!alreadySet) {
+
+ // Try for Etablissement
+
+ try {
+ try {
+ ne = getValue(attrs, "ENTStructureJointure");
+ ne = convertDNToJointure(ne);
+ } catch (Exception e) {
+
+ }
+ if (!ne.equals("")) {
+ typeEntity = Operation.ETAB;
+ net = ne;
+ name = getValue(attrs, "ENTStructureNomCourant");
+ alreadySet = true;
+ }
+ } catch (Exception e) {
+
+ }
+ }
+
+ // group !!!
+ if (!alreadySet) {
+ try {
+ name = getValue(attrs, "cn");
+
+ ne = name.split("\\$")[0];
+ net = "0";
+
+ typeEntity = Operation.GROUP;
+
+ } catch (Exception e) {
+
+ }
+ }
+
+ if (ne.equals("")) {
+ ne = "0";
+ }
+
+ if (net.equals("")) {
+ net = "0";
+ }
+ Long numEtab = new Long(ne);
+ Long numEntity = new Long(net);
+
+ o.setName(name);
+ o.setPrenom(prenom);
+ o.setLogin(login);
+ o.setPassword(password);
+ o.setFonctions(fonctions);
+ o.setDivision(division);
+ o.setNumEtab(numEtab);
+ o.setNumEntity(numEntity);
+ o.setTypeEntity(typeEntity);
+
+ return o;
+
+ }
+
+ /**
+ * Quote string.
+ *
+ * @param s the s
+ *
+ * @return the string
+ */
+ public static String quoteString(final String s) {
+
+ String res = "";
+
+ final char[] chars = s.toCharArray();
+ for (int x = 0; x < chars.length; x++) {
+ final char c = chars[x];
+ if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) {
+ res = res + c;
+ }
+ }
+ return res;
+ }
+
+ /**
+ * Convert dn to jointure.
+ *
+ * @param dn the dn
+ *
+ * @return the string
+ */
+ public static String convertDNToJointure(String dn) {
+
+ String jointure = "";
+
+ if (dn != null && !dn.equals("")){
+
+ String[] s1 = dn.split(",");
+ if (s1.length > 0){
+ String[] s2 = s1[0].split("=");
+ if (s2.length > 0){
+ jointure = s2[1];
+ }
+ }
+
+
+ }
+ return jointure;
+ }
+
+ /**
+ * Gets the date from filename.
+ *
+ * @param filename the filename
+ *
+ * @return the date from filename
+ */
+ public static Date getDateFromFilename(String filename) {
+ SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");
+ String[] array = filename.split("_");
+
+ for (String item : array) {
+
+ try {
+ Date d = f.parse(item);
+ return d;
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ public static int computeExpirationTime(int expirationPeriod) {
+
+ Date now = new Date();
+
+ Long t = now.getTime() / 86400000;
+
+ return t.intValue() + expirationPeriod;
+
+ }
+
+}
--- /dev/null
+sconet.filesLocation=/files ##location where sconet files are stored to being processed\r
+sconet.filesArchiveLocation=/archives ##location where sconet files are stored after process\r
+ldap.server.port=389\r
+ldap.server.ip=168.0.0.1 ##LDAP server IP\r
+ldap.branch.suffix=dc\=organization,dc\=com #LDAP base dn\r
+ldap.branch.groups=ou\=groups\r
+ldap.branch.etabs=ou\=etablissements\r
+ldap.branch.people=ou\=people\r
+ldap.managerDN=cn\=admin,dc\=organization,dc\=com\r
+ldap.managerPWD=password\r
+ldap.schema.person=person,inetOrgPerson,ENTPerson,ENTEleve,ENTAuxPersRelEleve,ENTAuxEnseignant,ENTAuxNonEnsServAc,ENTAuxNonEnsCollLoc,ENTAuxNonEnsEtab,ENTAuxPersExt,ENTAuxTuteurStage,ENTAuxRespEntrp\r
+ldap.schema.structure=organizationalUnit,ENTStructure,ENTEtablissement,ENTCollLoc,ENTEntreprise\r
+ldap.schema.groups=groupOfNames,ENTClasse,ENTGroupe,ENTGroupementEtabs,ENTProfil,ENTRoleAppli,ENTRelEleve\r
+ldap.groupmembername=portal_members\r
+ldap.reportaccessgroup=groupAccessReport\r
+\r
+# DataBase URL\r
+dburl=jdbc:mysql://localhost:3306/entlog ##MySQL DB address for reporting\r
+dbuser=user\r
+dbpassword=password\r
+hbm2ddl=update\r
+dbdriver=com.mysql.jdbc.Driver\r
+dbdialect=org.hibernate.dialect.MySQLDialect\r
+\r
+# Hibernate C3P0 configuration against Mysql server\r
+hibernate.c3p0.initialPoolSize=10\r
+hibernate.c3p0.minPoolSize=1\r
+hibernate.c3p0.maxPoolSize=25\r
+hibernate.c3p0.acquireRetryAttempts=10\r
+hibernate.c3p0.acquireIncrement=5\r
+hibernate.c3p0.idleConnectionTestPeriod=3600\r
+hibernate.c3p0.preferredTestQuery=SELECT 1;\r
+hibernate.c3p0.testConnectionOnCheckin=false\r
+hibernate.c3p0.maxConnectionAge=14400\r
+hibernate.c3p0.maxIdleTime=10800\r
+app.expirationPeriod=92\r
+\r
+# permet de differencier la gestion des fichiers Savoie ou Rouen --> copy or move\r
+# si true --> move alors on deplace les fichiers traité apres process\r
+# si false --> copy; on laisse une copie dans le repertoire a traiter et on compare avec les archives\r
+files.archive.move=true\r
--- /dev/null
+###############################################################################
+#
+# Copyright (c) 2008 Savoie Technolac, PENTILA SAS.
+#
+# Ce logiciel est diffuse sous les termes et conditions de la licence CECILL.
+# Voir le fichier joint Licence_CeCILL_V2-fr.txt pour plus de details.
+#
+###############################################################################
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+log4j.rootLogger=info, stdout
+#log4j.logger.org.hibernate=info
+#log4j.logger.org.hibernate=debug
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+### log just the SQL
+log4j.logger.org.hibernate.SQL=fatal
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=fatal
+### log schema export/update ###
+#log4j.logger.org.hibernate.tool.hbm2ddl=info
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=info
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
+log4j.logger.org.springframework=fatal
+
+log4j.logger.com.pentila=debug
\ No newline at end of file
--- /dev/null
+currentPath=`dirname "$0"`
+cd $currentPath
+
+java -Xmx1024M -jar sconetldap.jar
\ No newline at end of file
--- /dev/null
+currentPath=`dirname "$0"`
+cd $currentPath
+
+java -Xmx1024M -jar sconetldap.jar updatePWD
\ No newline at end of file