
Merge branch 'upgrade/play-2.3' of dlab/hive
from pull-request 1377 * refs/heads/upgrade/play-2.3: Upgrade Play from 2.2.6 to 2.3.6 ProjectApp: Fix the incorrect status code for label test: Fix url encoding bug test: Fix RuntimeExceptions Upgrade Play from 2.1.0 to 2.2.6 Reviewed-by: 이희구
@94fa59f93b5593a7a747c206344b38e12b76eddf
--- README.md
+++ README.md
... | ... | @@ -31,25 +31,25 @@ |
31 | 31 |
|
32 | 32 |
JDK version 7(1.7) is required. |
33 | 33 |
|
34 |
-### Download playframework |
|
34 |
+### Download Play Activator |
|
35 | 35 |
|
36 |
- curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
36 |
+ curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
37 | 37 |
|
38 | 38 |
or |
39 | 39 |
|
40 |
- wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
40 |
+ wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
41 | 41 |
|
42 | 42 |
or using web browser (for windows) |
43 | 43 |
|
44 |
- http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
44 |
+ http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
45 | 45 |
|
46 | 46 |
### Unzip |
47 | 47 |
|
48 |
- unzip play-2.1.0.zip |
|
48 |
+ unzip typesafe-activator-1.2.10-minimal.zip |
|
49 | 49 |
|
50 | 50 |
### Change directory to unzipped directory |
51 | 51 |
|
52 |
- cd play-2.1.0 |
|
52 |
+ cd typesafe-activator-1.2.10-minimal |
|
53 | 53 |
|
54 | 54 |
### Download Yobi |
55 | 55 |
|
... | ... | @@ -66,19 +66,19 @@ |
66 | 66 |
|
67 | 67 |
**Caution! in case2, You might come across troubles when you try to upgrade Yobi.** |
68 | 68 |
|
69 |
-> You can locate your own Yobi directory in any other place. Please note that you must add playframework home path to $PATH environment in that case. |
|
69 |
+> You can locate your own Yobi directory in any other place. Please note that you must add Play Activator home path to $PATH environment in that case. |
|
70 | 70 |
|
71 | 71 |
### Change directory to cloned Yobi directory (or cd to your unzipped file directory) |
72 | 72 |
|
73 | 73 |
cd yobi |
74 | 74 |
|
75 |
-### Run play framework |
|
75 |
+### Run Play Activator |
|
76 | 76 |
|
77 |
- ../play |
|
77 |
+ ../activator |
|
78 | 78 |
|
79 | 79 |
or (for windows) |
80 | 80 |
|
81 |
- ..\play |
|
81 |
+ ..\activator |
|
82 | 82 |
|
83 | 83 |
Required files will be download automatically. In the first time, it may take about 10 min or more. |
84 | 84 |
|
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 |
Also, you can configure start options. |
95 | 95 |
If your system's memory is over than 4G, we recommend to use follow options. |
96 | 96 |
|
97 |
- _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000" |
|
97 |
+ _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000" |
|
98 | 98 |
|
99 | 99 |
### Connect with browser |
100 | 100 |
|
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 |
|
103 | 103 |
If you want to change port, check your permission to use 80 port |
104 | 104 |
|
105 |
-See [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production) |
|
105 |
+See [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production) |
|
106 | 106 |
|
107 | 107 |
### Upgrade Yobi |
108 | 108 |
|
... | ... | @@ -166,26 +166,25 @@ |
166 | 166 |
|
167 | 167 |
JDK 7(1.7)이어야 합니다. |
168 | 168 |
|
169 |
-### playframework 내려 받기 |
|
169 |
+### Play Activator 내려 받기 |
|
170 | 170 |
|
171 |
- curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
171 |
+ curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
172 | 172 |
|
173 | 173 |
혹은 |
174 | 174 |
|
175 |
- wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
175 |
+ wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
176 | 176 |
|
177 | 177 |
웹 브라우저에서 (이를테면, MS윈도우즈 사용자일 경우) |
178 | 178 |
|
179 |
- http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip |
|
180 |
- |
|
179 |
+ http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip |
|
181 | 180 |
|
182 | 181 |
### 압축풀기 |
183 | 182 |
|
184 |
- unzip play-2.1.0.zip |
|
183 |
+ unzip typesafe-activator-1.2.10-minimal.zip |
|
185 | 184 |
|
186 | 185 |
### 압축을 푼 다음 하위 디렉터리로 이동 |
187 | 186 |
|
188 |
- cd play-2.1.0 |
|
187 |
+ cd typesafe-activator-1.2.10-minimal |
|
189 | 188 |
|
190 | 189 |
### Yobi 소스 내려 받기 |
191 | 190 |
|
... | ... | @@ -199,20 +198,20 @@ |
199 | 198 |
|
200 | 199 |
주의! case2의 경우, 업그레이드를 할 때 문제가 생길 수 있습니다. |
201 | 200 |
|
202 |
-> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 play 실행파일이 있는 playframework 디렉터리를 $PATH 환경변수에 추가해 주세요. |
|
201 |
+> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 activator 실행파일이 있는 Play Activator 디렉터리를 $PATH 환경변수에 추가해 주세요. |
|
203 | 202 |
|
204 | 203 |
### clone 받은 Yobi 디렉터리로 이동 |
205 | 204 |
(혹은 압축을 해제한 디렉터리로 이동) |
206 | 205 |
|
207 | 206 |
cd yobi |
208 | 207 |
|
209 |
-### 상단에 있는 play 실행파일 실행 |
|
208 |
+### 상단에 있는 activator 실행파일 실행 |
|
210 | 209 |
|
211 |
- ../play |
|
210 |
+ ../activator |
|
212 | 211 |
|
213 | 212 |
혹은 (윈도우 사용자일 경우) |
214 | 213 |
|
215 |
- ..\play |
|
214 |
+ ..\activator |
|
216 | 215 |
|
217 | 216 |
실행하면 필요한 파일들을 web에서 내려받습니다. 첫 실행시 네트워크 상황에 따라 10여분 가까이 소요될 수 있습니다. |
218 | 217 |
|
... | ... | @@ -226,7 +225,7 @@ |
226 | 225 |
시작 옵션은 조정가능합니다. 만약 시스템 메모리가 4기가 이상이라면 |
227 | 226 |
아래 옵션으로 실행하는걸 권장합니다. |
228 | 227 |
|
229 |
- _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000" |
|
228 |
+ _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000" |
|
230 | 229 |
|
231 | 230 |
|
232 | 231 |
### 브라우저로 접속 |
... | ... | @@ -234,7 +233,7 @@ |
234 | 233 |
http://127.0.0.1:9000 |
235 | 234 |
|
236 | 235 |
80 포트 등으로 포트를 변경하고 싶을 경우에는 해당 포트가 사용가능한지 확인 한 다음 80 포트를 사용할 수 있는 계정으로 실행합니다. |
237 |
-관련해서는 [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production) 부분을 확인해 주세요. |
|
236 |
+관련해서는 [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production) 부분을 확인해 주세요. |
|
238 | 237 |
|
239 | 238 |
### 업그레이드 하기 |
240 | 239 |
|
--- app/Global.java
+++ app/Global.java
... | ... | @@ -43,6 +43,8 @@ |
43 | 43 |
import play.data.Form; |
44 | 44 |
import play.mvc.*; |
45 | 45 |
import play.mvc.Http.RequestHeader; |
46 |
+import play.mvc.Result; |
|
47 |
+import play.libs.F.Promise; |
|
46 | 48 |
|
47 | 49 |
import utils.AccessControl; |
48 | 50 |
import utils.AccessLogger; |
... | ... | @@ -53,6 +55,7 @@ |
53 | 55 |
import views.html.welcome.restart; |
54 | 56 |
import static play.data.Form.form; |
55 | 57 |
import static play.mvc.Results.badRequest; |
58 |
+ |
|
56 | 59 |
|
57 | 60 |
public class Global extends GlobalSettings { |
58 | 61 |
private static final String[] INITIAL_ENTITY_NAME = {"users", "roles", "siteAdmins"}; |
... | ... | @@ -101,14 +104,14 @@ |
101 | 104 |
private Action<Void> getDefaultAction(final Http.Request request) { |
102 | 105 |
final long start = System.currentTimeMillis(); |
103 | 106 |
return new Action.Simple() { |
104 |
- public Result call(Http.Context ctx) throws Throwable { |
|
107 |
+ public Promise<Result> call(Http.Context ctx) throws Throwable { |
|
105 | 108 |
UserApp.initTokenUser(); |
106 | 109 |
UserApp.updatePreferredLanguage(); |
107 | 110 |
ctx.response().setHeader("Date", DateUtils.formatDate(new Date())); |
108 | 111 |
ctx.response().setHeader("Cache-Control", "no-cache"); |
109 |
- Result result = delegate.call(ctx); |
|
110 |
- AccessLogger.log(request, result, start); |
|
111 |
- return result; |
|
112 |
+ Promise<Result> promise = delegate.call(ctx); |
|
113 |
+ AccessLogger.log(request, promise, start); |
|
114 |
+ return promise; |
|
112 | 115 |
} |
113 | 116 |
}; |
114 | 117 |
} |
... | ... | @@ -116,8 +119,8 @@ |
116 | 119 |
private Action<Void> getRestartAction() { |
117 | 120 |
return new Action.Simple() { |
118 | 121 |
@Override |
119 |
- public Result call(Http.Context ctx) throws Throwable { |
|
120 |
- return ok(restart.render()); |
|
122 |
+ public Promise<Result> call(Http.Context ctx) throws Throwable { |
|
123 |
+ return Promise.pure((Result) ok(restart.render())); |
|
121 | 124 |
} |
122 | 125 |
}; |
123 | 126 |
} |
... | ... | @@ -125,20 +128,20 @@ |
125 | 128 |
private Action<Void> getConfigSecretAction() { |
126 | 129 |
return new Action.Simple() { |
127 | 130 |
@Override |
128 |
- public Result call(Http.Context ctx) throws Throwable { |
|
131 |
+ public Promise<Result> call(Http.Context ctx) throws Throwable { |
|
129 | 132 |
if( ctx.request().method().toLowerCase().equals("post") ) { |
130 | 133 |
Form<User> newSiteAdminUserForm = form(User.class).bindFromRequest(); |
131 | 134 |
|
132 | 135 |
if (hasError(newSiteAdminUserForm)) { |
133 |
- return badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)); |
|
136 |
+ return Promise.pure((Result) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm))); |
|
134 | 137 |
} |
135 | 138 |
|
136 | 139 |
User siteAdmin = SiteAdmin.updateDefaultSiteAdmin(newSiteAdminUserForm.get()); |
137 | 140 |
replaceSiteSecretKey(createSeed(siteAdmin.password)); |
138 | 141 |
isRestartRequired = true; |
139 |
- return ok(restart.render()); |
|
142 |
+ return Promise.pure((Result) ok(restart.render())); |
|
140 | 143 |
} else { |
141 |
- return ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))); |
|
144 |
+ return Promise.pure((Result) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class)))); |
|
142 | 145 |
} |
143 | 146 |
} |
144 | 147 |
|
... | ... | @@ -208,26 +211,26 @@ |
208 | 211 |
} |
209 | 212 |
|
210 | 213 |
@Override |
211 |
- public Result onHandlerNotFound(RequestHeader request) { |
|
214 |
+ public Promise<Result> onHandlerNotFound(RequestHeader request) { |
|
212 | 215 |
AccessLogger.log(request, null, Http.Status.NOT_FOUND); |
213 |
- return Results.notFound(ErrorViews.NotFound.render()); |
|
216 |
+ return Promise.pure((Result) Results.notFound(ErrorViews.NotFound.render())); |
|
214 | 217 |
} |
215 | 218 |
|
216 | 219 |
@Override |
217 |
- public Result onError(RequestHeader request, Throwable t) { |
|
220 |
+ public Promise<Result> onError(RequestHeader request, Throwable t) { |
|
218 | 221 |
AccessLogger.log(request, null, Http.Status.INTERNAL_SERVER_ERROR); |
219 | 222 |
|
220 | 223 |
if (Play.isProd()) { |
221 |
- return Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")); |
|
224 |
+ return Promise.pure((Result) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError"))); |
|
222 | 225 |
} else { |
223 | 226 |
return super.onError(request, t); |
224 | 227 |
} |
225 | 228 |
} |
226 | 229 |
|
227 | 230 |
@Override |
228 |
- public Result onBadRequest(RequestHeader request, String error) { |
|
231 |
+ public Promise<Result> onBadRequest(RequestHeader request, String error) { |
|
229 | 232 |
AccessLogger.log(request, null, Http.Status.BAD_REQUEST); |
230 |
- return badRequest(ErrorViews.BadRequest.render()); |
|
233 |
+ return Promise.pure((Result) badRequest(ErrorViews.BadRequest.render())); |
|
231 | 234 |
} |
232 | 235 |
|
233 | 236 |
} |
--- app/actions/AbstractProjectCheckAction.java
+++ app/actions/AbstractProjectCheckAction.java
... | ... | @@ -29,6 +29,8 @@ |
29 | 29 |
import play.mvc.Action; |
30 | 30 |
import play.mvc.Http.Context; |
31 | 31 |
import play.mvc.Result; |
32 |
+import play.mvc.Result; |
|
33 |
+import play.libs.F.Promise; |
|
32 | 34 |
import utils.AccessControl; |
33 | 35 |
import utils.AccessLogger; |
34 | 36 |
import utils.ErrorViews; |
... | ... | @@ -46,32 +48,38 @@ |
46 | 48 |
*/ |
47 | 49 |
public abstract class AbstractProjectCheckAction<T> extends Action<T> { |
48 | 50 |
@Override |
49 |
- public final Result call(Context context) throws Throwable { |
|
51 |
+ public final Promise<Result> call(Context context) throws Throwable { |
|
50 | 52 |
PathParser parser = new PathParser(context); |
51 | 53 |
String ownerLoginId = parser.getOwnerLoginId(); |
52 | 54 |
String projectName = parser.getProjectName(); |
53 | 55 |
|
54 | 56 |
Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName); |
55 | 57 |
|
58 |
+ Promise<Result> promise; |
|
59 |
+ |
|
56 | 60 |
if (project == null) { |
57 | 61 |
if (UserApp.currentUser() == User.anonymous){ |
58 | 62 |
flash("failed", Messages.get("error.auth.unauthorized.waringMessage")); |
59 |
- return AccessLogger.log(context.request(), |
|
60 |
- forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null); |
|
63 |
+ promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path()))); |
|
64 |
+ } else { |
|
65 |
+ promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound"))); |
|
61 | 66 |
} |
62 |
- return AccessLogger.log(context.request(), |
|
63 |
- forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")), null); |
|
67 |
+ |
|
68 |
+ AccessLogger.log(context.request(), promise, null); |
|
69 |
+ |
|
70 |
+ return promise; |
|
64 | 71 |
} |
65 | 72 |
|
66 | 73 |
if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { |
67 | 74 |
flash("failed", Messages.get("error.auth.unauthorized.waringMessage")); |
68 |
- return AccessLogger.log(context.request(), |
|
69 |
- forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null); |
|
75 |
+ promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path()))); |
|
76 |
+ AccessLogger.log(context.request(), promise, null); |
|
77 |
+ return promise; |
|
70 | 78 |
} |
71 | 79 |
|
72 | 80 |
return call(project, context, parser); |
73 | 81 |
} |
74 | 82 |
|
75 |
- protected abstract Result call(Project project, Context context, PathParser parser) |
|
83 |
+ protected abstract Promise<Result> call(Project project, Context context, PathParser parser) |
|
76 | 84 |
throws Throwable; |
77 | 85 |
} |
--- app/actions/AnonymousCheckAction.java
+++ app/actions/AnonymousCheckAction.java
... | ... | @@ -26,6 +26,8 @@ |
26 | 26 |
import play.mvc.Action; |
27 | 27 |
import play.mvc.Http.Context; |
28 | 28 |
import play.mvc.Result; |
29 |
+import play.mvc.Result; |
|
30 |
+import play.libs.F.Promise; |
|
29 | 31 |
import utils.AccessControl; |
30 | 32 |
import utils.AccessLogger; |
31 | 33 |
import utils.Constants; |
... | ... | @@ -40,7 +42,7 @@ |
40 | 42 |
public class AnonymousCheckAction extends Action<AnonymousCheck> { |
41 | 43 |
|
42 | 44 |
@Override |
43 |
- public Result call(Context context) throws Throwable { |
|
45 |
+ public Promise<Result> call(Context context) throws Throwable { |
|
44 | 46 |
if ((AccessControl.isAnonymousNotAllowed() || configuration.requiresLogin()) && |
45 | 47 |
UserApp.currentUser().isAnonymous()) { |
46 | 48 |
if (configuration.displaysFlashMessage()) { |
... | ... | @@ -48,7 +50,9 @@ |
48 | 50 |
} |
49 | 51 |
String loginFormUrl = routes.UserApp.loginForm().url(); |
50 | 52 |
loginFormUrl += "?redirectUrl=" + context.request().path(); |
51 |
- return AccessLogger.log(context.request(), redirect(loginFormUrl), null); |
|
53 |
+ Promise<Result> promise = Promise.pure(redirect(loginFormUrl)); |
|
54 |
+ AccessLogger.log(context.request(), promise, null); |
|
55 |
+ return promise; |
|
52 | 56 |
} |
53 | 57 |
return delegate.call(context); |
54 | 58 |
} |
--- app/actions/DefaultProjectCheckAction.java
+++ app/actions/DefaultProjectCheckAction.java
... | ... | @@ -24,6 +24,8 @@ |
24 | 24 |
import models.Project; |
25 | 25 |
import play.mvc.Http.Context; |
26 | 26 |
import play.mvc.Result; |
27 |
+import play.mvc.Result; |
|
28 |
+import play.libs.F.Promise; |
|
27 | 29 |
|
28 | 30 |
/** |
29 | 31 |
* Default implementation of {@link AbstractProjectCheckAction}. |
... | ... | @@ -34,7 +36,7 @@ |
34 | 36 |
*/ |
35 | 37 |
public class DefaultProjectCheckAction extends AbstractProjectCheckAction<Void> { |
36 | 38 |
@Override |
37 |
- protected Result call(Project project, Context context, PathParser parser) throws Throwable { |
|
39 |
+ protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable { |
|
38 | 40 |
return this.delegate.call(context); |
39 | 41 |
} |
40 | 42 |
} |
--- app/actions/IsAllowedAction.java
+++ app/actions/IsAllowedAction.java
... | ... | @@ -30,6 +30,8 @@ |
30 | 30 |
import models.resource.ResourceConvertible; |
31 | 31 |
import play.mvc.Http.Context; |
32 | 32 |
import play.mvc.Result; |
33 |
+import play.mvc.Result; |
|
34 |
+import play.libs.F.Promise; |
|
33 | 35 |
import utils.AccessControl; |
34 | 36 |
import utils.AccessLogger; |
35 | 37 |
import utils.ErrorViews; |
... | ... | @@ -47,19 +49,21 @@ |
47 | 49 |
*/ |
48 | 50 |
public class IsAllowedAction extends AbstractProjectCheckAction<IsAllowed> { |
49 | 51 |
@Override |
50 |
- protected Result call(Project project, Context context, PathParser parser) throws Throwable { |
|
52 |
+ protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable { |
|
51 | 53 |
ResourceType resourceType = this.configuration.resourceType(); |
52 | 54 |
ResourceConvertible resourceObject = Resource.getResourceObject(parser, project, resourceType); |
53 | 55 |
Operation operation = this.configuration.value(); |
54 | 56 |
|
55 | 57 |
if(resourceObject == null) { |
56 |
- return AccessLogger.log(context.request(), |
|
57 |
- notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())) , null); |
|
58 |
+ Promise<Result> promise = Promise.pure((Result) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource()))); |
|
59 |
+ AccessLogger.log(context.request(), promise, null); |
|
60 |
+ return promise; |
|
58 | 61 |
} |
59 | 62 |
|
60 | 63 |
if(!AccessControl.isAllowed(UserApp.currentUser(), resourceObject.asResource(), operation)) { |
61 |
- return AccessLogger.log(context.request(), |
|
62 |
- forbidden(ErrorViews.Forbidden.render("error.forbidden", project)), null); |
|
64 |
+ Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project))); |
|
65 |
+ AccessLogger.log(context.request(), promise, null); |
|
66 |
+ return promise; |
|
63 | 67 |
} |
64 | 68 |
|
65 | 69 |
return this.delegate.call(context); |
--- app/actions/IsCreatableAction.java
+++ app/actions/IsCreatableAction.java
... | ... | @@ -24,6 +24,8 @@ |
24 | 24 |
import models.User; |
25 | 25 |
import play.mvc.Http.Context; |
26 | 26 |
import play.mvc.Result; |
27 |
+import play.mvc.Result; |
|
28 |
+import play.libs.F.Promise; |
|
27 | 29 |
import utils.AccessControl; |
28 | 30 |
import utils.AccessLogger; |
29 | 31 |
import utils.ErrorViews; |
... | ... | @@ -41,12 +43,12 @@ |
41 | 43 |
*/ |
42 | 44 |
public class IsCreatableAction extends AbstractProjectCheckAction<IsCreatable> { |
43 | 45 |
@Override |
44 |
- protected Result call(Project project, Context context, PathParser parser) throws Throwable { |
|
46 |
+ protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable { |
|
45 | 47 |
User currentUser = UserApp.currentUser(); |
46 | 48 |
if (!AccessControl.isProjectResourceCreatable(currentUser, project, this.configuration.value())) { |
47 |
- return AccessLogger.log(context.request() |
|
48 |
- , forbidden(ErrorViews.Forbidden.render("error.forbidden", project)) |
|
49 |
- , null); |
|
49 |
+ Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project))); |
|
50 |
+ AccessLogger.log(context.request(), promise, null); |
|
51 |
+ return promise; |
|
50 | 52 |
} |
51 | 53 |
|
52 | 54 |
return this.delegate.call(context); |
--- app/actions/IsOnlyGitAvailableAction.java
+++ app/actions/IsOnlyGitAvailableAction.java
... | ... | @@ -25,6 +25,8 @@ |
25 | 25 |
import models.Project; |
26 | 26 |
import play.mvc.Http.Context; |
27 | 27 |
import play.mvc.Result; |
28 |
+import play.mvc.Result; |
|
29 |
+import play.libs.F.Promise; |
|
28 | 30 |
import utils.AccessLogger; |
29 | 31 |
import utils.ErrorViews; |
30 | 32 |
|
... | ... | @@ -38,9 +40,11 @@ |
38 | 40 |
*/ |
39 | 41 |
public class IsOnlyGitAvailableAction extends AbstractProjectCheckAction<IsOnlyGitAvailable> { |
40 | 42 |
@Override |
41 |
- protected Result call(Project project, Context context, PathParser parser) throws Throwable { |
|
43 |
+ protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable { |
|
42 | 44 |
if(!project.isGit()) { |
43 |
- return AccessLogger.log(context.request(), badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")), null); |
|
45 |
+ Promise<Result> promise = Promise.pure((Result) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git"))); |
|
46 |
+ AccessLogger.log(context.request(), promise, null); |
|
47 |
+ return promise; |
|
44 | 48 |
} |
45 | 49 |
|
46 | 50 |
return this.delegate.call(context); |
--- app/actions/NullProjectCheckAction.java
+++ app/actions/NullProjectCheckAction.java
... | ... | @@ -28,6 +28,8 @@ |
28 | 28 |
import play.mvc.Action; |
29 | 29 |
import play.mvc.Http; |
30 | 30 |
import play.mvc.Result; |
31 |
+import play.mvc.Result; |
|
32 |
+import play.libs.F.Promise; |
|
31 | 33 |
import utils.AccessLogger; |
32 | 34 |
import utils.ErrorViews; |
33 | 35 |
|
... | ... | @@ -43,7 +45,7 @@ |
43 | 45 |
public class NullProjectCheckAction extends Action<Void> { |
44 | 46 |
|
45 | 47 |
@Override |
46 |
- public Result call(Http.Context context) throws Throwable { |
|
48 |
+ public Promise<Result> call(Http.Context context) throws Throwable { |
|
47 | 49 |
PathParser parser = new PathParser(context); |
48 | 50 |
String ownerLoginId = parser.getOwnerLoginId(); |
49 | 51 |
String projectName = parser.getProjectName(); |
... | ... | @@ -51,13 +53,18 @@ |
51 | 53 |
Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName); |
52 | 54 |
|
53 | 55 |
if (project == null) { |
56 |
+ Promise<Result> promise; |
|
57 |
+ |
|
54 | 58 |
if (UserApp.currentUser() == User.anonymous){ |
55 | 59 |
flash("failed", Messages.get("error.auth.unauthorized.waringMessage")); |
56 |
- return AccessLogger.log(context.request(), |
|
57 |
- forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())), null); |
|
60 |
+ promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path()))); |
|
61 |
+ } else { |
|
62 |
+ promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound"))); |
|
58 | 63 |
} |
59 |
- return AccessLogger.log(context.request(), |
|
60 |
- forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")), null); |
|
64 |
+ |
|
65 |
+ AccessLogger.log(context.request(), promise, null); |
|
66 |
+ |
|
67 |
+ return promise; |
|
61 | 68 |
} |
62 | 69 |
|
63 | 70 |
return this.delegate.call(context); |
--- app/controllers/Application.java
+++ app/controllers/Application.java
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 |
import playRepository.RepositoryService; |
29 | 29 |
import views.html.error.notfound_default; |
30 | 30 |
import views.html.index.index; |
31 |
+import jsmessages.JsMessages; |
|
31 | 32 |
|
32 | 33 |
import java.io.File; |
33 | 34 |
|
... | ... | @@ -56,8 +57,10 @@ |
56 | 57 |
return redirect(routes.Application.index()); |
57 | 58 |
} |
58 | 59 |
|
60 |
+ static final JsMessages messages = JsMessages.create(play.Play.application()); |
|
61 |
+ |
|
59 | 62 |
public static Result jsMessages() { |
60 |
- return ok(jsmessages.JsMessages.generate("Messages")).as("application/javascript"); |
|
63 |
+ return ok(messages.generate("Messages")).as("application/javascript"); |
|
61 | 64 |
} |
62 | 65 |
|
63 | 66 |
private static void makeUploadFolder() { |
--- app/controllers/AttachmentApp.java
+++ app/controllers/AttachmentApp.java
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 |
import models.enumeration.Operation; |
27 | 27 |
import models.enumeration.ResourceType; |
28 | 28 |
import org.apache.commons.lang3.StringUtils; |
29 |
-import org.codehaus.jackson.JsonNode; |
|
29 |
+import com.fasterxml.jackson.databind.JsonNode; |
|
30 | 30 |
import play.Configuration; |
31 | 31 |
import play.Logger; |
32 | 32 |
import play.mvc.Controller; |
--- app/controllers/BoardApp.java
+++ app/controllers/BoardApp.java
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
import models.enumeration.ResourceType; |
34 | 34 |
|
35 | 35 |
import org.apache.commons.lang3.StringUtils; |
36 |
-import org.codehaus.jackson.node.ObjectNode; |
|
36 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
37 | 37 |
|
38 | 38 |
import play.data.Form; |
39 | 39 |
import play.db.ebean.Transactional; |
--- app/controllers/CodeApp.java
+++ app/controllers/CodeApp.java
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
import org.apache.commons.io.FilenameUtils; |
29 | 29 |
import org.apache.tika.Tika; |
30 | 30 |
import org.apache.tika.mime.MediaType; |
31 |
-import org.codehaus.jackson.node.ObjectNode; |
|
31 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
32 | 32 |
import org.eclipse.jgit.api.errors.GitAPIException; |
33 | 33 |
import org.tmatesoft.svn.core.SVNException; |
34 | 34 |
import play.mvc.*; |
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 |
List<ObjectNode> recursiveData = new ArrayList<>(); |
101 | 101 |
List<String> branches = repository.getBranchNames(); |
102 | 102 |
|
103 |
- if(fileInfo.get("type").getTextValue().equals("folder") && !path.equals("")){ |
|
103 |
+ if(fileInfo.get("type").textValue().equals("folder") && !path.equals("")){ |
|
104 | 104 |
recursiveData.addAll(RepositoryService.getMetaDataFromAncestorDirectories(repository, branch, path)); |
105 | 105 |
} |
106 | 106 |
recursiveData.add(fileInfo); |
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
... | ... | @@ -33,8 +33,8 @@ |
33 | 33 |
import models.enumeration.State; |
34 | 34 |
import org.apache.commons.lang3.StringUtils; |
35 | 35 |
import org.apache.tika.Tika; |
36 |
-import org.codehaus.jackson.node.ObjectNode; |
|
37 |
-import play.api.templates.Html; |
|
36 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
37 |
+import play.twirl.api.Html; |
|
38 | 38 |
import play.data.Form; |
39 | 39 |
import play.data.validation.ValidationError; |
40 | 40 |
import play.db.ebean.Transactional; |
--- app/controllers/OrganizationApp.java
+++ app/controllers/OrganizationApp.java
... | ... | @@ -26,8 +26,8 @@ |
26 | 26 |
import models.enumeration.Operation; |
27 | 27 |
import models.enumeration.RequestState; |
28 | 28 |
import models.enumeration.RoleType; |
29 |
-import org.codehaus.jackson.JsonNode; |
|
30 |
-import org.codehaus.jackson.node.ObjectNode; |
|
29 |
+import com.fasterxml.jackson.databind.JsonNode; |
|
30 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
31 | 31 |
import play.data.Form; |
32 | 32 |
import play.data.validation.Validation; |
33 | 33 |
import play.db.ebean.Transactional; |
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 |
import org.apache.commons.lang.exception.ExceptionUtils; |
36 | 36 |
import org.apache.commons.lang3.StringUtils; |
37 | 37 |
import org.apache.commons.mail.HtmlEmail; |
38 |
-import org.codehaus.jackson.node.ObjectNode; |
|
38 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
39 | 39 |
import org.eclipse.jgit.api.errors.GitAPIException; |
40 | 40 |
import org.eclipse.jgit.api.errors.NoHeadException; |
41 | 41 |
import org.tmatesoft.svn.core.SVNException; |
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 |
return notFound(ErrorViews.NotFound.render("error.notfound")); |
103 | 103 |
} |
104 | 104 |
|
105 |
- targetProject.overview = request().body().asJson().findPath("overview").getTextValue(); |
|
105 |
+ targetProject.overview = request().body().asJson().findPath("overview").textValue(); |
|
106 | 106 |
targetProject.save(); |
107 | 107 |
|
108 | 108 |
ObjectNode result = Json.newObject(); |
... | ... | @@ -1064,14 +1064,13 @@ |
1064 | 1064 |
if (label == null) { |
1065 | 1065 |
// Create new label if there is no label which has the given name. |
1066 | 1066 |
label = new Label(category, name); |
1067 |
- label.projects.add(project); |
|
1068 | 1067 |
label.save(); |
1069 | 1068 |
isCreated = true; |
1070 | 1069 |
} |
1071 | 1070 |
|
1072 | 1071 |
Boolean isAttached = project.attachLabel(label); |
1073 | 1072 |
|
1074 |
- if (!isCreated && !isAttached) { |
|
1073 |
+ if (isCreated && !isAttached) { |
|
1075 | 1074 |
// Something is wrong. This case is not possible. |
1076 | 1075 |
play.Logger.warn( |
1077 | 1076 |
"A label '" + label + "' is created but failed to attach to project '" + project + "'."); |
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
... | ... | @@ -23,34 +23,37 @@ |
23 | 23 |
import actors.PullRequestMergingActor; |
24 | 24 |
import akka.actor.Props; |
25 | 25 |
import com.avaje.ebean.Page; |
26 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
26 | 27 |
import controllers.annotation.AnonymousCheck; |
27 | 28 |
import controllers.annotation.IsAllowed; |
28 | 29 |
import controllers.annotation.IsCreatable; |
29 | 30 |
import controllers.annotation.IsOnlyGitAvailable; |
31 |
+import errors.PullRequestException; |
|
30 | 32 |
import models.*; |
31 | 33 |
import models.enumeration.Operation; |
32 | 34 |
import models.enumeration.ResourceType; |
33 | 35 |
import models.enumeration.RoleType; |
34 | 36 |
import models.enumeration.State; |
35 | 37 |
import org.apache.commons.lang3.StringUtils; |
36 |
-import org.codehaus.jackson.node.ObjectNode; |
|
37 | 38 |
import org.eclipse.jgit.api.errors.GitAPIException; |
38 | 39 |
import org.tmatesoft.svn.core.SVNException; |
39 | 40 |
import play.api.mvc.Call; |
40 | 41 |
import play.data.Form; |
41 | 42 |
import play.db.ebean.Transactional; |
42 | 43 |
import play.libs.Akka; |
44 |
+import play.libs.F; |
|
43 | 45 |
import play.libs.F.Function; |
44 | 46 |
import play.libs.F.Promise; |
45 | 47 |
import play.libs.Json; |
46 | 48 |
import play.mvc.Controller; |
47 | 49 |
import play.mvc.Result; |
50 |
+import play.mvc.Result; |
|
48 | 51 |
import playRepository.GitBranch; |
49 | 52 |
import playRepository.GitRepository; |
50 | 53 |
import playRepository.RepositoryService; |
51 | 54 |
import utils.*; |
52 |
-import views.html.git.*; |
|
53 | 55 |
import views.html.error.notfound; |
56 |
+import views.html.git.*; |
|
54 | 57 |
|
55 | 58 |
import javax.servlet.ServletException; |
56 | 59 |
import java.io.IOException; |
... | ... | @@ -60,7 +63,6 @@ |
60 | 63 |
import java.util.ArrayList; |
61 | 64 |
import java.util.List; |
62 | 65 |
import java.util.Map; |
63 |
-import java.util.concurrent.Callable; |
|
64 | 66 |
|
65 | 67 |
@IsOnlyGitAvailable |
66 | 68 |
@AnonymousCheck |
... | ... | @@ -281,7 +283,7 @@ |
281 | 283 |
|
282 | 284 |
PullRequestEventMessage message = new PullRequestEventMessage( |
283 | 285 |
UserApp.currentUser(), request(), pullRequest); |
284 |
- Akka.system().actorOf(new Props(PullRequestMergingActor.class)).tell(message, null); |
|
286 |
+ Akka.system().actorOf(Props.create(PullRequestMergingActor.class)).tell(message, null); |
|
285 | 287 |
|
286 | 288 |
return redirect(pullRequestCall); |
287 | 289 |
} |
... | ... | @@ -378,13 +380,13 @@ |
378 | 380 |
long pullRequestNumber, String commitId) { |
379 | 381 |
Project project = Project.findByOwnerAndProjectName(userName, projectName); |
380 | 382 |
PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber); |
381 |
- return ok(viewChanges.render(project, pullRequest, commitId)); |
|
383 |
+ return ok(views.html.git.viewChanges.render(project, pullRequest, commitId)); |
|
382 | 384 |
} |
383 | 385 |
|
384 | 386 |
@Transactional |
385 | 387 |
@AnonymousCheck(requiresLogin = true, displaysFlashMessage = true) |
386 | 388 |
@IsAllowed(value = Operation.ACCEPT, resourceType = ResourceType.PULL_REQUEST) |
387 |
- public static Result accept(final String userName, final String projectName, |
|
389 |
+ public static Promise<Result> accept(final String userName, final String projectName, |
|
388 | 390 |
final long pullRequestNumber) { |
389 | 391 |
Project project = Project.findByOwnerAndProjectName(userName, projectName); |
390 | 392 |
final PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber); |
... | ... | @@ -397,27 +399,29 @@ |
397 | 399 |
UserApp.currentUser(), request(), project, pullRequest.toBranch); |
398 | 400 |
|
399 | 401 |
if(project.isUsingReviewerCount && !pullRequest.isReviewed()) { |
400 |
- return badRequest(ErrorViews.BadRequest.render("pullRequest.not.enough.review.point")); |
|
402 |
+ return Promise.pure((Result) badRequest( |
|
403 |
+ ErrorViews.BadRequest.render("pullRequest.not.enough.review.point"))); |
|
401 | 404 |
} |
402 | 405 |
|
403 |
- Promise<Void> promise = Akka.future(new Callable<Void>() { |
|
404 |
- @Override |
|
405 |
- public Void call() throws Exception { |
|
406 |
- pullRequest.merge(message); |
|
407 |
- // mark the end of the merge |
|
408 |
- pullRequest.endMerge(); |
|
409 |
- pullRequest.update(); |
|
410 |
- return null; |
|
411 |
- } |
|
412 |
- }); |
|
406 |
+ Promise<Void> promise = Promise.promise( |
|
407 |
+ new F.Function0<Void>() { |
|
408 |
+ public Void apply() throws Exception { |
|
409 |
+ pullRequest.merge(message); |
|
410 |
+ // mark the end of the merge |
|
411 |
+ pullRequest.endMerge(); |
|
412 |
+ pullRequest.update(); |
|
413 |
+ return null; |
|
414 |
+ } |
|
415 |
+ } |
|
416 |
+ ); |
|
413 | 417 |
|
414 |
- return async(promise.map(new Function<Void, Result>() { |
|
418 |
+ return promise.map(new Function<Void, Result>() { |
|
415 | 419 |
@Override |
416 | 420 |
public Result apply(Void v) throws Throwable { |
417 | 421 |
return redirect(routes.PullRequestApp.pullRequest(userName, projectName, |
418 | 422 |
pullRequestNumber)); |
419 | 423 |
} |
420 |
- })); |
|
424 |
+ }); |
|
421 | 425 |
} |
422 | 426 |
|
423 | 427 |
private static void addNotification(PullRequest pullRequest, State from, State to) { |
... | ... | @@ -460,7 +464,7 @@ |
460 | 464 |
|
461 | 465 |
PullRequestEventMessage message = new PullRequestEventMessage( |
462 | 466 |
UserApp.currentUser(), request(), pullRequest); |
463 |
- Akka.system().actorOf(new Props(PullRequestMergingActor.class)).tell(message, null); |
|
467 |
+ Akka.system().actorOf(Props.create(PullRequestMergingActor.class)).tell(message, null); |
|
464 | 468 |
|
465 | 469 |
return redirect(call); |
466 | 470 |
} |
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 |
import org.apache.shiro.crypto.SecureRandomNumberGenerator; |
33 | 33 |
import org.apache.shiro.crypto.hash.Sha256Hash; |
34 | 34 |
import org.apache.shiro.util.ByteSource; |
35 |
-import org.codehaus.jackson.node.ObjectNode; |
|
35 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
36 | 36 |
import play.Configuration; |
37 | 37 |
import play.Logger; |
38 | 38 |
import play.Play; |
--- app/models/Attachment.java
+++ app/models/Attachment.java
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 |
import play.db.ebean.Model; |
55 | 55 |
import play.libs.Akka; |
56 | 56 |
import scala.concurrent.duration.Duration; |
57 |
-import scalax.file.NotDirectoryException; |
|
57 |
+import java.nio.file.NotDirectoryException; |
|
58 | 58 |
import utils.FileUtil; |
59 | 59 |
import utils.JodaDateUtil; |
60 | 60 |
|
--- app/models/Email.java
+++ app/models/Email.java
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 |
this.token = RandomStringUtils.randomNumeric(50); |
107 | 107 |
this.confirmUrl = Url.create(routes.UserApp.confirmEmail(this.id, this.token).url()); |
108 | 108 |
update(); |
109 |
- Akka.system().actorOf(new Props(ValidationEmailSender.class)).tell(this, null); |
|
109 |
+ Akka.system().actorOf(Props.create(ValidationEmailSender.class)).tell(this, null); |
|
110 | 110 |
} |
111 | 111 |
|
112 | 112 |
public static Email findByEmail(String email, boolean isValid) { |
--- app/models/Project.java
+++ app/models/Project.java
... | ... | @@ -427,14 +427,14 @@ |
427 | 427 |
} |
428 | 428 |
|
429 | 429 |
public Boolean attachLabel(Label label) { |
430 |
- if (labels.contains(label)) { |
|
430 |
+ if (label.projects.contains(this)) { |
|
431 | 431 |
// Return false if the label has been already attached. |
432 | 432 |
return false; |
433 | 433 |
} |
434 | 434 |
|
435 |
- // Attach new label. |
|
436 |
- labels.add(label); |
|
437 |
- update(); |
|
435 |
+ // Attach new label. I don't know why labels.add(label) does not work. |
|
436 |
+ label.projects.add(this); |
|
437 |
+ label.update(); |
|
438 | 438 |
|
439 | 439 |
return true; |
440 | 440 |
} |
--- app/models/PullRequest.java
+++ app/models/PullRequest.java
... | ... | @@ -560,7 +560,7 @@ |
560 | 560 |
NotificationEvent.afterPullRequestUpdated(sender, this, State.OPEN, State.MERGED); |
561 | 561 |
PullRequestEvent.addStateEvent(sender, this, State.MERGED); |
562 | 562 |
|
563 |
- Akka.system().actorOf(new Props(RelatedPullRequestMergingActor.class)).tell(message, null); |
|
563 |
+ Akka.system().actorOf(Props.create(RelatedPullRequestMergingActor.class)).tell(message, null); |
|
564 | 564 |
} |
565 | 565 |
} |
566 | 566 |
|
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
... | ... | @@ -33,8 +33,8 @@ |
33 | 33 |
import org.apache.commons.lang3.StringUtils; |
34 | 34 |
import org.apache.tika.Tika; |
35 | 35 |
import org.apache.tika.metadata.Metadata; |
36 |
-import org.codehaus.jackson.JsonNode; |
|
37 |
-import org.codehaus.jackson.node.ObjectNode; |
|
36 |
+import com.fasterxml.jackson.databind.JsonNode; |
|
37 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
38 | 38 |
import org.eclipse.jgit.api.Git; |
39 | 39 |
import org.eclipse.jgit.api.LogCommand; |
40 | 40 |
import org.eclipse.jgit.api.errors.GitAPIException; |
--- app/playRepository/PlayRepository.java
+++ app/playRepository/PlayRepository.java
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 |
|
23 | 23 |
import models.resource.Resource; |
24 | 24 |
|
25 |
-import org.codehaus.jackson.node.ObjectNode; |
|
25 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
26 | 26 |
import org.eclipse.jgit.api.errors.GitAPIException; |
27 | 27 |
import org.eclipse.jgit.lib.Repository; |
28 | 28 |
import org.tigris.subversion.javahl.ClientException; |
--- app/playRepository/RepositoryService.java
+++ app/playRepository/RepositoryService.java
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 |
import controllers.UserApp; |
25 | 25 |
import models.Project; |
26 | 26 |
import models.User; |
27 |
-import org.codehaus.jackson.node.ObjectNode; |
|
27 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
28 | 28 |
import org.eclipse.jgit.api.errors.GitAPIException; |
29 | 29 |
import org.eclipse.jgit.lib.Repository; |
30 | 30 |
import org.eclipse.jgit.transport.*; |
--- app/playRepository/SVNRepository.java
+++ app/playRepository/SVNRepository.java
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
import models.resource.Resource; |
29 | 29 |
import org.apache.commons.io.FileUtils; |
30 | 30 |
import org.apache.tika.Tika; |
31 |
-import org.codehaus.jackson.node.ObjectNode; |
|
31 |
+import com.fasterxml.jackson.databind.node.ObjectNode; |
|
32 | 32 |
import org.eclipse.jgit.api.errors.GitAPIException; |
33 | 33 |
import org.eclipse.jgit.diff.RawText; |
34 | 34 |
import org.joda.time.format.DateTimeFormatter; |
--- app/playRepository/hooks/IssueReferredFromCommitEvent.java
+++ app/playRepository/hooks/IssueReferredFromCommitEvent.java
... | ... | @@ -47,6 +47,6 @@ |
47 | 47 |
@Override |
48 | 48 |
public void onPostReceive(ReceivePack receivePack, Collection<ReceiveCommand> commands) { |
49 | 49 |
PostReceiveMessage message = new PostReceiveMessage(commands, project, user); |
50 |
- Akka.system().actorOf(new Props(IssueReferredFromCommitEventActor.class)).tell(message, null); |
|
50 |
+ Akka.system().actorOf(Props.create(IssueReferredFromCommitEventActor.class)).tell(message, null); |
|
51 | 51 |
} |
52 | 52 |
} |
--- app/playRepository/hooks/NotifyPushedCommits.java
+++ app/playRepository/hooks/NotifyPushedCommits.java
... | ... | @@ -47,6 +47,6 @@ |
47 | 47 |
@Override |
48 | 48 |
public void onPostReceive(ReceivePack receivePack, Collection<ReceiveCommand> commands) { |
49 | 49 |
PostReceiveMessage message = new PostReceiveMessage(commands, project, user); |
50 |
- Akka.system().actorOf(new Props(CommitsNotificationActor.class)).tell(message, null); |
|
50 |
+ Akka.system().actorOf(Props.create(CommitsNotificationActor.class)).tell(message, null); |
|
51 | 51 |
} |
52 | 52 |
} |
--- app/playRepository/hooks/PullRequestCheck.java
+++ app/playRepository/hooks/PullRequestCheck.java
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 |
Set<String> branches = ReceiveCommandUtil.getUpdatedBranches(commands); |
55 | 55 |
for (String branch : branches) { |
56 | 56 |
PullRequestEventMessage message = new PullRequestEventMessage(user, request, project, branch); |
57 |
- Akka.system().actorOf(new Props(RelatedPullRequestMergingActor.class)).tell(message, null); |
|
57 |
+ Akka.system().actorOf(Props.create(RelatedPullRequestMergingActor.class)).tell(message, null); |
|
58 | 58 |
} |
59 | 59 |
|
60 | 60 |
Set<String> deletedBranches = ReceiveCommandUtil.getDeletedBranches(commands); |
--- app/utils/AccessLogger.java
+++ app/utils/AccessLogger.java
... | ... | @@ -22,9 +22,6 @@ |
22 | 22 |
|
23 | 23 |
import controllers.UserApp; |
24 | 24 |
import org.apache.commons.lang3.StringEscapeUtils; |
25 |
-import play.api.mvc.AsyncResult; |
|
26 |
-import play.api.mvc.PlainResult; |
|
27 |
-import play.libs.Akka; |
|
28 | 25 |
import play.libs.F.Callback; |
29 | 26 |
import play.libs.F.Promise; |
30 | 27 |
import play.mvc.Http; |
... | ... | @@ -89,31 +86,16 @@ |
89 | 86 |
* @see <a href="http://httpd.apache.org/docs/2.2/en/logs.html#combined">Combined Log Format - Apache HTTP Server</a> |
90 | 87 |
* @see <a href="http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats">Custom Log Formats - Apache HTTP Server</a> |
91 | 88 |
*/ |
92 |
- public static Result log(final Http.Request request, final Result result, |
|
89 |
+ public static void log(final Http.Request request, final Promise<Result> promise, |
|
93 | 90 |
final Long startTimeMillis) { |
94 |
- if (result.getWrappedResult() instanceof PlainResult) { |
|
95 |
- int status = ((PlainResult) result.getWrappedResult()).header().status(); |
|
96 |
- log(request, UserApp.currentUser().loginId, status, startTimeMillis); |
|
97 |
- } else if (result.getWrappedResult() instanceof AsyncResult) { |
|
98 |
- AsyncResult asyncResult = (AsyncResult) result.getWrappedResult(); |
|
99 |
- Promise<play.api.mvc.Result> promise = Akka.asPromise(asyncResult.result()); |
|
100 |
- promise.onRedeem(new Callback<play.api.mvc.Result>() { |
|
101 |
- @Override |
|
102 |
- public void invoke(final play.api.mvc.Result result) throws Throwable { |
|
103 |
- log(request, wrapResult(result), startTimeMillis); |
|
104 |
- } |
|
105 |
- }); |
|
106 |
- } |
|
107 |
- return result; |
|
108 |
- } |
|
109 |
- |
|
110 |
- private static Result wrapResult(final play.api.mvc.Result result) { |
|
111 |
- return new Result() { |
|
91 |
+ final String username = UserApp.currentUser().loginId; |
|
92 |
+ promise.onRedeem(new Callback<Result>() { |
|
112 | 93 |
@Override |
113 |
- public play.api.mvc.Result getWrappedResult() { |
|
114 |
- return result; |
|
94 |
+ public void invoke(final Result result) throws Throwable { |
|
95 |
+ log(request, username, result.toScala().header().status(), |
|
96 |
+ startTimeMillis); |
|
115 | 97 |
} |
116 |
- }; |
|
98 |
+ }); |
|
117 | 99 |
} |
118 | 100 |
|
119 | 101 |
/** |
--- app/utils/BasicAuthAction.java
+++ app/utils/BasicAuthAction.java
... | ... | @@ -29,6 +29,8 @@ |
29 | 29 |
import play.mvc.Http.Request; |
30 | 30 |
import play.mvc.Http.Response; |
31 | 31 |
import play.mvc.Result; |
32 |
+import play.mvc.Result; |
|
33 |
+import play.libs.F.Promise; |
|
32 | 34 |
|
33 | 35 |
import java.io.UnsupportedEncodingException; |
34 | 36 |
|
... | ... | @@ -96,18 +98,18 @@ |
96 | 98 |
} |
97 | 99 |
|
98 | 100 |
@Override |
99 |
- public Result call(Context context) throws Throwable { |
|
101 |
+ public Promise<Result> call(Context context) throws Throwable { |
|
100 | 102 |
User user; |
101 | 103 |
try { |
102 | 104 |
user = authenticate(context.request()); |
103 | 105 |
} catch (MalformedCredentialsException error) { |
104 |
- return AccessLogger.log(context.request() |
|
105 |
- , badRequest() |
|
106 |
- , null); |
|
106 |
+ Promise<Result> promise = Promise.pure((Result) badRequest()); |
|
107 |
+ AccessLogger.log(context.request(), promise, null); |
|
108 |
+ return promise; |
|
107 | 109 |
} catch (UnsupportedEncodingException e) { |
108 |
- return AccessLogger.log(context.request() |
|
109 |
- , internalServerError() |
|
110 |
- , null); |
|
110 |
+ Promise<Result> promise = Promise.pure((Result) internalServerError()); |
|
111 |
+ AccessLogger.log(context.request(), promise, null); |
|
112 |
+ return promise; |
|
111 | 113 |
} |
112 | 114 |
|
113 | 115 |
if (!user.isAnonymous()) { |
--- app/utils/ErrorViews.java
+++ app/utils/ErrorViews.java
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 |
import models.Organization; |
24 | 24 |
import models.Project; |
25 | 25 |
import models.User; |
26 |
-import play.api.templates.Html; |
|
26 |
+import play.twirl.api.Html; |
|
27 | 27 |
import views.html.index.index; |
28 | 28 |
|
29 | 29 |
|
--- app/utils/PlayServletContext.java
+++ app/utils/PlayServletContext.java
... | ... | @@ -302,4 +302,7 @@ |
302 | 302 |
throw new UnsupportedOperationException(); |
303 | 303 |
} |
304 | 304 |
|
305 |
+ public String getVirtualServerName() { |
|
306 |
+ throw new UnsupportedOperationException(); |
|
307 |
+ } |
|
305 | 308 |
} |
--- app/utils/PlayServletRequest.java
+++ app/utils/PlayServletRequest.java
... | ... | @@ -115,6 +115,16 @@ |
115 | 115 |
return Integer.parseInt(contentLength); |
116 | 116 |
} |
117 | 117 |
|
118 |
+ public long getContentLengthLong() { |
|
119 |
+ String contentLength = request.getHeader(Http.HeaderNames.CONTENT_LENGTH); |
|
120 |
+ |
|
121 |
+ if (contentLength == null) { |
|
122 |
+ return -1; |
|
123 |
+ } |
|
124 |
+ |
|
125 |
+ return Long.parseLong(contentLength); |
|
126 |
+ } |
|
127 |
+ |
|
118 | 128 |
@Override |
119 | 129 |
public String getContentType() { |
120 | 130 |
return request.getHeader(Http.HeaderNames.CONTENT_TYPE); |
... | ... | @@ -172,6 +182,18 @@ |
172 | 182 |
protected void finalize() throws Throwable { |
173 | 183 |
close(); |
174 | 184 |
super.finalize(); |
185 |
+ } |
|
186 |
+ |
|
187 |
+ public void setReadListener(javax.servlet.ReadListener readListener) { |
|
188 |
+ throw new UnsupportedOperationException(); |
|
189 |
+ } |
|
190 |
+ |
|
191 |
+ public boolean isReady() { |
|
192 |
+ throw new UnsupportedOperationException(); |
|
193 |
+ } |
|
194 |
+ |
|
195 |
+ public boolean isFinished() { |
|
196 |
+ throw new UnsupportedOperationException(); |
|
175 | 197 |
} |
176 | 198 |
}; |
177 | 199 |
} |
... | ... | @@ -556,4 +578,14 @@ |
556 | 578 |
throw new UnsupportedOperationException(); |
557 | 579 |
} |
558 | 580 |
|
581 |
+ public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> httpUpgradeHandlerClass) |
|
582 |
+ throws java.io.IOException, |
|
583 |
+ ServletException { |
|
584 |
+ throw new UnsupportedOperationException(); |
|
585 |
+ } |
|
586 |
+ |
|
587 |
+ public String changeSessionId() { |
|
588 |
+ throw new UnsupportedOperationException(); |
|
589 |
+ } |
|
590 |
+ |
|
559 | 591 |
} |
--- app/utils/PlayServletResponse.java
+++ app/utils/PlayServletResponse.java
... | ... | @@ -101,6 +101,14 @@ |
101 | 101 |
target.close(); |
102 | 102 |
super.close(); |
103 | 103 |
} |
104 |
+ |
|
105 |
+ public void setWriteListener(WriteListener writeListener) { |
|
106 |
+ throw new UnsupportedOperationException(); |
|
107 |
+ } |
|
108 |
+ |
|
109 |
+ public boolean isReady() { |
|
110 |
+ throw new UnsupportedOperationException(); |
|
111 |
+ } |
|
104 | 112 |
} |
105 | 113 |
|
106 | 114 |
public PlayServletResponse(Response response) throws IOException { |
... | ... | @@ -189,6 +197,10 @@ |
189 | 197 |
@Override |
190 | 198 |
public void setContentLength(int length) { |
191 | 199 |
this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Integer.toString(length)); |
200 |
+ } |
|
201 |
+ |
|
202 |
+ public void setContentLengthLong(long length) { |
|
203 |
+ this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Long.toString(length)); |
|
192 | 204 |
} |
193 | 205 |
|
194 | 206 |
@Override |
... | ... | @@ -380,4 +392,8 @@ |
380 | 392 |
} |
381 | 393 |
return (encoding.trim()); |
382 | 394 |
} |
395 |
+ |
|
396 |
+ public String getVirtualServerName() { |
|
397 |
+ throw new UnsupportedOperationException(); |
|
398 |
+ } |
|
383 | 399 |
} |
--- app/utils/SiteManagerAuthAction.java
+++ app/utils/SiteManagerAuthAction.java
... | ... | @@ -24,17 +24,18 @@ |
24 | 24 |
import play.mvc.Action; |
25 | 25 |
import play.mvc.Http.Context; |
26 | 26 |
import play.mvc.Result; |
27 |
+import play.mvc.Result; |
|
28 |
+import play.libs.F.Promise; |
|
27 | 29 |
|
28 | 30 |
/** |
29 | 31 |
* The Class SiteManagerAuthAction. |
30 | 32 |
*/ |
31 | 33 |
public class SiteManagerAuthAction extends Action.Simple { |
32 | 34 |
@Override |
33 |
- public Result call(Context context) throws Throwable { |
|
35 |
+ public Promise<Result> call(Context context) throws Throwable { |
|
34 | 36 |
if (!UserApp.currentUser().isSiteManager()) { |
35 |
- return forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")); |
|
37 |
+ return Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage"))); |
|
36 | 38 |
} |
37 | 39 |
return delegate.call(context); |
38 | 40 |
} |
39 |
- |
|
40 | 41 |
} |
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 |
import play.api.i18n.Lang |
26 | 26 |
import models.CodeCommentThread |
27 | 27 |
import models.CommentThread |
28 |
-import play.api.templates.Html |
|
28 |
+import play.twirl.api.Html |
|
29 | 29 |
|
30 | 30 |
object TemplateHelper { |
31 | 31 |
|
... | ... | @@ -364,12 +364,12 @@ |
364 | 364 |
def shortId(commitId: String) = commitId.substring(0, Math.min(7, commitId.size)) |
365 | 365 |
|
366 | 366 |
@tailrec |
367 |
- def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.api.templates.Html): play.api.templates.Html = |
|
367 |
+ def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.twirl.api.Html): play.twirl.api.Html = |
|
368 | 368 |
threads match { |
369 | 369 |
case head :: tail => |
370 | 370 |
head match { |
371 | 371 |
case (thread: models.NonRangedCodeCommentThread) |
372 |
- if commitId == null || commitId == thread.commitId => html += partial_comment_thread(thread) |
|
372 |
+ if commitId == null || commitId == thread.commitId => new Html(List(html, partial_comment_thread(thread))) |
|
373 | 373 |
case _ => ; |
374 | 374 |
} |
375 | 375 |
renderNonRangedThreads(tail, commitId, html) |
... | ... | @@ -378,16 +378,16 @@ |
378 | 378 |
|
379 | 379 |
@tailrec |
380 | 380 |
def _renderEventsOnPullRequest(pull: PullRequest, events: List[PullRequestEvent], |
381 |
- html: play.api.templates.Html): play.api.templates.Html = |
|
381 |
+ html: play.twirl.api.Html): play.twirl.api.Html = |
|
382 | 382 |
events match { |
383 | 383 |
case head :: tail => |
384 |
- html += partial_pull_request_event(pull, head) |
|
384 |
+ new Html(List(html, partial_pull_request_event(pull, head))) |
|
385 | 385 |
_renderEventsOnPullRequest(pull, tail, html) |
386 | 386 |
case _ => html |
387 | 387 |
} |
388 | 388 |
|
389 | 389 |
def renderEventsOnPullRequest(pull: PullRequest) = |
390 |
- _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.api.templates.Html("")) |
|
390 |
+ _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.twirl.api.Html("")) |
|
391 | 391 |
|
392 | 392 |
def urlToCommentThread(thread: CommentThread) = { |
393 | 393 |
urlToContainer(thread) + "#thread-" + thread.id |
... | ... | @@ -467,9 +467,9 @@ |
467 | 467 |
} |
468 | 468 |
|
469 | 469 |
object CodeBrowser { |
470 |
- def fieldText(obj:org.codehaus.jackson.JsonNode, field:String):String = { |
|
470 |
+ def fieldText(obj:com.fasterxml.jackson.databind.JsonNode, field:String):String = { |
|
471 | 471 |
if(obj.get(field) != null){ |
472 |
- obj.get(field).getTextValue() |
|
472 |
+ obj.get(field).textValue() |
|
473 | 473 |
} else { |
474 | 474 |
"" |
475 | 475 |
} |
... | ... | @@ -491,7 +491,7 @@ |
491 | 491 |
} |
492 | 492 |
} |
493 | 493 |
|
494 |
- def getAvatar(file:org.codehaus.jackson.JsonNode):String = { |
|
494 |
+ def getAvatar(file:com.fasterxml.jackson.databind.JsonNode):String = { |
|
495 | 495 |
val avatarURL = fieldText(file, "avatar") |
496 | 496 |
|
497 | 497 |
if(avatarURL != null){ |
... | ... | @@ -501,7 +501,7 @@ |
501 | 501 |
} |
502 | 502 |
} |
503 | 503 |
|
504 |
- def getFileClass(file:org.codehaus.jackson.JsonNode):String = { |
|
504 |
+ def getFileClass(file:com.fasterxml.jackson.databind.JsonNode):String = { |
|
505 | 505 |
if(fieldText(file, "name") == ".."){ |
506 | 506 |
"updir" |
507 | 507 |
} else { |
... | ... | @@ -512,12 +512,12 @@ |
512 | 512 |
} |
513 | 513 |
} |
514 | 514 |
|
515 |
- def getFileDate(file:org.codehaus.jackson.JsonNode, field:String)(implicit lang:Lang):String = { |
|
516 |
- JodaDateUtil.momentFromNow(file.get(field).getLongValue, lang.language) |
|
515 |
+ def getFileDate(file:com.fasterxml.jackson.databind.JsonNode, field:String)(implicit lang:Lang):String = { |
|
516 |
+ JodaDateUtil.momentFromNow(file.get(field).longValue, lang.language) |
|
517 | 517 |
} |
518 | 518 |
|
519 |
- def getFileAgoOrDate(file:org.codehaus.jackson.JsonNode, field:String) = { |
|
520 |
- agoOrDateString(new java.util.Date(file.get(field).getLongValue)) |
|
519 |
+ def getFileAgoOrDate(file:com.fasterxml.jackson.databind.JsonNode, field:String) = { |
|
520 |
+ agoOrDateString(new java.util.Date(file.get(field).longValue)) |
|
521 | 521 |
} |
522 | 522 |
|
523 | 523 |
def getCorrectedPath(filePath:String, fileName:String):String = { |
... | ... | @@ -528,7 +528,7 @@ |
528 | 528 |
} |
529 | 529 |
} |
530 | 530 |
|
531 |
- def getFileRev(vcsType:String, file:org.codehaus.jackson.JsonNode):String = { |
|
531 |
+ def getFileRev(vcsType:String, file:com.fasterxml.jackson.databind.JsonNode):String = { |
|
532 | 532 |
vcsType match { |
533 | 533 |
case "GIT" => fieldText(file,"commitId") |
534 | 534 |
case "Subversion" => fieldText(file, "revisionNo") |
--- app/views/board/create.scala.html
+++ app/views/board/create.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, form:Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "") |
|
21 |
+@(title:String, form: play.data.Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "") |
|
22 | 22 |
|
23 | 23 |
@import utils.AccessControl._ |
24 | 24 |
@import utils.TemplateHelper._ |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
@implicitField = @{ helper.FieldConstructor(simpleForm) } |
28 | 28 |
|
29 | 29 |
@readmeUpdateMessage = @{ |
30 |
- if( request().getQueryString("readme") != null ) { |
|
30 |
+ if( requestHeader.getQueryString("readme") != null ) { |
|
31 | 31 |
"Update README.md" |
32 | 32 |
} |
33 | 33 |
} |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 |
@** end of fileUploader **@ |
67 | 67 |
|
68 | 68 |
<div class="right-txt mt10 mb10"> |
69 |
- @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){ |
|
69 |
+ @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){ |
|
70 | 70 |
<label class="checkbox"> |
71 | 71 |
<input type="checkbox" id="notice" name="notice"> |
72 | 72 |
@Messages("post.notice.label") |
... | ... | @@ -74,9 +74,9 @@ |
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
@if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.COMMIT)){ |
77 |
- @if(project.isGit && stringToBoolean(request().getQueryString("readme"))){ |
|
77 |
+ @if(project.isGit && stringToBoolean(requestHeader.getQueryString("readme").get)){ |
|
78 | 78 |
<label class="checkbox"> |
79 |
- <input type="checkbox" id="readme" name="readme" @boolToCheckedString(request().getQueryString("readme"))> |
|
79 |
+ <input type="checkbox" id="readme" name="readme" @boolToCheckedString(requestHeader.getQueryString("readme"))> |
|
80 | 80 |
@Messages("post.readmefy") |
81 | 81 |
</label> |
82 | 82 |
} |
--- app/views/board/edit.scala.html
+++ app/views/board/edit.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, form:Form[Posting], posting:Posting, number:Long, project:Project, isAllowedToNotice:Boolean) |
|
21 |
+@(title:String, form: play.data.Form[Posting], posting:Posting, number:Long, project:Project, isAllowedToNotice:Boolean) |
|
22 | 22 |
|
23 | 23 |
@import utils.AccessControl._ |
24 | 24 |
@import utils.TemplateHelper._ |
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 |
@** end of fileUploader **@ |
61 | 61 |
|
62 | 62 |
<div class="right-txt mt10 mb10"> |
63 |
- @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){ |
|
63 |
+ @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){ |
|
64 | 64 |
@helper.input(form("notice")){(id, name, value, args) => |
65 | 65 |
<label class="checkbox"> |
66 | 66 |
<input type="checkbox" id="notice" name="notice" @toHtmlArgs(args) @(if(value.equals(Some("true"))) "checked" else "")/> |
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(post:Posting, commentForm:Form[PostingComment], project:Project) |
|
21 |
+@(post:Posting, commentForm: play.data.Form[PostingComment], project:Project) |
|
22 | 22 |
|
23 | 23 |
@import utils.JodaDateUtil |
24 | 24 |
@import utils.TemplateHelper._ |
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
@import utils.Markdown |
29 | 29 |
@implicitField = @{ helper.FieldConstructor(simpleForm) } |
30 | 30 |
|
31 |
-@urlToPostings = @{ urlToList(request.getHeader("Referer"), routes.BoardApp.posts(project.owner, project.name).toString()) } |
|
31 |
+@urlToPostings = @{ urlToList(requestHeader.headers.get("Referer").get, routes.BoardApp.posts(project.owner, project.name).toString()) } |
|
32 | 32 |
|
33 | 33 |
@projectLayout(post.title, project, utils.MenuType.BOARD){ |
34 | 34 |
@projectMenu(project, utils.MenuType.BOARD, "main-menu-only") |
--- app/views/code/branches.scala.html
+++ app/views/code/branches.scala.html
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 |
<tbody> |
58 | 58 |
@partial_branchrow(project, head, true) |
59 | 59 |
|
60 |
- @for(branch <- branches.iterator()) { |
|
60 |
+ @for(branch <- branches.iterator) { |
|
61 | 61 |
@partial_branchrow(project, branch, false) |
62 | 62 |
} |
63 | 63 |
</tbody> |
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
... | ... | @@ -151,7 +151,7 @@ |
151 | 151 |
<p class="content">@thread.getFirstReviewComment().getContents()</p> |
152 | 152 |
<span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)"> |
153 | 153 |
<span class="comments"> |
154 |
- @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()} |
|
154 |
+ @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size} |
|
155 | 155 |
</span> |
156 | 156 |
<span class="avatar-wrap smaller margin-right-5"> |
157 | 157 |
<img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" /> |
... | ... | @@ -170,7 +170,7 @@ |
170 | 170 |
<p class="content">@thread.getFirstReviewComment().getContents()</p> |
171 | 171 |
<span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)"> |
172 | 172 |
<span class="comments"> |
173 |
- @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()} |
|
173 |
+ @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size} |
|
174 | 174 |
</span> |
175 | 175 |
<span class="avatar-wrap smaller margin-right-5"> |
176 | 176 |
<img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" /> |
--- app/views/code/history.scala.html
+++ app/views/code/history.scala.html
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
@isHistoryExistAndHasParent(history: List[playRepository.Commit]) = @{ |
80 |
- (history.size() > 0 && history.get(history.size() - 1).getParentCount() > 0) |
|
80 |
+ (history.size > 0 && history.get(history.size - 1).getParentCount() > 0) |
|
81 | 81 |
} |
82 | 82 |
|
83 | 83 |
@projectLayout(Messages("title.commitHistory"), project, utils.MenuType.CODE) { |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 |
@if(history.isEmpty()){ |
138 | 138 |
<tr><td colspan="5" class="warning-none">@Messages("code.nocommits")</td></tr> |
139 | 139 |
} |
140 |
- @for(commit <- history.iterator()) { |
|
140 |
+ @for(commit <- history.iterator) { |
|
141 | 141 |
@defining(getShowCommitURL(project, commit, path)){ showCommitURL => |
142 | 142 |
<tr> |
143 | 143 |
<td class="commit-id"> |
--- app/views/code/nohead.scala.html
+++ app/views/code/nohead.scala.html
... | ... | @@ -21,12 +21,12 @@ |
21 | 21 |
@(project: Project) |
22 | 22 |
|
23 | 23 |
@getCodeURL(project: Project) = @{ |
24 |
- if(session == null){ |
|
24 |
+ if(requestHeader.session == null){ |
|
25 | 25 |
CodeApp.getURL(project.owner, project.name) |
26 | 26 |
} else { |
27 |
- defining(ProjectUser.roleOf(session.get("loginId"), project)) { role => |
|
27 |
+ defining(ProjectUser.roleOf(UserApp.currentUser.loginId, project)) { role => |
|
28 | 28 |
if(role == "manager" || role == "member"){ |
29 |
- CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@") |
|
29 |
+ CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@") |
|
30 | 30 |
} else { |
31 | 31 |
CodeApp.getURL(project.owner, project.name) |
32 | 32 |
} |
--- app/views/code/partial_view_file.scala.html
+++ app/views/code/partial_view_file.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(project:Project, files:org.codehaus.jackson.node.ObjectNode, branch:String, path:String) |
|
21 |
+@(project:Project, files:com.fasterxml.jackson.databind.node.ObjectNode, branch:String, path:String) |
|
22 | 22 |
|
23 | 23 |
@import utils.TemplateHelper._ |
24 | 24 |
@import utils.TemplateHelper.CodeBrowser._ |
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 |
<span id="commitMessage" class="commitMsg">@fieldText(files,"commitMessage")</span> |
59 | 59 |
</div> |
60 | 60 |
<div class="pull-right"> |
61 |
- @if(!files.get("isBinary").getBooleanValue()){ |
|
61 |
+ @if(!files.get("isBinary").booleanValue()){ |
|
62 | 62 |
<a href="@filePath" class="ybtn" target="_blank"> |
63 | 63 |
<i class="yobicon-download-alt yobicon-white vmiddle"></i> Raw |
64 | 64 |
</a> |
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 |
</div> |
72 | 72 |
|
73 | 73 |
@** Binary File **@ |
74 |
- @if(files.get("isBinary").getBooleanValue()){ |
|
74 |
+ @if(files.get("isBinary").booleanValue()){ |
|
75 | 75 |
@if(fieldText(files, "mimeType").indexOf("image/") == 0){ |
76 | 76 |
<div id="showImage" class="image-wrap"><img src="@filePath"></div> |
77 | 77 |
} else { |
... | ... | @@ -87,7 +87,7 @@ |
87 | 87 |
@** Text(Code) **@ |
88 | 88 |
@defining(files.get("data")) { data => |
89 | 89 |
@data match { |
90 |
- case null if files.get("size") != null && files.get("size").getIntValue > 0 => { |
|
90 |
+ case null if files.get("size") != null && files.get("size").intValue > 0 => { |
|
91 | 91 |
<p> |
92 | 92 |
@Messages("code.tooBigFileForCodeBrowser", playRepository.PlayRepository.MAX_FILE_SIZE_CAN_BE_VIEWED) |
93 | 93 |
@if(UserApp.currentUser.isSiteManager) { |
--- app/views/code/partial_view_folder.scala.html
+++ app/views/code/partial_view_folder.scala.html
... | ... | @@ -18,12 +18,12 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(project:Project, files:org.codehaus.jackson.JsonNode, branch:String, listPath:String) |
|
21 |
+@(project:Project, files:com.fasterxml.jackson.databind.JsonNode, branch:String, listPath:String) |
|
22 | 22 |
|
23 | 23 |
@import utils.TemplateHelper.CodeBrowser._ |
24 | 24 |
@import java.net.URLEncoder |
25 | 25 |
|
26 |
-@makeFileItem(file:org.codehaus.jackson.JsonNode, fileName:String, listPath:String) = { |
|
26 |
+@makeFileItem(file:com.fasterxml.jackson.databind.JsonNode, fileName:String, listPath:String) = { |
|
27 | 27 |
@defining(routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, URLEncoder.encode(branch, "UTF-8"), listPath).toString()) { filePath => |
28 | 28 |
@defining(fieldText(file, "type")) { fileType => |
29 | 29 |
<div id="cb-@listPath@fileName" class="row-fluid listitem" data-path="@getDataPath(listPath, fileName)"> |
... | ... | @@ -52,12 +52,12 @@ |
52 | 52 |
</div> |
53 | 53 |
|
54 | 54 |
@** no files **@ |
55 |
- @if(files.getFieldNames().hasNext == false){ |
|
55 |
+ @if(files.fieldNames().hasNext == false){ |
|
56 | 56 |
<div class="alert alert-warning nm" style="border-top:0; padding-left:23px;">@Messages("code.nofiles")</div> |
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
@** folders **@ |
60 |
- @for(fileName <- files.getFieldNames()){ |
|
60 |
+ @for(fileName <- files.fieldNames()){ |
|
61 | 61 |
@defining(files.get(fileName)) { file => |
62 | 62 |
@if(fieldText(file, "type").eq("folder")){ |
63 | 63 |
@makeFileItem(file, fileName, listPath) |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 |
} |
67 | 67 |
|
68 | 68 |
@** files **@ |
69 |
- @for(fileName <- files.getFieldNames()){ |
|
69 |
+ @for(fileName <- files.fieldNames()){ |
|
70 | 70 |
@defining(files.get(fileName)) { file => |
71 | 71 |
@if(!fieldText(file, "type").eq("folder")){ |
72 | 72 |
@makeFileItem(file, fileName, listPath) |
--- app/views/code/view.scala.html
+++ app/views/code/view.scala.html
... | ... | @@ -18,14 +18,14 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(project:Project, branches:List[String], recursiveData:List[org.codehaus.jackson.node.ObjectNode], branch:String, path:String) |
|
21 |
+@(project:Project, branches:List[String], recursiveData:List[com.fasterxml.jackson.databind.node.ObjectNode], branch:String, path:String) |
|
22 | 22 |
|
23 | 23 |
@import utils.TemplateHelper._ |
24 | 24 |
@import utils.TemplateHelper.Branches._ |
25 | 25 |
@import utils.TemplateHelper.CodeBrowser._ |
26 | 26 |
@import java.net.URLEncoder |
27 | 27 |
|
28 |
-@parseFileInfo(files:org.codehaus.jackson.node.ObjectNode) = { |
|
28 |
+@parseFileInfo(files:com.fasterxml.jackson.databind.node.ObjectNode) = { |
|
29 | 29 |
@fieldText(files, "type") match { |
30 | 30 |
case "folder" => { |
31 | 31 |
@partial_view_folder(project, files.get("data"), branch, fieldText(files, "path")) |
--- app/views/common/commentForm.scala.html
+++ app/views/common/commentForm.scala.html
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 |
@import models.enumeration.ResourceType |
25 | 25 |
@import utils.AccessControl._ |
26 | 26 |
|
27 |
-@if(isResourceCreatable(User.findByLoginId(session.get("loginId")), container, resourceType)){ |
|
27 |
+@if(isResourceCreatable(UserApp.currentUser, container, resourceType)){ |
|
28 | 28 |
|
29 | 29 |
<form id="comment-form" action="@action" method="post" enctype="multipart/form-data"> |
30 | 30 |
<div class="write-comment-box"> |
--- app/views/common/debug.scala.html
+++ app/views/common/debug.scala.html
... | ... | @@ -22,5 +22,5 @@ |
22 | 22 |
@import play.api.Play.current |
23 | 23 |
|
24 | 24 |
<div class="container"> |
25 |
- lang = @lang.code |
|
25 |
+ lang = @implicitJavaLang.code |
|
26 | 26 |
</div> |
--- app/views/common/scripts.scala.html
+++ app/views/common/scripts.scala.html
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 |
|
102 | 102 |
// current language set! |
103 | 103 |
if (typeof window.moment == "function" && typeof window.moment.lang == "function") { |
104 |
- moment.lang("@lang.language"); |
|
104 |
+ moment.lang("@implicitJavaLang.language"); |
|
105 | 105 |
} |
106 | 106 |
|
107 | 107 |
// yobi.Dropdown |
... | ... | @@ -120,10 +120,15 @@ |
120 | 120 |
$(htInfo.welTarget.parents("form").get(0)).submit(); |
121 | 121 |
} |
122 | 122 |
}); |
123 |
- @if(session.contains("loginId")){ |
|
124 |
- yobi.ShortcutKey.setKeymapLink({ |
|
125 |
- "P": "@routes.UserApp.userInfo(session.get("loginId"))" |
|
126 |
- }); |
|
123 |
+ @requestHeader.session.get("loginId") match { |
|
124 |
+ case Some(loginId) => { } |
|
125 |
+ case None => { } |
|
126 |
+ } |
|
127 |
+ @requestHeader.session.get("loginId") match { |
|
128 |
+ case Some(v) => { yobi.ShortcutKey.setKeymapLink({ |
|
129 |
+ "P": "@routes.UserApp.userInfo(v)" |
|
130 |
+ }); } |
|
131 |
+ case None => { } |
|
127 | 132 |
} |
128 | 133 |
|
129 | 134 |
// yobi.Files |
... | ... | @@ -168,14 +173,11 @@ |
168 | 173 |
} |
169 | 174 |
|
170 | 175 |
// notify flash messages |
171 |
- @for(key <- flash.keys) { |
|
172 |
- @if(key != utils.Constants.TITLE && |
|
173 |
- key != utils.Constants.DESCRIPTION){ |
|
174 |
- $yobi.notify("@Messages(flash.get(key))", 3000); |
|
176 |
+ @requestHeader.flash.get(utils.Constants.TITLE) match { |
|
177 |
+ case Some(title) => { $yobi.alert("@Messages(title)", null, "@Messages(requestHeader.flash.get(utils.Constants.DESCRIPTION).get)"); } |
|
178 |
+ case None => { @requestHeader.flash.data.foreach { |
|
179 |
+ case (_, value) => { $yobi.notify("@Messages(value)", 3000); } |
|
175 | 180 |
} |
176 |
- @if(key == utils.Constants.TITLE){ |
|
177 |
- $yobi.alert("@Messages(flash.get(key))", null, |
|
178 |
- "@Messages(flash.get(utils.Constants.DESCRIPTION))"); |
|
179 | 181 |
} |
180 | 182 |
} |
181 | 183 |
|
--- app/views/common/select2.scala.html
+++ app/views/common/select2.scala.html
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 |
<script src="@routes.Assets.at("javascripts/lib/select2/select2.js")"></script> |
23 | 23 |
<script src="@routes.Assets.at("javascripts/common/yobi.ui.Select2.js")"></script> |
24 | 24 |
@{ |
25 |
- lang.language match { |
|
25 |
+ implicitJavaLang.language match { |
|
26 | 26 |
case "ko" => { |
27 | 27 |
Html("<script src=\"" + routes.Assets.at("javascripts/lib/select2/select2_locale_ko.js") + "\"></script>") |
28 | 28 |
} |
--- app/views/error/forbidden.scala.html
+++ app/views/error/forbidden.scala.html
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
<i class="ico ico-err2"></i> |
29 | 29 |
<p>@Messages(messageKey)</p> |
30 | 30 |
@if(UserApp.currentUser.isAnonymous){ |
31 |
- <a href="@routes.UserApp.loginForm?redirectUrl=@request.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a> |
|
31 |
+ <a href="@routes.UserApp.loginForm?redirectUrl=@requestHeader.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a> |
|
32 | 32 |
} |
33 | 33 |
</div> |
34 | 34 |
</div> |
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, form:Form[PullRequest], project:Project, projects:List[Project], |
|
21 |
+@(title:String, form: play.data.Form[PullRequest], project:Project, projects:List[Project], |
|
22 | 22 |
fromProject:Project, toProject:Project, |
23 | 23 |
fromBranches:List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch], |
24 | 24 |
pullRequest:models.PullRequest) |
--- app/views/git/edit.scala.html
+++ app/views/git/edit.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, form:Form[PullRequest], project:Project, |
|
21 |
+@(title:String, form: play.data.Form[PullRequest], project:Project, |
|
22 | 22 |
fromBranches: List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch], |
23 | 23 |
pullRequest:models.PullRequest) |
24 | 24 |
|
--- app/views/git/fork.scala.html
+++ app/views/git/fork.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: Form[Project], orgUserList:List[OrganizationUser]) |
|
21 |
+@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: play.data.Form[Project], orgUserList:List[OrganizationUser]) |
|
22 | 22 |
|
23 | 23 |
@import utils.TemplateHelper._ |
24 | 24 |
@import controllers.UserApp |
--- app/views/git/partial_list.scala.html
+++ app/views/git/partial_list.scala.html
... | ... | @@ -25,8 +25,8 @@ |
25 | 25 |
@import org.apache.commons.lang3.StringUtils |
26 | 26 |
|
27 | 27 |
<ul class="post-list-wrap"> |
28 |
-@if(page.getList.size()> 0){ |
|
29 |
- @for(req <- page.getList.iterator()) { |
|
28 |
+@if(page.getList.size> 0){ |
|
29 |
+ @for(req <- page.getList.iterator) { |
|
30 | 30 |
@defining(User.findByLoginId(req.contributor.loginId)){ user => |
31 | 31 |
<li class="post-item"> |
32 | 32 |
<div class="span10"> |
--- app/views/git/partial_pull_request_event.scala.html
+++ app/views/git/partial_pull_request_event.scala.html
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
@if(event.newValue == PullRequestReviewAction.DONE.name) { |
56 | 56 |
<li class="event" id="comment-@event.id"> |
57 | 57 |
<span class="state changed">@Messages("pullRequest.review")</span> |
58 |
- @Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.name))) |
|
58 |
+ @Html(Messages("notification.pullrequestHeader.reviewed",linkToUser(user.loginId, user.name))) |
|
59 | 59 |
<span class="date"> |
60 | 60 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
61 | 61 |
</span> |
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 |
} else { |
64 | 64 |
<li class="event" id="comment-@event.id"> |
65 | 65 |
<span class="state changed">@Messages("pullRequest.unreview")</span> |
66 |
- @Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.name))) |
|
66 |
+ @Html(Messages("notification.pullrequestHeader.unreviewed", linkToUser(user.loginId, user.name))) |
|
67 | 67 |
<span class="date"> |
68 | 68 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
69 | 69 |
</span> |
--- app/views/git/partial_reviewlist.scala.html
+++ app/views/git/partial_reviewlist.scala.html
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 |
@thread.getFirstReviewComment().getContents() |
33 | 33 |
</p> |
34 | 34 |
<p class="info"> |
35 |
- @defining(thread.reviewComments.size()-1) { numberOfComments => |
|
35 |
+ @defining(thread.reviewComments.size-1) { numberOfComments => |
|
36 | 36 |
@if(numberOfComments > 0) { |
37 | 37 |
<span class="comments pull-left"> |
38 | 38 |
<i class="yobicon-comments"></i> @numberOfComments |
--- app/views/git/partial_state.scala.html
+++ app/views/git/partial_state.scala.html
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
|
29 | 29 |
@getCodeURL(project: Project) = @{ |
30 | 30 |
if(ProjectUser.isMember(project.id, UserApp.currentUser().id)){ |
31 |
- CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@") |
|
31 |
+ CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@") |
|
32 | 32 |
} else { |
33 | 33 |
CodeApp.getURL(project.owner, project.name) |
34 | 34 |
} |
--- app/views/git/viewChanges.scala.html
+++ app/views/git/viewChanges.scala.html
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 |
</div> |
48 | 48 |
</div> |
49 | 49 |
|
50 |
- <div class="codediff-wrap mt10 @if(request.cookies.get("diffs-only") != null){diffs-only}"> |
|
50 |
+ <div class="codediff-wrap mt10 @if(requestHeader.cookies.get("diffs-only") != null){diffs-only}"> |
|
51 | 51 |
<button type="button" class="ybtn ybtn-default btn-show-reviewcards"> |
52 | 52 |
<i class="yobicon-restore"></i> |
53 | 53 |
</button> |
... | ... | @@ -158,8 +158,8 @@ |
158 | 158 |
</button> |
159 | 159 |
|
160 | 160 |
<ul class="nav nav-tabs" style="margin-bottom:10px;"> |
161 |
- <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size()</a></li> |
|
162 |
- <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size()</a></li> |
|
161 |
+ <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size</a></li> |
|
162 |
+ <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size</a></li> |
|
163 | 163 |
</ul> |
164 | 164 |
|
165 | 165 |
<div class="tab-content review-list"> |
--- app/views/help/keymap.scala.html
+++ app/views/help/keymap.scala.html
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 |
**@ |
21 | 21 |
@(section:String, project:Project)(implicit request: play.api.mvc.RequestHeader) |
22 | 22 |
|
23 |
-@isMac = @{request.headers.get("User-Agent").getOrElse("").contains("Macintosh")} |
|
23 |
+@isMac = @{requestHeader.headers.get("User-Agent").getOrElse("").contains("Macintosh")} |
|
24 | 24 |
@ctrl = @{if(isMac){"⌘"}else{"CTRL"}} |
25 | 25 |
|
26 | 26 |
<div class="pull-right" style="padding:10px 0;"> |
--- app/views/index/partial_notifications.scala.html
+++ app/views/index/partial_notifications.scala.html
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
@defining(NotificationEvent.findByReceiver(UserApp.currentUser, from, size)){ notifications => |
54 |
- @if(notifications.size() == 0){ |
|
54 |
+ @if(notifications.size == 0){ |
|
55 | 55 |
<div class="warning-none"> |
56 | 56 |
<i class="yobicon-danger"></i> @Messages("notification.none") |
57 | 57 |
</div> |
--- app/views/issue/create.scala.html
+++ app/views/issue/create.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, issueForm:Form[Issue], project:Project) |
|
21 |
+@(title:String, issueForm: play.data.Form[Issue], project:Project) |
|
22 | 22 |
@import helper._ |
23 | 23 |
@import scala.collection.mutable.Map |
24 | 24 |
@import models.enumeration.ResourceType |
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
* See the License for the specific language governing permissions and |
19 | 19 |
* limitations under the License. |
20 | 20 |
**@ |
21 |
-@(title:String, issueForm:Form[Issue], issue:Issue, project:Project) |
|
21 |
+@(title:String, issueForm: play.data.Form[Issue], issue:Issue, project:Project) |
|
22 | 22 |
@import helper._ |
23 | 23 |
@import scala.collection.mutable.Map |
24 | 24 |
@import models.enumeration.ResourceType |
--- app/views/issue/my_partial_list.scala.html
+++ app/views/issue/my_partial_list.scala.html
... | ... | @@ -70,13 +70,13 @@ |
70 | 70 |
</span> |
71 | 71 |
} |
72 | 72 |
|
73 |
- @if(issue.comments.size()>0 || issue.voters.size()>0) { |
|
73 |
+ @if(issue.comments.size>0 || issue.voters.size>0) { |
|
74 | 74 |
<span class="infos-item item-count-groups"> |
75 |
- @if(issue.comments.size()>0){ |
|
76 |
- @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() ) |
|
75 |
+ @if(issue.comments.size>0){ |
|
76 |
+ @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size ) |
|
77 | 77 |
} |
78 |
- @if(issue.voters.size()>0){ |
|
79 |
- @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" ) |
|
78 |
+ @if(issue.voters.size>0){ |
|
79 |
+ @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" ) |
|
80 | 80 |
} |
81 | 81 |
</span> |
82 | 82 |
} |
--- app/views/issue/my_partial_list_quicksearch.scala.html
+++ app/views/issue/my_partial_list_quicksearch.scala.html
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 |
<li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}> |
26 | 26 |
<a pjax-filter href="#" |
27 | 27 |
data-author-id="" |
28 |
- data-assignee-id="@User.findByLoginId(session.get("loginId")).id" |
|
28 |
+ data-assignee-id="@UserApp.currentUser.id" |
|
29 | 29 |
data-milestone-id="@param.milestoneId" |
30 | 30 |
data-mention-id=""> |
31 | 31 |
@Messages("issue.list.assignedToMe") |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
</li> |
34 | 34 |
<li @if(param.authorId == UserApp.currentUser().id){ class="active"}> |
35 | 35 |
<a pjax-filter href="#" |
36 |
- data-author-id="@User.findByLoginId(session.get("loginId")).id" |
|
36 |
+ data-author-id="@UserApp.currentUser.id" |
|
37 | 37 |
data-assignee-id="" |
38 | 38 |
data-milestone-id="@param.milestoneId" |
39 | 39 |
data-mention-id=""> |
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 |
data-author-id="" |
46 | 46 |
data-assignee-id="" |
47 | 47 |
data-milestone-id="@param.milestoneId" |