Skip to content

Commit

Permalink
Merge branch 'early-access' into early-access-GoogleCloudPlatform#537
Browse files Browse the repository at this point in the history
  • Loading branch information
naveenr-btc authored Jun 23, 2020
2 parents 7c2294b + 1fb355e commit 5d95db1
Show file tree
Hide file tree
Showing 58 changed files with 35,169 additions and 29,449 deletions.
11 changes: 10 additions & 1 deletion Android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE resources [<!ENTITY app_name "App Name">]>
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE resources [<!ENTITY app_name "App Name"><!ENTITY learn_more_txt "Learn more">]>
<resources>
<!--Shared Preference-->
<string name="auth">authentication</string>
Expand Down Expand Up @@ -532,6 +532,15 @@
<string name="pdf_consent_error">Error in processing consent</string>
<string name="delete_account_msg">This will also delete your app account.</string>
<string name="activity_loading_msg">Please wait as we set up the study for you, this may take a few seconds</string>
<string name="rsb_consent_section_more_info_welcome">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_data_gathering">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_privacy">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_data_use">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_time_commitment">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_study_survey">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_study_tasks">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info_withdrawing">&learn_more_txt;</string>
<string name="rsb_consent_section_more_info">&learn_more_txt;</string>

<string name="app_name">&app_name;</string>
<string name="poweredby">Powered by FDA MyStudies on Google Cloud</string>
Expand Down
110 changes: 57 additions & 53 deletions WCP/fdahpStudyDesigner/src/main/webapp/WEB-INF/ApplicationContext.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
Expand All @@ -12,54 +14,56 @@
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd">

<task:annotation-driven />
<bean id="myAppScheduleJobs" class="com.fdahpstudydesigner.scheduler.FDASchedulerService" />

<bean id="restTemplate"
class="org.springframework.web.client.RestTemplate">
</bean>
<task:annotation-driven/>
<bean id="myAppScheduleJobs"
class="com.fdahpstudydesigner.scheduler.FDASchedulerService"/>

<context:component-scan base-package="com.fdahpstudydesigner" />
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messageResource</value>
</property>
</bean>
<!-- <util:properties id="propertyConfigurer"
location="#{contextParameters.property_file_location_config}" /> -->
<util:properties id="propertyConfigurer" location="classpath:application_local.properties"
/>
<!-- <context:property-placeholder
properties-ref="propertyConfigurer" /> -->
<context:property-placeholder location="classpath:application_local.properties"
/>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://${db.url}" />
<property name="username" value="${db.username}" />
<property name="password" value="${db.password}" />
</bean>
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="com.fdahpstudydesigner.bo" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="hibernate.c3p0.idle_test_period">60</prop>
<prop key="hibernate.c3p0.acquire_increment">2</prop>
</props>
</property>
</bean>
<bean id="loginService" class="com.fdahpstudydesigner.service.LoginServiceImpl">
</bean>
<bean id="restTemplate"
class="org.springframework.web.client.RestTemplate">
</bean>

<context:component-scan
base-package="com.fdahpstudydesigner"/>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messageResource</value>
</property>
</bean>
<util:properties id="propertyConfigurer"
location="classpath:application_local.properties"/>
<context:property-placeholder
location="classpath:application_local.properties"/>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://${db.url}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
</bean>
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan"
value="com.fdahpstudydesigner.bo"/>
<property name="hibernateProperties">
<props>

<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="hibernate.c3p0.idle_test_period">60</prop>
<prop key="hibernate.c3p0.acquire_increment">2</prop>
</props>
</property>
</bean>
<bean id="loginService"
class="com.fdahpstudydesigner.service.LoginServiceImpl">
</bean>
</beans>
96 changes: 48 additions & 48 deletions WCP/fdahpStudyDesigner/src/main/webapp/WEB-INF/spring-security.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
xmlns:beans="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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">

<!-- enable use-expressions -->
<http auto-config="true" pattern="/index.jsp" security="none"
disable-url-rewriting="true" />
<!-- enable use-expressions -->
<http auto-config="true" pattern="/index.jsp" security="none"
disable-url-rewriting="true"/>

<http auto-config="true" use-expressions="true"
disable-url-rewriting="true">
<http auto-config="true" use-expressions="true"
disable-url-rewriting="true">

