Skip to content

Commit 8e0831c

Browse files
Merge pull request #203 from phasenraum2010/after-release-1.0.17
After release 1.0.17
2 parents d4877fc + cab316d commit 8e0831c

File tree

101 files changed

+3354
-983
lines changed

Some content is hidden

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

101 files changed

+3354
-983
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ buildNumber.properties
1515
*.iml
1616
twitterwall.log
1717
twitterwall.log*
18+
maven-build.log
19+
maven-build.log.txt
20+
maven-testing.log.txt
21+
spring-boot.log.txt
22+
maven-testing-site.log.txt
23+
test.log.txt
1824
docs2
1925
.bundle
2026
.sass-cache

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
<artifactId>spring-boot-configuration-processor</artifactId>
112112
<optional>true</optional>
113113
</dependency>
114+
<dependency>
115+
<groupId>org.springframework.security</groupId>
116+
<artifactId>spring-security-web</artifactId>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.springframework.security</groupId>
120+
<artifactId>spring-security-test</artifactId>
121+
<scope>test</scope>
122+
</dependency>
114123
<dependency>
115124
<groupId>org.thymeleaf.extras</groupId>
116125
<artifactId>thymeleaf-extras-springsecurity4</artifactId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.springframework.transaction.annotation.Propagation;
99
import org.springframework.transaction.annotation.Transactional;
1010
import org.woehlke.twitterwall.conf.properties.SchedulerProperties;
11-
import org.woehlke.twitterwall.scheduled.mq.endoint.StartTask;
11+
import org.woehlke.twitterwall.scheduled.mq.endpoint.StartTask;
1212

