Skip to content

Commit 2a438d8

Browse files
committed
work
1 parent e58c5b1 commit 2a438d8

File tree

3 files changed

+309
-28
lines changed

3 files changed

+309
-28
lines changed

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

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
import org.springframework.web.bind.annotation.ModelAttribute;
1010
import org.springframework.web.bind.annotation.RequestMapping;
1111
import org.springframework.web.bind.annotation.RequestMethod;
12-
import org.woehlke.java.simpleworklist.domain.AbstractController;
1312
import org.woehlke.java.simpleworklist.domain.db.data.Context;
1413
import org.woehlke.java.simpleworklist.domain.meso.session.UserSessionBean;
1514

1615
import lombok.extern.slf4j.Slf4j;
17-
import org.woehlke.java.simpleworklist.domain.db.data.task.TaskState;
1816
import org.woehlke.java.simpleworklist.domain.meso.taskstate.TaskStateTabControllerService;
1917

2018
import javax.validation.constraints.NotNull;
@@ -40,8 +38,8 @@ public final String inbox(
4038
Model model
4139
) {
4240
Context context = super.getContext(userSession);
43-
return taskStateTabControllerService.getTaskStatePage(
44-
TaskState.INBOX, context, pageable, userSession, locale, model
41+
return taskStateTabControllerService.getTaskStatePageInbox(
42+
context, pageable, userSession, locale, model
4543
);
4644
}
4745

@@ -53,8 +51,8 @@ public final String today(
5351
Model model
5452
) {
5553
Context context = super.getContext(userSession);
56-
return taskStateTabControllerService.getTaskStatePage(
57-
TaskState.TODAY, context, pageable, userSession, locale, model
54+
return taskStateTabControllerService.getTaskStatePageToday(
55+
context, pageable, userSession, locale, model
5856
);
5957
}
6058

@@ -66,8 +64,8 @@ public final String next(
6664
Model model
6765
) {
6866
Context context = super.getContext(userSession);
69-
return taskStateTabControllerService.getTaskStatePage(
70-
TaskState.NEXT, context, pageable, userSession, locale, model
67+
return taskStateTabControllerService.getTaskStatePageNext(
68+
context, pageable, userSession, locale, model
7169
);
7270
}
7371

@@ -79,8 +77,8 @@ public final String waiting(
7977
Model model
8078
) {
8179
Context context = super.getContext(userSession);
82-
return taskStateTabControllerService.getTaskStatePage(
83-
TaskState.WAITING, context, pageable, userSession, locale, model
80+
return taskStateTabControllerService.getTaskStatePageWaiting(
81+
context, pageable, userSession, locale, model
8482
);
8583
}
8684

@@ -92,8 +90,8 @@ public final String scheduled(
9290
Model model
9391
) {
9492
Context context = super.getContext(userSession);
95-
return taskStateTabControllerService.getTaskStatePage(
96-
TaskState.SCHEDULED, context, pageable, userSession, locale, model
93+
return taskStateTabControllerService.getTaskStatePageScheduled(
94+
context, pageable, userSession, locale, model
9795
);
9896
}
9997

@@ -105,8 +103,8 @@ public final String someday(
105103
Model model
106104
) {
107105
Context context = super.getContext(userSession);
108-
return taskStateTabControllerService.getTaskStatePage(
109-
TaskState.SOMEDAY, context, pageable, userSession, locale, model
106+
return taskStateTabControllerService.getTaskStatePageSomeday(
107+
context, pageable, userSession, locale, model
110108
);
111109
}
112110

@@ -118,8 +116,8 @@ public final String completed(
118116
Model model
119117
) {
120118
Context context = super.getContext(userSession);
121-
return taskStateTabControllerService.getTaskStatePage(
122-
TaskState.COMPLETED, context, pageable, userSession, locale, model
119+
return taskStateTabControllerService.getTaskStatePageCompleted(
120+
context, pageable, userSession, locale, model
123121
);
124122
}
125123

@@ -131,8 +129,8 @@ public final String trash(
131129
Model model
132130
) {
133131
Context context = super.getContext(userSession);
134-
return taskStateTabControllerService.getTaskStatePage(
135-
TaskState.TRASH, context, pageable, userSession, locale, model
132+
return taskStateTabControllerService.getTaskStatePageTrash(
133+
context, pageable, userSession, locale, model
136134
);
137135
}
138136

@@ -155,8 +153,8 @@ public final String focus(
155153
Model model
156154
) {
157155
Context context = super.getContext(userSession);
158-
return taskStateTabControllerService.getTaskStatePage(
159-
TaskState.FOCUS, context, pageable, userSession, locale, model
156+
return taskStateTabControllerService.getTaskStatePageFocus(
157+
true, context, pageable, userSession, locale, model
160158
);
161159
}
162160

src/main/java/org/woehlke/java/simpleworklist/domain/meso/taskstate/TaskStateTabControllerService.java

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,98 @@
11
package org.woehlke.java.simpleworklist.domain.meso.taskstate;
22

3+
34
import org.springframework.data.domain.Pageable;
45
import org.springframework.ui.Model;
56
import org.woehlke.java.simpleworklist.domain.db.data.Context;
6-
import org.woehlke.java.simpleworklist.domain.db.data.task.TaskState;
77
import org.woehlke.java.simpleworklist.domain.meso.session.UserSessionBean;
88

99
import java.util.Locale;
1010

11+
1112
public interface TaskStateTabControllerService {
1213

13-
String getTaskStatePage(
14-
TaskState taskState,
14+
String getTaskStatePageInbox(
15+
Context context,
16+
Pageable pageRequest,
17+
UserSessionBean userSession,
18+
Locale locale,
19+
Model model
20+
);
21+
22+
String getTaskStatePageToday(
23+
Context context,
24+
Pageable pageRequest,
25+
UserSessionBean userSession,
26+
Locale locale,
27+
Model model
28+
);
29+
30+
String getTaskStatePageNext(
31+
Context context,
32+
Pageable pageRequest,
33+
UserSessionBean userSession,
34+
Locale locale,
35+
Model model
36+
);
37+
38+
String getTaskStatePageWaiting(
39+
Context context,
40+
Pageable pageRequest,
41+
UserSessionBean userSession,
42+
Locale locale,
43+
Model model
44+
);
45+
46+
String getTaskStatePageScheduled(
47+
Context context,
48+
Pageable pageRequest,
49+
UserSessionBean userSession,
50+
Locale locale,
51+
Model model
52+
);
53+
54+
String getTaskStatePageFocus(
55+
boolean focus,
56+
Context context,
57+
Pageable pageRequest,
58+
UserSessionBean userSession,
59+
Locale locale,
60+
Model model
61+
);
62+
63+
String getTaskStatePageSomeday(
64+
Context context,
65+
Pageable pageRequest,
66+
UserSessionBean userSession,
67+
Locale locale,
68+
Model model
69+
);
70+
71+
String getTaskStatePageCompleted(
72+
Context context,
73+
Pageable pageRequest,
74+
UserSessionBean userSession,
75+
Locale locale,
76+
Model model
77+
);
78+
79+
String getTaskStatePageTrash(
80+
Context context,
81+
Pageable pageRequest,
82+
UserSessionBean userSession,
83+
Locale locale,
84+
Model model
85+
);
86+
87+
String getTaskStatePageDeleted(
88+
Context context,
89+
Pageable pageRequest,
90+
UserSessionBean userSession,
91+
Locale locale,
92+
Model model
93+
);
94+
95+
String getTaskStatePageProjects(
1596
Context context,
1697
Pageable pageRequest,
1798
UserSessionBean userSession,

0 commit comments

Comments
 (0)