<intercept-url pattern="/adminStudies/**"
access="hasAnyRole('ROLE_MANAGE_STUDIES','ROLE_CREATE_MANAGE_STUDIES','ROLE_SUPERADMIN')" />
<intercept-url pattern="/adminNotificationView/**"
access="hasAnyRole('ROLE_MANAGE_APP_WIDE_NOTIFICATION_VIEW','ROLE_SUPERADMIN')" />
<intercept-url pattern="/adminNotificationEdit/**"
access="hasAnyRole('ROLE_MANAGE_APP_WIDE_NOTIFICATION_EDIT','ROLE_SUPERADMIN')" />
<intercept-url pattern="/adminUsersView/**"
access="hasAnyRole('ROLE_MANAGE_USERS_VIEW','ROLE_SUPERADMIN')" />
<intercept-url pattern="/adminUsersEdit/**"
access="hasAnyRole('ROLE_MANAGE_USERS_EDIT','ROLE_SUPERADMIN')" />
<intercept-url pattern="/adminDashboard/**" access="permitAll" />
<intercept-url pattern="/adminStudies/**"
access="hasAnyRole('ROLE_MANAGE_STUDIES','ROLE_CREATE_MANAGE_STUDIES','ROLE_SUPERADMIN')"/>
<intercept-url pattern="/adminNotificationView/**"
access="hasAnyRole('ROLE_MANAGE_APP_WIDE_NOTIFICATION_VIEW','ROLE_SUPERADMIN')"/>
<intercept-url pattern="/adminNotificationEdit/**"
access="hasAnyRole('ROLE_MANAGE_APP_WIDE_NOTIFICATION_EDIT','ROLE_SUPERADMIN')"/>
<intercept-url pattern="/adminUsersView/**"
access="hasAnyRole('ROLE_MANAGE_USERS_VIEW','ROLE_SUPERADMIN')"/>
<intercept-url pattern="/adminUsersEdit/**"
access="hasAnyRole('ROLE_MANAGE_USERS_EDIT','ROLE_SUPERADMIN')"/>
<intercept-url pattern="/adminDashboard/**" access="permitAll"/>

<!-- access denied page -->
<access-denied-handler error-page="/unauthorized.do" />
<form-login login-page="/login.do"
authentication-success-handler-ref="customSuccessHandler"
authentication-failure-url="/errorRedirect.do?error=Y"
username-parameter="username" password-parameter="password" />
<logout logout-success-url="/" invalidate-session="false"
delete-cookies="JSESSIONID" logout-url="/sessionOut.do" />
<session-management invalid-session-url="/errorRedirect.do?error=timeout">
<concurrency-control max-sessions="1"
error-if-maximum-exceeded="false" expired-url="/errorRedirect.do?error=multiUser" />
</session-management>
<!-- enable csrf protection -->
<csrf />
</http>
<beans:bean id="authenticationProvider"
class="com.fdahpstudydesigner.util.LimitLoginAuthenticationProvider">
<beans:property name="userDetailsService" ref="loginService" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<beans:bean
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"
id="passwordEncoder" />
<authentication-manager>
<authentication-provider ref="authenticationProvider">
<!-- <password-encoder hash="bcrypt" /> -->
</authentication-provider>
</authentication-manager>
<beans:bean id="customSuccessHandler"
class="com.fdahpstudydesigner.util.CustomSuccessHandler" />
<!-- access denied page -->
<access-denied-handler error-page="/unauthorized.do"/>
<form-login login-page="/login.do"
authentication-success-handler-ref="customSuccessHandler"
authentication-failure-url="/errorRedirect.do?error=Y"
username-parameter="username" password-parameter="password"/>
<logout logout-success-url="/" invalidate-session="false"
delete-cookies="JSESSIONID" logout-url="/sessionOut.do"/>
<session-management invalid-session-url="/errorRedirect.do?error=timeout">
<concurrency-control max-sessions="1"
error-if-maximum-exceeded="false" expired-url="/errorRedirect.do?error=multiUser"/>
</session-management>
<!-- enable csrf protection -->
<csrf/>
</http>
<beans:bean id="authenticationProvider"
class="com.fdahpstudydesigner.util.LimitLoginAuthenticationProvider">
<beans:property name="userDetailsService" ref="loginService"/>
<beans:property name="passwordEncoder" ref="passwordEncoder"/>
</beans:bean>
<beans:bean
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"
id="passwordEncoder"/>
<authentication-manager>
<authentication-provider ref="authenticationProvider">
</authentication-provider>
</authentication-manager>
<beans:bean id="customSuccessHandler"
class="com.fdahpstudydesigner.util.CustomSuccessHandler"/>
</beans:beans>
81 changes: 42 additions & 39 deletions WCP/fdahpStudyDesigner/src/main/webapp/WEB-INF/spring-servlet.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<context:component-scan base-package="com.fdahpstudydesigner" />
<context:component-scan base-package="com.fdahpstudydesigner"/>

<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<bean
class="com.fdahpstudydesigner.util.FdahpStudyDesignerPreHandlerInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean
class="com.fdahpstudydesigner.util.FdahpStudyDesignerPreHandlerInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>

<!-- Configure the multipart resolver -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize" value="10000000" />
<property name="defaultEncoding" value="utf-8" />
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles2.TilesView
</value>
</property>
</bean>
<!-- Configure the multipart resolver -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize" value="10000000"/>
<property name="defaultEncoding" value="utf-8"/>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles2.TilesView
</value>
</property>
</bean>

<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles-defs.xml</value>
</list>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles-defs.xml</value>
</list>
</property>
</bean>

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="resources/messageResource" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="resources/messageResource"/>
</bean>

</beans>
Loading

0 comments on commit 5d95db1

Please sign in to comment.