1313
/**
1414
* Created by tw on 10.06.17.

src/main/java/org/woehlke/twitterwall/frontend/controller/ImprintController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.woehlke.twitterwall.frontend.controller.common.Symbols;
1111
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
1212
import org.woehlke.twitterwall.oodm.entities.User;
13-
import org.woehlke.twitterwall.scheduled.mq.endoint.StartTask;
13+
import org.woehlke.twitterwall.scheduled.mq.endpoint.StartTask;
1414

1515

1616
/**

src/main/java/org/woehlke/twitterwall/frontend/controller/TaskController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import org.woehlke.twitterwall.oodm.service.TaskHistoryService;
2323
import org.woehlke.twitterwall.oodm.service.TaskService;
2424
import org.woehlke.twitterwall.oodm.service.UserService;
25-
import org.woehlke.twitterwall.scheduled.mq.endoint.AsyncStartTask;
26-
import org.woehlke.twitterwall.scheduled.mq.endoint.StartTask;
25+
import org.woehlke.twitterwall.scheduled.mq.endpoint.AsyncStartTask;
26+
import org.woehlke.twitterwall.scheduled.mq.endpoint.StartTask;
2727

2828
/**
2929
* Created by tw on 11.07.17.

src/main/java/org/woehlke/twitterwall/frontend/controller/TweetController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public String getLatestTweets(
5252
}
5353

5454
@RequestMapping("/{id}")
55-
public String getLatestTweets(
55+
public String getTweetById(
5656
@PathVariable("id") Tweet tweet, Model model
5757
) {
5858
String title = "Tweet";

src/main/java/org/woehlke/twitterwall/oodm/entities/HashTag.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,29 @@ public static boolean isValidText(String hashtagText){
6464
return m.matches();
6565
}
6666

67-
public Long getId() {
68-
return id;
69-
}
70-
71-
public void setId(Long id) {
72-
this.id = id;
67+
@Transient
68+
@Override
69+
public boolean isValid() {
70+
if((text == null)||(text.isEmpty())){
71+
return false;
72+
} else {
73+
return this.hasValidText();
74+
}
7375
}
7476

77+
@Transient
7578
@Override
7679
public String getUniqueId() {
7780
return text;
7881
}
7982

83+
public Long getId() {
84+
return id;
85+
}
86+
87+
public void setId(Long id) {
88+
this.id = id;
89+
}
8090

8191
public String getText() {
8292
return this.text;
@@ -99,14 +109,6 @@ public String toString() {
99109
" }\n";
100110
}
101111

102-
@Override
103-
public boolean isValid() {
104-
if((text == null)||(text.isEmpty())){
105-
return false;
106-
}
107-
return true;
108-
}
109-
110112
@Override
111113
public boolean equals(Object o) {
112114
if (this == o) return true;

src/main/java/org/woehlke/twitterwall/oodm/entities/Media.java

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import javax.persistence.*;
1313
import javax.validation.constraints.NotNull;
14+
import java.net.MalformedURLException;
1415

1516
/**
1617
* Created by tw on 10.06.17.
@@ -101,6 +102,53 @@ private Media() {
101102
super();
102103
}
103104

105+
@Transient
106+
@Override
107+
public String getUniqueId() {
108+
return idTwitter.toString();
109+
}
110+
111+
@Transient
112+
@Override
113+
public boolean isValid() {
114+
if(this.url == null){
115+
return false;
116+
}
117+
if(this.expanded == null){
118+
return false;
119+
}
120+
if(this.display == null){
121+
return false;
122+
}
123+
if(this.url.isEmpty()){
124+
return false;
125+
}
126+
if(this.expanded.isEmpty()){
127+
return false;
128+
}
129+
if(this.display.isEmpty()){
130+
return false;
131+
}
132+
if(this.mediaHttps == null){
133+
return false;
134+
}
135+
if(this.mediaHttps.isEmpty()){
136+
return false;
137+
}
138+
if(this.mediaHttp == null){
139+
return false;
140+
}
141+
if(this.mediaHttp.isEmpty()){
142+
return false;
143+
}
144+
try {
145+
java.net.URL url = new java.net.URL(this.url);
146+
return true;
147+
} catch (MalformedURLException e) {
148+
return false;
149+
}
150+
}
151+
104152
public static long getSerialVersionUID() {
105153
return serialVersionUID;
106154
}
@@ -114,11 +162,6 @@ public void setId(Long id) {
114162
this.id = id;
115163
}
116164

117-
@Override
118-
public String getUniqueId() {
119-
return idTwitter.toString();
120-
}
121-
122165
@Override
123166
public Long getIdTwitter() {
124167
return idTwitter;
@@ -192,10 +235,4 @@ public String toString() {
192235
" }\n";
193236
}
194237

195-
@Override
196-
public boolean isValid() {
197-
return true;
198-
}
199-
200-
201238
}

src/main/java/org/woehlke/twitterwall/oodm/entities/Mention.java

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class Mention extends AbstractDomainObject<Mention> implements DomainObje
6363
private User user;
6464

6565
@NotNull
66-
@Column(name = "id_twitte_of_user",nullable = false)
66+
@Column(name = "id_twitter_of_user",nullable = false)
6767
private Long idTwitterOfUser = 0L;
6868

6969
public Mention(Task createdBy, Task updatedBy, long idTwitter, String screenName, String name) {
@@ -83,6 +83,46 @@ public Mention(Task createdBy, Task updatedBy, String mentionString) {
8383
private Mention() {
8484
}
8585

86+
@Transient
87+
@Override
88+
public String getUniqueId() {
89+
return idTwitter.toString() +"_"+ screenName.toString();
90+
}
91+
92+
@Transient
93+
@Override
94+
public boolean isValid() {
95+
if(screenName == null){
96+
return false;
97+
}
98+
if(screenName.isEmpty()){
99+
return false;
100+
}
101+
if(!this.hasValidScreenName()){
102+
return false;
103+
}
104+
if(idTwitter == null){
105+
return false;
106+
}
107+
return true;
108+
}
109+
110+
@Transient
111+
public boolean hasValidScreenName() {
112+
Pattern p = Pattern.compile("^" + User.SCREEN_NAME_PATTERN + "$");
113+
Matcher m = p.matcher(screenName);
114+
return m.matches();
115+
}
116+
117+
public static boolean isValidScreenName(String screenName) {
118+
if(screenName==null){
119+
return false;
120+
}
121+
Pattern p = Pattern.compile("^" + User.SCREEN_NAME_PATTERN + "$");
122+
Matcher m = p.matcher(screenName);
123+
return m.matches();
124+
}
125+
86126
@Transient
87127
public Boolean isProxy(){
88128
return idTwitter < 0;
@@ -102,16 +142,12 @@ public boolean hasPersistentUser(){
102142
}
103143

104144
@Transient
105-
public boolean hasValidScreenName() {
106-
Pattern p = Pattern.compile("^" + User.SCREEN_NAME_PATTERN + "$");
107-
Matcher m = p.matcher(screenName);
108-
return m.matches();
109-
}
110-
111-
public static boolean isValidScreenName(String screenName) {
112-
Pattern p = Pattern.compile("^" + User.SCREEN_NAME_PATTERN + "$");
113-
Matcher m = p.matcher(screenName);
114-
return m.matches();
145+
public boolean isRawMentionFromUserDescription() {
146+
if(this.isValid()) {
147+
return (this.getIdTwitter() == ID_TWITTER_UNDEFINED);
148+
} else {
149+
return false;
150+
}
115151
}
116152

117153
public boolean hasUser() {
@@ -130,11 +166,6 @@ public void setId(Long id) {
130166
this.id = id;
131167
}
132168

133-
@Override
134-
public String getUniqueId() {
135-
return idTwitter.toString() +"_"+ screenName.toString();
136-
}
137-
138169
public String getScreenName() {
139170
return screenName;
140171
}
@@ -188,22 +219,6 @@ public String toString() {
188219
" }\n";
189220
}
190221

191-
@Transient
192-
public boolean isValid() {
193-
if((screenName == null) ||(screenName.isEmpty())|| isRawMentionFromUserDescription()){
194-
return false;
195-
}
196-
if(idTwitter <= 1L){
197-
return false;
198-
}
199-
return true;
200-
}
201-
202-
@Transient
203-
public boolean isRawMentionFromUserDescription() {
204-
return (this.getIdTwitter() == ID_TWITTER_UNDEFINED);
205-
}
206-
207222
@Override
208223
public boolean equals(Object o) {
209224
if (this == o) return true;

0 commit comments

Comments
 (0)