Skip to content

Commit 0241cc9

Browse files
authored
Merge pull request #185 from devgateway/develop
develop into master , 0.8.0
2 parents e553239 + 5d60207 commit 0241cc9

251 files changed

Lines changed: 7596 additions & 7214 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ cache:
88
- ui/node
99
env:
1010
global:
11-
- MAVEN_OPTS="-XX:MaxMetaspaceSize=256m -Xmx4g"
12-
- JAVA_OPTS="-XX:MaxMetaspaceSize=256m -Xmx4g"
11+
- MAVEN_OPTS="-XX:MaxMetaspaceSize=256m -Xmx4g -Xverify:none -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -DdependencyLocationsEnabled=false"
12+
- JAVA_OPTS="-XX:MaxMetaspaceSize=256m -Xmx4g -Xverify:none -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
1313
install: mvn install -T 64C -Dskip.frontend.build=true -DskipTests=true -Dmaven.javadoc.skip=true -B -V
1414
script: mvn test -T 64C -Dskip.frontend.build=true -B --quiet
1515
jdk:

checkstyle-suppressions.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE suppressions PUBLIC
3-
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
4-
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
3+
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
4+
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
55

66
<suppressions>
77

8-
<suppress checks="HideUtilityClassConstructor|FinalClass"
9-
files="PersistenceApplication\.java|MongoPersistenceApplication\.java|UIWebApplication\.java|WebApplication\.java|ReportingApplication\.java" />
8+
<suppress checks="HideUtilityClassConstructor|FinalClass"
9+
files="PersistenceApplication\.java|MongoPersistenceApplication\.java|UIWebApplication\.java|WebApplication\.java|ReportingApplication\.java" />
1010

11+
<suppress checks="[a-zA-Z0-9]*" files="[\\/]ui[\\/]" />
1112
</suppressions>

checkstyle.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111
</module>
112112
<module name="Translation"/>
113113
<module name="FileTabCharacter">
114-
<property name="severity" value="ignore"/>
115-
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
114+
<property name="fileExtensions" value="java,xml,html,md"/>
116115
</module>
117116
<module name="RegexpSingleline">
118117
<property name="severity" value="ignore"/>

