Skip to content

Commit 0d16047

Browse files
Merge pull request #223 from phasenraum2010/milestone-1.0.20
Milestone 1.0.20
2 parents f90753e + b0f8dca commit 0d16047

File tree

153 files changed

+3225
-2126
lines changed

Some content is hidden

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

153 files changed

+3225
-2126
lines changed

pom.xml

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,42 @@
184184

185185
<build>
186186
<plugins>
187+
188+
<plugin>
189+
<groupId>org.apache.maven.plugins</groupId>
190+
<artifactId>maven-compiler-plugin</artifactId>
191+
<configuration>
192+
<source>${java.version}</source>
193+
<target>${java.version}</target>
194+
<encoding>${project.build.sourceEncoding}</encoding>
195+
</configuration>
196+
</plugin>
197+
198+
<plugin>
199+
<groupId>org.apache.maven.plugins</groupId>
200+
<artifactId>maven-source-plugin</artifactId>
201+
</plugin>
202+
203+
<plugin>
204+
<groupId>org.apache.maven.plugins</groupId>
205+
<artifactId>maven-javadoc-plugin</artifactId>
206+
<version>2.10.4</version>
207+
<configuration>
208+
<!--
209+
<linksource>true</linksource>
210+
-->
211+
<maxmemory>2048m</maxmemory>
212+
<source>1.8</source>
213+
<encoding>${project.build.sourceEncoding}</encoding>
214+
<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
215+
</configuration>
216+
</plugin>
217+
218+
<plugin>
219+
<groupId>org.apache.maven.plugins</groupId>
220+
<artifactId>maven-dependency-plugin</artifactId>
221+
</plugin>
222+
187223
<plugin>
188224
<groupId>org.springframework.boot</groupId>
189225
<artifactId>spring-boot-maven-plugin</artifactId>
@@ -298,7 +334,6 @@
298334
<plugin>
299335
<groupId>org.apache.maven.plugins</groupId>
300336
<artifactId>maven-release-plugin</artifactId>
301-
<!-- <version>2.5.3</version> -->
302337
<configuration>
303338
<preparationGoals>clean</preparationGoals>
304339
<autoVersionSubmodules>true</autoVersionSubmodules>
@@ -309,7 +344,6 @@
309344
<plugin>
310345
<groupId>org.apache.maven.plugins</groupId>
311346
<artifactId>maven-site-plugin</artifactId>
312-
<!-- <version>3.6</version> -->
313347
<inherited>true</inherited>
314348
<configuration>
315349
<locales>en</locales>
@@ -332,26 +366,19 @@
332366
</dependency>
333367
</dependencies>
334368
</plugin>
335-
<plugin>
336-
<groupId>org.apache.maven.plugins</groupId>
337-
<artifactId>maven-dependency-plugin</artifactId>
338-
<!-- <version>3.0.1</version> -->
339-
</plugin>
369+
340370
<plugin>
341371
<groupId>org.apache.maven.plugins</groupId>
342372
<artifactId>maven-changelog-plugin</artifactId>
343373
<version>2.3</version>
344374
</plugin>
375+
345376
<plugin>
346377
<groupId>org.codehaus.mojo</groupId>
347378
<artifactId>cobertura-maven-plugin</artifactId>
348379
<version>2.7</version>
349380
</plugin>
350-
<plugin>
351-
<groupId>org.apache.maven.plugins</groupId>
352-
<artifactId>maven-source-plugin</artifactId>
353-
<!-- <version>3.0.1</version> -->
354-
</plugin>
381+
355382
</plugins>
356383
</build>
357384

@@ -363,36 +390,33 @@
363390
</activation>
364391
<build>
365392
<plugins>
366-
<plugin>
367-
<groupId>org.apache.maven.plugins</groupId>
368-
<artifactId>maven-dependency-plugin</artifactId>
369-
<!-- <version>2.10</version> -->
370-
</plugin>
393+
371394
<plugin>
372395
<groupId>org.apache.maven.plugins</groupId>
373396
<artifactId>maven-surefire-plugin</artifactId>
374-
<!-- <version>2.16</version> -->
375397
<configuration>
376398
<skipTests>true</skipTests>
377399
</configuration>
378400
</plugin>
401+
379402
</plugins>
380403
</build>
381404
</profile>
382405
<profile>
383406
<id>testing</id>
384407
<build>
385408
<plugins>
386-
<plugin>
387-
<groupId>org.apache.maven.plugins</groupId>
388-
<artifactId>maven-dependency-plugin</artifactId>
389-
<!-- <version>2.10</version> -->
390-
</plugin>
409+
391410
<plugin>
392411
<groupId>org.apache.maven.plugins</groupId>
393412
<artifactId>maven-surefire-plugin</artifactId>
394-
<!-- <version>2.16</version> -->
413+
<configuration>
414+
<systemPropertyVariables>
415+
<spring.profiles.active>testing</spring.profiles.active>
416+
</systemPropertyVariables>
417+
</configuration>
395418
</plugin>
419+
396420
</plugins>
397421
</build>
398422
</profile>
@@ -412,41 +436,12 @@
412436
</configuration>
413437
</plugin>
414438

