Skip to content

Commit 4598092

Browse files
committed
work
1 parent 5d451a1 commit 4598092

File tree

38 files changed

+239
-241
lines changed

38 files changed

+239
-241
lines changed

src/main/java/org/woehlke/java/simpleworklist/domain/AbstractController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import org.springframework.beans.factory.annotation.Autowired;
2424
import org.woehlke.java.simpleworklist.domain.user.access.UserAuthorizationService;
25-
import org.woehlke.java.simpleworklist.domain.user.login.UserAccountLoginSuccessService;
25+
import org.woehlke.java.simpleworklist.domain.user.login.LoginSuccessService;
2626

2727
import javax.validation.constraints.NotNull;
2828
import java.util.ArrayList;
@@ -57,7 +57,7 @@ public abstract class AbstractController {
5757
protected ChatMessageService chatMessageService;
5858

5959
@Autowired
60-
protected UserAccountLoginSuccessService userAccountLoginSuccessService;
60+
protected LoginSuccessService loginSuccessService;
6161

6262
@Autowired
6363
protected ContextService contextService;
@@ -150,7 +150,7 @@ public final boolean refreshMessagePage(){
150150
}
151151

152152
protected UserAccount getUser() {
153-
return this.userAccountLoginSuccessService.retrieveCurrentUser();
153+
return this.loginSuccessService.retrieveCurrentUser();
154154
}
155155

156156
protected Context getContext(@NotNull final UserSessionBean userSession){

src/main/java/org/woehlke/java/simpleworklist/domain/ProjectIdController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public final String projectTaskAddGet(
6161
@ModelAttribute("userSession") UserSessionBean userSession,
6262
Locale locale, Model model
6363
) {
64-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
64+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
6565
Task task = new Task();
6666
task.setTaskState(TaskState.INBOX);
6767
task.setTaskEnergy(TaskEnergy.NONE);
@@ -414,7 +414,7 @@ public final String editTaskGet(
414414
Locale locale, Model model
415415
) {
416416
log.info("editTaskGet");
417-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
417+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
418418
List<Context> contexts = contextService.getAllForUser(userAccount);
419419
Context thisContext = task.getContext();
420420
Breadcrumb breadcrumb = breadcrumbService.getBreadcrumbForShowOneProject(thisProject,locale,userSession);
@@ -459,7 +459,7 @@ public final String editTaskPost(
459459
for (ObjectError e : result.getAllErrors()) {
460460
log.warn(e.toString());
461461
}
462-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
462+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
463463
List<Context> contexts = contextService.getAllForUser(userAccount);
464464
task = addProject(task);
465465
Context thisContext = task.getContext();

src/main/java/org/woehlke/java/simpleworklist/domain/ProjectRootController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public final String editTaskGet(
195195
Locale locale, Model model
196196
) {
197197
log.info("editTaskGet");
198-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
198+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
199199
List<Context> contexts = contextService.getAllForUser(userAccount);
200200
Context thisContext = task.getContext();
201201
Project thisProject = addProjectFromTaskToModel( task, model );
@@ -240,7 +240,7 @@ public final String editTaskPost(
240240
for (ObjectError e : result.getAllErrors()) {
241241
log.warn(e.toString());
242242
}
243-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
243+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
244244
List<Context> contexts = contextService.getAllForUser(userAccount);
245245
task = addProject(task);
246246
Context thisContext = task.getContext();

src/main/java/org/woehlke/java/simpleworklist/domain/TaskStateTaskController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public final String addNewTaskToInboxGet(
5656
Locale locale, Model model
5757
) {
5858
log.info("addNewTaskToInboxGet");
59-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
59+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
6060
Task task = new Task();
6161
task.setTaskState(TaskState.INBOX);
6262
task.setTaskEnergy(TaskEnergy.NONE);
@@ -121,7 +121,7 @@ public final String editTaskGet(
121121
) {
122122
log.info("editTaskGet");
123123
addProjectFromTaskToModel( task, model );
124-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
124+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
125125
List<Context> contexts = contextService.getAllForUser(userAccount);
126126
Context thisContext = task.getContext();
127127
Breadcrumb breadcrumb = breadcrumbService.getBreadcrumbForTaskstate(task.getTaskState(), locale, userSession);
@@ -163,7 +163,7 @@ public final String editTaskPost(
163163
log.warn(e.toString());
164164
}
165165
//Task persistentTask = taskService.findOne(taskId);
166-
UserAccount userAccount = userAccountLoginSuccessService.retrieveCurrentUser();
166+
UserAccount userAccount = loginSuccessService.retrieveCurrentUser();
167167
List<Context> contexts = contextService.getAllForUser(userAccount);
168168
Project thisProject = addProjectFromTaskToModel( task, model );
169169
// task = addProject(task);

src/main/java/org/woehlke/java/simpleworklist/domain/TestDataController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@
88
import org.woehlke.java.simpleworklist.domain.user.account.UserAccount;
99

1010
import org.springframework.beans.factory.annotation.Autowired;
11-
import org.woehlke.java.simpleworklist.domain.user.login.UserAccountLoginSuccessService;
11+
import org.woehlke.java.simpleworklist.domain.user.login.LoginSuccessService;
1212

1313
@Slf4j
1414
@Controller
1515
@RequestMapping(path = "/testdata")
1616
public class TestDataController {
1717

1818
private final TestDataService testDataService;
19-
private final UserAccountLoginSuccessService userAccountLoginSuccessService;
19+
private final LoginSuccessService loginSuccessService;
2020

2121
@Autowired
2222
public TestDataController(
2323
TestDataService testDataService,
24-
UserAccountLoginSuccessService userAccountLoginSuccessService
24+
LoginSuccessService loginSuccessService
2525
) {
2626
this.testDataService = testDataService;
27-
this.userAccountLoginSuccessService = userAccountLoginSuccessService;
27+
this.loginSuccessService = loginSuccessService;
2828
}
2929

3030
@RequestMapping(path = "/createTree", method = RequestMethod.GET)
3131
public String createTestCategoryTree() {
32-
UserAccount user = userAccountLoginSuccessService.retrieveCurrentUser();
32+
UserAccount user = loginSuccessService.retrieveCurrentUser();
3333
testDataService.createTestData(user);
3434
return "redirect:/home";
3535
}

src/main/java/org/woehlke/java/simpleworklist/domain/UserLoginController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
import org.woehlke.java.simpleworklist.domain.user.access.UserAuthorizationService;
2020
import org.woehlke.java.simpleworklist.domain.user.account.UserAccount;
2121
import org.woehlke.java.simpleworklist.domain.user.login.LoginForm;
22-
import org.woehlke.java.simpleworklist.domain.user.login.UserAccountLoginSuccessService;
22+
import org.woehlke.java.simpleworklist.domain.user.login.LoginSuccessService;
2323

2424
@Slf4j
2525
@Controller
2626
@RequestMapping(path = "/user")
2727
public class UserLoginController {
2828

29-
private final UserAccountLoginSuccessService userAccountLoginSuccessService;
29+
private final LoginSuccessService loginSuccessService;
3030
private final UserAuthorizationService userAuthorizationService;
3131

3232
@Autowired
3333
public UserLoginController(
34-
UserAccountLoginSuccessService userAccountLoginSuccessService,
34+
LoginSuccessService loginSuccessService,
3535
UserAuthorizationService userAuthorizationService
3636
) {
37-
this.userAccountLoginSuccessService = userAccountLoginSuccessService;
37+
this.loginSuccessService = loginSuccessService;
3838
this.userAuthorizationService = userAuthorizationService;
3939
}
4040

@@ -70,8 +70,8 @@ public final String loginPost(
7070
log.info("loginPerform");
7171
boolean authorized = userAuthorizationService.authorize(loginForm);
7272
if (!result.hasErrors() && authorized) {
73-
UserAccount user = userAccountLoginSuccessService.retrieveCurrentUser();
74-
userAccountLoginSuccessService.updateLastLoginTimestamp(user);
73+
UserAccount user = loginSuccessService.retrieveCurrentUser();
74+
loginSuccessService.updateLastLoginTimestamp(user);
7575
log.info("logged in");
7676
return "redirect:/home";
7777
} else {

src/main/java/org/woehlke/java/simpleworklist/domain/UserPasswordRecoveryController.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import org.woehlke.java.simpleworklist.domain.user.account.UserAccountForm;
1313
import org.woehlke.java.simpleworklist.domain.user.account.UserAccount;
1414
import org.woehlke.java.simpleworklist.domain.user.passwordrecovery.UserAccountPasswordRecovery;
15-
import org.woehlke.java.simpleworklist.domain.user.passwordrecovery.UserPasswordRecoveryService;
16-
import org.woehlke.java.simpleworklist.domain.user.signup.UserRegistrationForm;
15+
import org.woehlke.java.simpleworklist.domain.user.passwordrecovery.UserAccountPasswordRecoveryService;
16+
import org.woehlke.java.simpleworklist.domain.user.signup.UserAccountRegistrationForm;
1717

1818
import org.springframework.beans.factory.annotation.Autowired;
1919

@@ -25,12 +25,12 @@
2525
public class UserPasswordRecoveryController {
2626

2727
private final UserAccountService userAccountService;
28-
private final UserPasswordRecoveryService userPasswordRecoveryService;
28+
private final UserAccountPasswordRecoveryService userAccountPasswordRecoveryService;
2929

3030
@Autowired
31-
public UserPasswordRecoveryController(UserAccountService userAccountService, UserPasswordRecoveryService userPasswordRecoveryService) {
31+
public UserPasswordRecoveryController(UserAccountService userAccountService, UserAccountPasswordRecoveryService userAccountPasswordRecoveryService) {
3232
this.userAccountService = userAccountService;
33-
this.userPasswordRecoveryService = userPasswordRecoveryService;
33+
this.userAccountPasswordRecoveryService = userAccountPasswordRecoveryService;
3434
}
3535

3636
/**
@@ -42,45 +42,45 @@ public UserPasswordRecoveryController(UserAccountService userAccountService, Use
4242
*/
4343
@RequestMapping(path="/resetPassword", method = RequestMethod.GET)
4444
public final String passwordForgottenForm(Model model) {
45-
UserRegistrationForm userRegistrationForm = new UserRegistrationForm();
46-
model.addAttribute("userRegistrationForm", userRegistrationForm);
45+
UserAccountRegistrationForm userAccountRegistrationForm = new UserAccountRegistrationForm();
46+
model.addAttribute("userRegistrationForm", userAccountRegistrationForm);
4747
return "user/resetPassword/resetPasswordForm";
4848
}
4949

5050
/**
5151
* If email-address exists, send email with Link for password-Reset.
5252
*
53-
* @param userRegistrationForm
53+
* @param userAccountRegistrationForm
5454
* @param result
5555
* @param model
5656
* @return info page if without errors or formular again displaying error messages.
5757
*/
5858
@RequestMapping(path="/resetPassword", method = RequestMethod.POST)
5959
public final String passwordForgottenPost(
60-
@Valid UserRegistrationForm userRegistrationForm,
60+
@Valid UserAccountRegistrationForm userAccountRegistrationForm,
6161
BindingResult result,
6262
Model model
6363
) {
6464
if (result.hasErrors()) {
6565
log.info("----------------------");
66-
log.info(userRegistrationForm.toString());
66+
log.info(userAccountRegistrationForm.toString());
6767
log.info(result.toString());
6868
log.info(model.toString());
6969
log.info("----------------------");
7070
return "user/resetPassword/resetPasswordForm";
7171
} else {
72-
log.info(userRegistrationForm.toString());
72+
log.info(userAccountRegistrationForm.toString());
7373
log.info(result.toString());
7474
log.info(model.toString());
75-
if (userAccountService.findByUserEmail(userRegistrationForm.getEmail()) == null) {
75+
if (userAccountService.findByUserEmail(userAccountRegistrationForm.getEmail()) == null) {
7676
String objectName = "userRegistrationForm";
7777
String field = "email";
7878
String defaultMessage = "This Email is not registered.";
7979
FieldError e = new FieldError(objectName, field, defaultMessage);
8080
result.addError(e);
8181
return "user/resetPassword/resetPasswordForm";
8282
} else {
83-
userPasswordRecoveryService.passwordRecoverySendEmailTo(userRegistrationForm.getEmail());
83+
userAccountPasswordRecoveryService.passwordRecoverySendEmailTo(userAccountRegistrationForm.getEmail());
8484
return "user/resetPassword/resetPasswordSentMail";
8585
}
8686
}
@@ -98,9 +98,9 @@ public final String enterNewPasswordFormular(
9898
@PathVariable String confirmId,
9999
Model model
100100
) {
101-
UserAccountPasswordRecovery oUserAccountPasswordRecovery = userPasswordRecoveryService.findByToken(confirmId);
101+
UserAccountPasswordRecovery oUserAccountPasswordRecovery = userAccountPasswordRecoveryService.findByToken(confirmId);
102102
if (oUserAccountPasswordRecovery != null) {
103-
userPasswordRecoveryService.passwordRecoveryClickedInEmail(oUserAccountPasswordRecovery);
103+
userAccountPasswordRecoveryService.passwordRecoveryClickedInEmail(oUserAccountPasswordRecovery);
104104
UserAccount ua = userAccountService.findByUserEmail(oUserAccountPasswordRecovery.getEmail());
105105
UserAccountForm userAccountForm = new UserAccountForm();
106106
userAccountForm.setUserEmail(oUserAccountPasswordRecovery.getEmail());
@@ -128,12 +128,12 @@ public final String enterNewPasswordPost(
128128
@PathVariable String confirmId,
129129
Model model
130130
) {
131-
UserAccountPasswordRecovery o = userPasswordRecoveryService.findByToken(confirmId);
131+
UserAccountPasswordRecovery o = userAccountPasswordRecoveryService.findByToken(confirmId);
132132
boolean passwordsMatch = userAccountForm.passwordsAreTheSame();
133133
if (o != null) {
134134
if (!result.hasErrors() && passwordsMatch) {
135135
userAccountService.changeUsersPassword(userAccountForm);
136-
userPasswordRecoveryService.passwordRecoveryDone(o);
136+
userAccountPasswordRecoveryService.passwordRecoveryDone(o);
137137
return "user/resetPassword/resetPasswordDone";
138138
} else {
139139
if (!passwordsMatch) {

0 commit comments

Comments
 (0)