forms/src/main/java/org/devgateway/toolkit/forms/FormsSecurityConfig.java

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -30,71 +30,71 @@
3030
@Order(1) // this ensures the forms security comes first
3131
public class FormsSecurityConfig extends WebSecurityConfig {
3232

33-
/**
34-
* Remember me key for {@link TokenBasedRememberMeServices}
35-
*/
36-
private static final String UNIQUE_SECRET_REMEMBER_ME_KEY = "secret";
33+
/**
34+
* Remember me key for {@link TokenBasedRememberMeServices}
35+
*/
36+
private static final String UNIQUE_SECRET_REMEMBER_ME_KEY = "secret";
3737

38-
/**
39-
* We ensure the superclass configuration is being applied Take note the
40-
* {@link FormsSecurityConfig} extends {@link WebSecurityConfig} which has
41-
* configuration for the dg-toolkit/web module. We then apply ant matchers
42-
* and ignore security for css/js/images resources, and wicket mounted
43-
* resources
44-
*/
45-
@Override
46-
public void configure(final WebSecurity web) throws Exception {
47-
super.configure(web);
48-
web.ignoring().antMatchers("/ui/**",
49-
"/img/**", "/css*/**", "/js*/**", "/assets*/**", "/wicket/resource/**/*.js",
50-
"/wicket/resource/**/*.css", "/wicket/resource/**/*.png", "/wicket/resource/**/*.jpg",
51-
"/wicket/resource/**/*.gif", "/login/**", "/forgotPassword/**",
38+
/**
39+
* We ensure the superclass configuration is being applied Take note the
40+
* {@link FormsSecurityConfig} extends {@link WebSecurityConfig} which has
41+
* configuration for the dg-toolkit/web module. We then apply ant matchers
42+
* and ignore security for css/js/images resources, and wicket mounted
43+
* resources
44+
*/
45+
@Override
46+
public void configure(final WebSecurity web) throws Exception {
47+
super.configure(web);
48+
web.ignoring().antMatchers("/ui/**",
49+
"/img/**", "/css*/**", "/js*/**", "/assets*/**", "/wicket/resource/**/*.js",
50+
"/wicket/resource/**/*.css", "/wicket/resource/**/*.png", "/wicket/resource/**/*.jpg",
51+
"/wicket/resource/**/*.gif", "/login/**", "/forgotPassword/**",
5252
"/resources/**", "/resources/public/**");
53-
}
53+
}
5454

55-
/**
56-
* This bean defines the same key in the {@link RememberMeAuthenticationProvider}
57-
* @return
58-
*/
59-
@Bean
60-
public AuthenticationProvider rememberMeAuthenticationProvider() {
61-
return new RememberMeAuthenticationProvider(UNIQUE_SECRET_REMEMBER_ME_KEY);
62-
}
55+
/**
56+
* This bean defines the same key in the {@link RememberMeAuthenticationProvider}
57+
* @return
58+
*/
59+
@Bean
60+
public AuthenticationProvider rememberMeAuthenticationProvider() {
61+
return new RememberMeAuthenticationProvider(UNIQUE_SECRET_REMEMBER_ME_KEY);
62+
}
6363

64-
/**
65-
* This bean configures the {@link TokenBasedRememberMeServices} with
66-
* {@link CustomJPAUserDetailsService}
67-
*
68-
* @return
69-
*/
70-
@Bean
71-
public AbstractRememberMeServices rememberMeServices() {
72-
TokenBasedRememberMeServices rememberMeServices = new TokenBasedRememberMeServices(
73-
UNIQUE_SECRET_REMEMBER_ME_KEY, customJPAUserDetailsService);
74-
rememberMeServices.setAlwaysRemember(true);
75-
return rememberMeServices;
76-
}
64+
/**
65+
* This bean configures the {@link TokenBasedRememberMeServices} with
66+
* {@link CustomJPAUserDetailsService}
67+
*
68+
* @return
69+
*/
70+
@Bean
71+
public AbstractRememberMeServices rememberMeServices() {
72+
TokenBasedRememberMeServices rememberMeServices = new TokenBasedRememberMeServices(
73+
UNIQUE_SECRET_REMEMBER_ME_KEY, customJPAUserDetailsService);
74+
rememberMeServices.setAlwaysRemember(true);
75+
return rememberMeServices;
76+
}
7777

78-
@Override
79-
protected void configure(final HttpSecurity http) throws Exception {
80-
super.configure(http);
78+
@Override
79+
protected void configure(final HttpSecurity http) throws Exception {
80+
super.configure(http);
8181

82-
// we do not allow anyonymous token. When
83-
// enabled this basically means any guest
84-
// user will have an annoymous default role
85-
http.anonymous().disable().
86-
sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER).
87-
//we let Wicket create and manage sessions, so we disable
88-
//session creation by spring
89-
and().csrf().disable(); // csrf protection interferes with some wicket stuff
82+
// we do not allow anyonymous token. When
83+
// enabled this basically means any guest
84+
// user will have an annoymous default role
85+
http.anonymous().disable().
86+
sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER).
87+
//we let Wicket create and manage sessions, so we disable
88+
//session creation by spring
89+
and().csrf().disable(); // csrf protection interferes with some wicket stuff
9090

91-
// we enable http rememberMe cookie for autologin
92-
// http.rememberMe().key(UNIQUE_SECRET_REMEMBER_ME_KEY);
91+
// we enable http rememberMe cookie for autologin
92+
// http.rememberMe().key(UNIQUE_SECRET_REMEMBER_ME_KEY);
9393

94-
// resolved the error Refused to display * in a frame because it set
95-
// 'X-Frame-Options' to 'DENY'.
96-
http.headers().contentTypeOptions().and().xssProtection().and().cacheControl().and()
97-
.httpStrictTransportSecurity().and().frameOptions().sameOrigin();
94+
// resolved the error Refused to display * in a frame because it set
95+
// 'X-Frame-Options' to 'DENY'.
96+
http.headers().contentTypeOptions().and().xssProtection().and().cacheControl().and()
97+
.httpStrictTransportSecurity().and().frameOptions().sameOrigin();
9898

99-
}
99+
}
100100
}