415-
<plugin>
416-
<groupId>org.apache.maven.plugins</groupId>
417-
<artifactId>maven-compiler-plugin</artifactId>
418-
<!-- <version>2.5.1</version> -->
419-
<configuration>
420-
<source>${java.version}</source>
421-
<target>${java.version}</target>
422-
<encoding>${project.build.sourceEncoding}</encoding>
423-
</configuration>
424-
</plugin>
425-
426-
<plugin>
427-
<groupId>org.apache.maven.plugins</groupId>
428-
<artifactId>maven-javadoc-plugin</artifactId>
429-
<configuration>
430-
<!--
431-
<linksource>true</linksource>
432-
-->
433-
<maxmemory>2048m</maxmemory>
434-
<source>1.8</source>
435-
<encoding>${project.build.sourceEncoding}</encoding>
436-
<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
437-
</configuration>
438-
</plugin>
439-
440-
<plugin>
441-
<groupId>org.apache.maven.plugins</groupId>
442-
<artifactId>maven-surefire-plugin</artifactId>
443-
<!-- <version>2.2</version> -->
444-
</plugin>
445439
<plugin>
446440
<groupId>org.apache.maven.plugins</groupId>
447441
<artifactId>maven-surefire-report-plugin</artifactId>
448442
<version>2.20</version>
449443
</plugin>
444+
450445
<plugin>
451446
<groupId>org.apache.maven.plugins</groupId>
452447
<artifactId>maven-checkstyle-plugin</artifactId>

src/main/java/org/woehlke/twitterwall/Application.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
import org.springframework.context.annotation.ImportResource;
88
import org.springframework.data.web.config.EnableSpringDataWebSupport;
99
import org.springframework.scheduling.annotation.EnableScheduling;
10-
import org.woehlke.twitterwall.conf.properties.TwitterProperties;
11-
import org.woehlke.twitterwall.conf.properties.BackendProperties;
12-
import org.woehlke.twitterwall.conf.properties.FrontendProperties;
13-
import org.woehlke.twitterwall.conf.properties.SchedulerProperties;
10+
import org.woehlke.twitterwall.conf.properties.*;
1411

1512

1613
/**
@@ -22,7 +19,8 @@
2219
BackendProperties.class,
2320
FrontendProperties.class,
2421
SchedulerProperties.class,
25-
TwitterProperties.class
22+
TwitterProperties.class,
23+
TestdataProperties.class
2624
})
2725
@EnableSpringDataWebSupport
2826
@ImportResource("classpath:integration.xml")

src/main/java/org/woehlke/twitterwall/ScheduledTasks.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.slf4j.LoggerFactory;
55
import org.springframework.beans.factory.annotation.Autowired;
66
import org.springframework.scheduling.annotation.Scheduled;
7+
import org.springframework.stereotype.Component;
78
import org.springframework.stereotype.Service;
89
import org.springframework.transaction.annotation.Propagation;
910
import org.springframework.transaction.annotation.Transactional;
@@ -13,15 +14,17 @@
1314
/**
1415
* Created by tw on 10.06.17.
1516
*/
16-
@Service
17-
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
17+
18+
@Component
19+
//@Service
20+
//@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
1821
public class ScheduledTasks {
1922

2023
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
2124
public void fetchTweetsFromTwitterSearch() {
2225
String msg = "fetch Tweets From TwitterSearch ";
2326
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()) {
24-
startTask.fetchTweetsFromTwitterSearch();
27+
startTask.fetchTweetsFromSearch();
2528
}
2629
}
2730

