Skip to content

Commit 5fa272f

Browse files
workin on #161
1 parent 1c0b38a commit 5fa272f

Some content is hidden

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

59 files changed

+232
-244
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ When creating a new issue, try following [necolas's guidelines][issue-guidelines
7575

7676
### Support
7777

78-
Let me know if you are using Twitterwall. I may get around to creating a showcase page listing user sites.
78+
Let me know if you are using Twitterwall. I may get around to creating a showcase pageContent listing user sites.
7979

8080
[Contact me][av-site] if you have questions about Twitterwall, or just like to say something about it.
8181
If you _really really_ like it and want to support the author, I will be glad to

src/main/java/org/woehlke/twitterwall/frontend/controller/common/GlobalExceptionHandler.java renamed to src/main/java/org/woehlke/twitterwall/frontend/controller/GlobalExceptionHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.woehlke.twitterwall.frontend.controller.common;
1+
package org.woehlke.twitterwall.frontend.controller;
22

33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
@@ -9,6 +9,8 @@
99
import org.springframework.web.bind.annotation.ExceptionHandler;
1010
import org.springframework.web.bind.annotation.ResponseStatus;
1111
import org.springframework.web.servlet.ModelAndView;
12+
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
13+
import org.woehlke.twitterwall.frontend.controller.common.Symbols;
1214

1315
import javax.servlet.http.HttpServletRequest;
1416

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.woehlke.twitterwall.frontend.controller.common.HashTagsOverviewHelper;
1818
import org.woehlke.twitterwall.frontend.controller.common.Symbols;
1919
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
20-
import org.woehlke.twitterwall.frontend.model.HashTagOverview;
20+
import org.woehlke.twitterwall.oodm.entities.transients.HashTagOverview;
2121
import org.woehlke.twitterwall.oodm.entities.Tweet;
2222
import org.woehlke.twitterwall.oodm.entities.User;
2323
import org.woehlke.twitterwall.oodm.entities.HashTag;

src/main/java/org/woehlke/twitterwall/frontend/controller/common/HashTagsOverviewHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.woehlke.twitterwall.frontend.controller.common;
22

3-
import org.woehlke.twitterwall.frontend.model.HashTagOverview;
3+
import org.woehlke.twitterwall.oodm.entities.transients.HashTagOverview;
44

55
public interface HashTagsOverviewHelper {
66

src/main/java/org/woehlke/twitterwall/frontend/controller/common/Symbols.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ public enum Symbols {
99
IMPRINT("<i class=\"fa fa-university\" aria-hidden=\"true\"></i>"),
1010
PROFILE("<i class=\"fa fa-users\" aria-hidden=\"true\"></i>"),
1111
HOME("<span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>"),
12-
USER_ALL("<i class=\"fa fa-user\" aria-hidden=\"true\"></i>"),
12+
USER_ALL("<i class=\"fa fa-users\" aria-hidden=\"true\"></i>"),
1313
USER_TWEETS("<i class=\"fa fa-users\" aria-hidden=\"true\"></i>"),
1414
USER_NOT_YET_FRIENDS("<i class=\"fa fa-plus-square\" aria-hidden=\"true\"></i>"),
15-
GET_TEST_DATA("<i class=\"fa fa-cubes\" aria-hidden=\"true\"></i>\n"),
15+
GET_TEST_DATA("<i class=\"fa fa-cubes\" aria-hidden=\"true\"></i>"),
1616
EXCEPTION("<i class=\"fa fa-bolt\" aria-hidden=\"true\"></i>"),
1717
LEAF("<i class=\"fa fa-leaf\" aria-hidden=\"true\"></i>"),
1818
DATABASE("<i class=\"fa fa-database\" aria-hidden=\"true\"></i>"),
19-
USER_NOT_YET_ON_LIST("<i class=\"fa fa-handshake-o\" aria-hidden=\"true\"></i>\n"),
19+
USER_NOT_YET_ON_LIST("<i class=\"fa fa-handshake-o\" aria-hidden=\"true\"></i>"),
2020
USER_FRIENDS("<i class=\"fa fa-users\" aria-hidden=\"true\"></i>"),
2121
USER_FOLLOWER("<i class=\"fa fa-users\" aria-hidden=\"true\"></i>"),
2222
TASK("<i class=\"fa fa-check-square\" aria-hidden=\"true\"></i>"),
23-
TASK_HISTORY("<i class=\"fa fa-check-square-o\" aria-hidden=\"true\"></i>");
23+
TASK_HISTORY("<i class=\"fa fa-check-square-o\" aria-hidden=\"true\"></i>"),
24+
USER_NOTYETFIRENDS("<i class=\"fa fa-plus-square\" aria-hidden=\"true\"></i>"),
25+
HASHTAG_USER("<i class=\"fa fa-hashtag\" aria-hidden=\"true\"></i>");
2426

2527
Symbols(String html){
2628
this.html=html;

src/main/java/org/woehlke/twitterwall/frontend/controller/common/UrlPaths.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/main/java/org/woehlke/twitterwall/frontend/controller/common/impl/ControllerHelperImpl.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.woehlke.twitterwall.conf.properties.TwitterProperties;
1212
import org.woehlke.twitterwall.conf.properties.FrontendProperties;
1313
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
14-
import org.woehlke.twitterwall.frontend.model.Page;
14+
import org.woehlke.twitterwall.oodm.entities.transients.PageContent;
1515

1616
/**
1717
* Created by tw on 18.07.17.
@@ -20,42 +20,42 @@
2020
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
2121
public class ControllerHelperImpl implements ControllerHelper {
2222

23-
private Page setupPage(Page page, String title, String subtitle, String symbol) {
24-
page.setTitle(title);
25-
page.setSubtitle(subtitle);
26-
page.setSymbol(symbol);
27-
page.setMenuAppName(frontendProperties.getMenuAppName());
28-
page.setTwitterSearchTerm(twitterProperties.getSearchQuery());
29-
page.setInfoWebpage(frontendProperties.getInfoWebpage());
30-
page.setTheme(frontendProperties.getTheme());
31-
page.setContextTest(frontendProperties.getContextTest());
32-
page.setHistoryBack(true);
23+
private PageContent setupPage(PageContent pageContent, String title, String subtitle, String symbol) {
24+
pageContent.setTitle(title);
25+
pageContent.setSubtitle(subtitle);
26+
pageContent.setSymbol(symbol);
27+
pageContent.setMenuAppName(frontendProperties.getMenuAppName());
28+
pageContent.setTwitterSearchTerm(twitterProperties.getSearchQuery());
29+
pageContent.setInfoWebpage(frontendProperties.getInfoWebpage());
30+
pageContent.setTheme(frontendProperties.getTheme());
31+
pageContent.setContextTest(frontendProperties.getContextTest());
32+
pageContent.setHistoryBack(true);
3333
if(!frontendProperties.getIdGoogleAnalytics().isEmpty()){
3434
String html = GOOGLE_ANALYTICS_SCRIPT_HTML;
3535
html = html.replace("###GOOGLE_ANALYTICS_ID###", frontendProperties.getIdGoogleAnalytics());
36-
page.setGoogleAnalyticScriptHtml(html);
36+
pageContent.setGoogleAnalyticScriptHtml(html);
3737
} else {
38-
page.setGoogleAnalyticScriptHtml("");
38+
pageContent.setGoogleAnalyticScriptHtml("");
3939
}
4040
log.info("--------------------------------------------------------------------");
41-
log.info("setupPage = "+page.toString());
41+
log.info("setupPage = "+ pageContent.toString());
4242
log.info("--------------------------------------------------------------------");
43-
return page;
43+
return pageContent;
4444
}
4545

4646
public ModelAndView setupPage(ModelAndView mav, String title, String subtitle, String symbol) {
47-
Page page = new Page();
48-
page = setupPage(page, title, subtitle, symbol);
49-
log.info("page: "+page.toString());
50-
mav.addObject("page", page);
47+
PageContent pageContent = new PageContent();
48+
pageContent = setupPage(pageContent, title, subtitle, symbol);
49+
log.info("pageContent: "+ pageContent.toString());
50+
mav.addObject("pageContent", pageContent);
5151
return mav;
5252
}
5353

5454
public Model setupPage(Model model, String title, String subtitle, String symbol) {
55-
Page page = new Page();
56-
page = setupPage(page, title, subtitle, symbol);
57-
log.info("page: "+page.toString());
58-
model.addAttribute("page", page);
55+
PageContent pageContent = new PageContent();
56+
pageContent = setupPage(pageContent, title, subtitle, symbol);
57+
log.info("pageContent: "+ pageContent.toString());
58+
model.addAttribute("pageContent", pageContent);
5959
return model;
6060
}
6161

src/main/java/org/woehlke/twitterwall/frontend/controller/common/impl/HashTagsOverviewHelperImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import org.springframework.stereotype.Component;
1010
import org.woehlke.twitterwall.conf.properties.FrontendProperties;
1111
import org.woehlke.twitterwall.frontend.controller.common.HashTagsOverviewHelper;
12-
import org.woehlke.twitterwall.frontend.model.HashTagCounted;
13-
import org.woehlke.twitterwall.frontend.model.HashTagOverview;
12+
import org.woehlke.twitterwall.oodm.entities.transients.HashTagCounted;
13+
import org.woehlke.twitterwall.oodm.entities.transients.HashTagOverview;
1414
import org.woehlke.twitterwall.oodm.entities.HashTag;
1515
import org.woehlke.twitterwall.oodm.entities.Tweet;
1616
import org.woehlke.twitterwall.oodm.entities.User;

src/main/java/org/woehlke/twitterwall/frontend/rest/TaskResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.springframework.web.bind.annotation.*;
99
import org.woehlke.twitterwall.conf.properties.FrontendProperties;
1010
import org.woehlke.twitterwall.frontend.controller.common.ControllerHelper;
11-
import org.woehlke.twitterwall.frontend.model.TaskResourceModel;
11+
import org.woehlke.twitterwall.oodm.entities.transients.TaskResourceModel;
1212
import org.woehlke.twitterwall.oodm.entities.Task;
1313
import org.woehlke.twitterwall.oodm.entities.TaskHistory;
1414
import org.woehlke.twitterwall.oodm.service.TaskHistoryService;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import org.woehlke.twitterwall.oodm.entities.parts.HashTagText;
99

1010
import javax.persistence.*;
11+
import javax.validation.Valid;
12+
import javax.validation.constraints.AssertTrue;
13+
import javax.validation.constraints.NotNull;
1114
import java.util.HashMap;
1215
import java.util.Map;
1316

@@ -36,6 +39,8 @@ public class HashTag extends AbstractDomainObject<HashTag> implements DomainObje
3639
@GeneratedValue(strategy = GenerationType.AUTO)
3740
protected Long id;
3841

42+
@Valid
43+
@NotNull
3944
@Embedded
4045
private HashTagText hashTagText;
4146

@@ -69,6 +74,8 @@ public void setId(Long id) {
6974
this.id = id;
7075
}
7176

77+
@AssertTrue
78+
@Transient
7279
@Override
7380
public boolean isValid() {
7481
if(this.hashTagText == null){

0 commit comments

Comments
 (0)