forms/src/main/java/org/devgateway/toolkit/forms/WebConstants.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@
2121

2222
public final class WebConstants {
2323

24-
private WebConstants() {
24+
private WebConstants() {
2525

26-
}
26+
}
2727

28-
public static final int PAGE_SIZE = 10;
29-
public static final int SELECT_PAGE_SIZE = 25;
28+
public static final int PAGE_SIZE = 10;
29+
public static final int SELECT_PAGE_SIZE = 25;
3030

31-
public static final String PARAM_VIEW_MODE = "viewMode";
31+
public static final String PARAM_VIEW_MODE = "viewMode";
3232

33-
public static final String PARAM_ID = "id";
34-
public static final String PARAM_REVISION_ID = "revisionId";
35-
public static final String PARAM_ENTITY_CLASS = "class";
33+
public static final String PARAM_ID = "id";
34+
public static final String PARAM_REVISION_ID = "revisionId";
35+
public static final String PARAM_ENTITY_CLASS = "class";
3636

37-
public static final String LANGUAGE_PARAM = "lang";
37+
public static final String LANGUAGE_PARAM = "lang";
3838

39-
public static final class StringValidators {
40-
public static final StringValidator MAXIMUM_LENGTH_VALIDATOR_ONE_LINE_TEXT = StringValidator
41-
.maximumLength(DBConstants.MAX_DEFAULT_TEXT_LENGTH_ONE_LINE);
42-
public static final StringValidator MAXIMUM_LENGTH_VALIDATOR_ONE_LINE_TEXTAREA = StringValidator
43-
.maximumLength(DBConstants.MAX_DEFAULT_TEXT_AREA);
44-
}
39+
public static final class StringValidators {
40+
public static final StringValidator MAXIMUM_LENGTH_VALIDATOR_ONE_LINE_TEXT =
41+
StringValidator.maximumLength(DBConstants.MAX_DEFAULT_TEXT_LENGTH_ONE_LINE);
42+
public static final StringValidator MAXIMUM_LENGTH_VALIDATOR_ONE_LINE_TEXTAREA =
43+
StringValidator.maximumLength(DBConstants.MAX_DEFAULT_TEXT_AREA);
44+
}
4545

46-
// add more languages here. It is pointless to make this dynamic because the
47-
// wicket i18n is in .properties files so we need
48-
// to change the src code anyway.
49-
public static final List<Locale> AVAILABLE_LOCALES = Collections.unmodifiableList(Arrays.asList(new Locale("en")));
46+
// add more languages here. It is pointless to make this dynamic because the
47+
// wicket i18n is in .properties files so we need
48+
// to change the src code anyway.
49+
public static final List<Locale> AVAILABLE_LOCALES = Collections.unmodifiableList(Arrays.asList(new Locale("en")));
5050

5151
}

forms/src/main/java/org/devgateway/toolkit/forms/exceptions/NullEditPageClassException.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
*/
2121
public class NullEditPageClassException extends RuntimeException {
2222

23-
/**
24-
*
25-
*/
26-
private static final long serialVersionUID = 8455626306350234992L;
23+
/**
24+
*
25+
*/
26+
private static final long serialVersionUID = 8455626306350234992L;
2727

28-
/**
29-
*
30-
*/
31-
public NullEditPageClassException() {
32-
super("editPageClass is null! Please set the editPageClass in your constructor");
33-
}
28+
/**
29+
*
30+
*/
31+
public NullEditPageClassException() {
32+
super("editPageClass is null! Please set the editPageClass in your constructor");
33+
}
3434

3535
}

forms/src/main/java/org/devgateway/toolkit/forms/exceptions/NullJpaRepositoryException.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
*/
2121
public class NullJpaRepositoryException extends RuntimeException {
2222

23-
/**
24-
*
25-
*/
26-
private static final long serialVersionUID = -2779145093766288562L;
23+
/**
24+
*
25+
*/
26+
private static final long serialVersionUID = -2779145093766288562L;
2727

28-
/**
29-
*
30-
*/
31-
public NullJpaRepositoryException() {
32-
super("jpaRepository is null! Please set the jpaRepository in your constructor");
33-
}
28+
/**
29+
*
30+
*/
31+
public NullJpaRepositoryException() {
32+
super("jpaRepository is null! Please set the jpaRepository in your constructor");
33+
}
3434

3535
}