@@ -37,23 +40,23 @@ public void updateTweets() {
3740
public void updateUserProfiles() {
3841
String msg = "update User Profiles ";
3942
if(schedulerProperties.getAllowUpdateUserProfiles() && !schedulerProperties.getSkipFortesting()) {
40-
startTask.updateUserProfiles();
43+
startTask.updateUsers();
4144
}
4245
}
4346

4447
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
4548
public void updateUserProfilesFromMentions(){
4649
String msg = "update User Profiles From Mentions";
4750
if(schedulerProperties.getAllowUpdateUserProfilesFromMention() && !schedulerProperties.getSkipFortesting()) {
48-
startTask.updateUserProfilesFromMentions();
51+
startTask.updateUsersFromMentions();
4952
}
5053
}
5154

5255
@Scheduled(fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
5356
public void fetchUsersFromDefinedUserList(){
5457
String msg = "fetch Users from Defined User List ";
55-
if(schedulerProperties.getFetchUserList().getAllow() && !schedulerProperties.getSkipFortesting()) {
56-
startTask.fetchUsersFromDefinedUserList();
58+
if(schedulerProperties.getFetchUserListAllow() && !schedulerProperties.getSkipFortesting()) {
59+
startTask.fetchUsersFromList();
5760
}
5861
}
5962

@@ -63,13 +66,13 @@ public ScheduledTasks(SchedulerProperties schedulerProperties, StartTask startTa
6366
this.startTask = startTask;
6467
}
6568

66-
private final static long EINE_MINUTE = 60 * 1000;
69+
public final static long EINE_MINUTE = 60 * 1000;
6770

68-
private final static long FUENF_MINUTEN = 5 * EINE_MINUTE;
71+
public final static long FUENF_MINUTEN = 5 * EINE_MINUTE;
6972

70-
private final static long EINE_STUNDE = 60 * EINE_MINUTE;
73+
public final static long EINE_STUNDE = 60 * EINE_MINUTE;
7174

72-
private final static long ZWOELF_STUNDEN = 12 * EINE_STUNDE;
75+
public final static long ZWOELF_STUNDEN = 12 * EINE_STUNDE;
7376

7477
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS = EINE_STUNDE;
7578

src/main/java/org/woehlke/twitterwall/conf/WebSecurityConfig.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@ protected void configure(HttpSecurity http) throws Exception {
1818
http
1919
.authorizeRequests()
2020
.antMatchers(
21-
"/",
22-
"/tweet/all",
23-
"/user/*",
24-
"/user/screenName/*",
25-
"/user/list/tweets",
26-
"/hashtag/overview",
27-
"/hashtag/*",
28-
"/hashtag/text/*",
29-
"/imprint",
30-
"/css/*","/css/**",
31-
"/favicon/*","/favicon/**",
32-
"/js/*","/js/**",
33-
"/map-icons/*","/map-icons/**",
34-
"/webjars/*","/webjars/**"
21+
frontendProperties.getWebSecurityConfigPublicPathsAsArray()
3522
).permitAll()
3623
.anyRequest().authenticated()
3724
.and()

src/main/java/org/woehlke/twitterwall/conf/properties/BackendProperties.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class BackendProperties {
2020
@Valid
2121
public Url url = new Url();
2222

23+
@Validated
2324
public static class Twitter {
2425

2526
@NotNull
@@ -46,6 +47,7 @@ public void setMillisToWaitForFetchTweetsFromTwitterSearch(Integer millisToWaitF
4647

4748
}
4849

50+
@Validated
4951
public static class Url {
5052

5153
@NotNull

src/main/java/org/woehlke/twitterwall/conf/properties/FrontendProperties.java

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import org.springframework.stereotype.Component;
66
import org.springframework.validation.annotation.Validated;
77

8-
import javax.validation.Valid;
98
import javax.validation.constraints.NotNull;
9+
import java.util.ArrayList;
10+
import java.util.List;
1011

1112
@Component
1213
@Validated
@@ -43,22 +44,11 @@ public class FrontendProperties {
4344
@NotNull
4445
private String loginPassword;
4546

46-
@Valid
47-
private Controller controller = new Controller();
48-
49-
public static class Controller {
50-
51-
@NotNull
52-
private Boolean fetchUsersFromDefinedUserList;
53-
54-
public Boolean getFetchUsersFromDefinedUserList() {
55-
return fetchUsersFromDefinedUserList;
56-
}
47+
@NotNull
48+
private List<String> webSecurityConfigPublicPaths = new ArrayList<>();
5749

58-
public void setFetchUsersFromDefinedUserList(Boolean fetchUsersFromDefinedUserList) {
59-
this.fetchUsersFromDefinedUserList = fetchUsersFromDefinedUserList;
60-
}
61-
}
50+
@NotNull
51+
private Boolean fetchUsersFromDefinedUserList;
6252

6353
public String getIdGoogleAnalytics() {
6454
return idGoogleAnalytics;
@@ -116,14 +106,6 @@ public void setContextTest(Boolean contextTest) {
116106
this.contextTest = contextTest;
117107
}
118108

119-
public Controller getController() {
120-
return controller;
121-
}
122-
123-
public void setController(Controller controller) {
124-
this.controller = controller;
125-
}
126-
127109
public Integer getPageSize() {
128110
return pageSize;
129111
}
@@ -147,4 +129,29 @@ public String getLoginPassword() {
147129
public void setLoginPassword(String loginPassword) {
148130
this.loginPassword = loginPassword;
149131
}
132+
133+
public String[] getWebSecurityConfigPublicPathsAsArray() {
134+
int size = webSecurityConfigPublicPaths.size();
135+
String[] myArray = new String[size];
136+
for(int i=0; i<size; i++){
137+
myArray[i] = webSecurityConfigPublicPaths.get(i);
138+
}
139+
return myArray;
140+
}
141+
142+
public List<String> getWebSecurityConfigPublicPaths() {
143+
return webSecurityConfigPublicPaths;
144+
}
145+
146+
public void setWebSecurityConfigPublicPaths(List<String> webSecurityConfigPublicPaths) {
147+
this.webSecurityConfigPublicPaths = webSecurityConfigPublicPaths;
148+
}
149+
150+
public Boolean getFetchUsersFromDefinedUserList() {
151+
return fetchUsersFromDefinedUserList;
152+
}
153+
154+
public void setFetchUsersFromDefinedUserList(Boolean fetchUsersFromDefinedUserList) {
155+
this.fetchUsersFromDefinedUserList = fetchUsersFromDefinedUserList;
156+
}
150157
}

0 commit comments

Comments
 (0)