forms/src/main/java/org/devgateway/toolkit/forms/exceptions/NullListPageClassException.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
*/
2121
public class NullListPageClassException extends RuntimeException {
2222

23-
/**
24-
*
25-
*/
26-
private static final long serialVersionUID = 5451367480984681341L;
23+
/**
24+
*
25+
*/
26+
private static final long serialVersionUID = 5451367480984681341L;
2727

28-
/**
29-
*
30-
*/
31-
public NullListPageClassException() {
32-
super("listPageClass is null! Please set the listPageClass in your constructor");
33-
}
28+
/**
29+
*
30+
*/
31+
public NullListPageClassException() {
32+
super("listPageClass is null! Please set the listPageClass in your constructor");
33+
}
3434

3535
}

forms/src/main/java/org/devgateway/toolkit/forms/models/PersistableJpaRepositoryModel.java

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,53 +18,54 @@
1818

1919
import nl.dries.wicket.hibernate.dozer.DozerModel;
2020

21-
2221
/**
23-
* USE THIS ONLY FOR {@link SortableJpaRepositoryDataProvider}S
24-
* Use {@link DozerModel} for editing complex forms
22+
* USE THIS ONLY FOR {@link SortableJpaRepositoryDataProvider}S Use
23+
* {@link DozerModel} for editing complex forms
24+
*
2525
* @author mpostelnicu
2626
*
27-
* @param <T> the type of the entity to be accessed
27+
* @param <T>
28+
* the type of the entity to be accessed
2829
*/
2930
public class PersistableJpaRepositoryModel<T extends GenericPersistable> extends LoadableDetachableModel<T> {
30-
private static final long serialVersionUID = -3668189792112474025L;
31-
private Long id;
31+
private static final long serialVersionUID = -3668189792112474025L;
32+
private Long id;
3233
private JpaRepository<T, Long> jpaRepository;
33-
34+
3435
public PersistableJpaRepositoryModel(final Long id, final JpaRepository<T, Long> jpaRepository) {
3536
super();
3637
this.id = id;
3738
this.jpaRepository = jpaRepository;
3839
}
39-
40+
4041
public PersistableJpaRepositoryModel(final T t, final JpaRepository<T, Long> jpaRepository) {
4142
super(t);
4243
this.id = t.getId();
4344
this.jpaRepository = jpaRepository;
4445
}
4546

4647
@Override
47-
protected T load() {
48-
return jpaRepository.findOne(id);
48+
protected T load() {
49+
return jpaRepository.findOne(id);
50+
51+
}
4952

53+
@Override
54+
public int hashCode() {
55+
return Long.valueOf(id).hashCode();
56+
}
57+
58+
@SuppressWarnings("unchecked")
59+
@Override
60+
public boolean equals(final Object obj) {
61+
if (obj == this) {
62+
return true;
63+
} else if (obj == null) {
64+
return false;
65+
} else if (obj instanceof PersistableJpaRepositoryModel) {
66+
PersistableJpaRepositoryModel<T> other = (PersistableJpaRepositoryModel<T>) obj;
67+
return other.id == id;
68+
}
69+
return false;
5070
}
51-
52-
@Override
53-
public int hashCode() {
54-
return Long.valueOf(id).hashCode();
55-
}
56-
57-
@SuppressWarnings("unchecked")
58-
@Override
59-
public boolean equals(final Object obj) {
60-
if (obj == this) {
61-
return true;
62-
} else if (obj == null) {
63-
return false;
64-
} else if (obj instanceof PersistableJpaRepositoryModel) {
65-
PersistableJpaRepositoryModel<T> other = (PersistableJpaRepositoryModel<T>) obj;
66-
return other.id == id;
67-
}
68-
return false;
69-
}
7071
}

0 commit comments

Comments
 (0)