本文整理汇总了Java中play.api.mvc.Call类的典型用法代码示例。如果您正苦于以下问题:Java Call类的具体用法?Java Call怎么用?Java Call使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Call类属于play.api.mvc包,在下文中一共展示了Call类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: routes
import play.api.mvc.Call; //导入依赖的package包/类
@Test
public void routes() {
asAdminUser(new F.Function3<Session, User, FakeRequest, Session>() {
@Override
public Session apply(
final Session session,
final User user,
final FakeRequest newRequest) throws Throwable {
{
final Call call = controllers.routes.GroupController.list();
assertThat(call.method()).isEqualTo("GET");
assertThat(call.url()).isEqualTo("/groups");
}
return session;
}
});
}
示例2: deletePost
import play.api.mvc.Call; //导入依赖的package包/类
@Transactional
public Result deletePost(Long postId) {
Post post = postManager.findById(postId);
Account account = Component.currentAccount();
Call routesTo = null;
if (Secured.isAllowedToDeletePost(post, account)) {
//verify redirect
if (post.group != null) {
routesTo = controllers.routes.GroupController.stream(post.group.id, PAGE, false);
}
if (post.account != null) {
routesTo = controllers.routes.Application.index();
}
if (post.parent != null) {
if (post.parent.group != null) {
routesTo = controllers.routes.GroupController.stream(post.parent.group.id, PAGE, false);
} else if (post.parent.account != null) {
routesTo = controllers.routes.Application.index();
}
}
postManager.delete(post);
flash("success", "Gelöscht!");
} else {
flash("error", "Konnte nicht gelöscht werden!");
}
if (routesTo == null) {
routesTo = controllers.routes.Application.index();
}
return redirect(routesTo);
}
示例3: register
import play.api.mvc.Call; //导入依赖的package包/类
public static Referrer register(String caption, Call call, String key) {
if (map.containsKey(key)) {
throw new IllegalArgumentException("Referrer with key '" + key + "' already exists");
} else {
Referrer r = new Referrer(caption, call, key);
map.put(key,r);
return r;
}
}
示例4: getCall
import play.api.mvc.Call; //导入依赖的package包/类
private static Call getCall(FileStore.FileOrFolder fof) {
final String id = fof.getIdentifier();
if (fof instanceof FileStore.File) {
return controllers.routes.FileStoreController.showFile(id);
} else {
return controllers.routes.FileStoreController.showFolder(id);
}
}
示例5: absoluteUrl
import play.api.mvc.Call; //导入依赖的package包/类
public static String absoluteUrl(final Call call) {
try {
URL baseUrl = new URL(Play.application().configuration()
.getString("application.baseUrl"));
return (new URL(baseUrl, call.url())).toString();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
示例6: getDynamicController
import play.api.mvc.Call; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected ControllerProxy<?, ?> getDynamicController(Class<?> keyType, Class<?> modelType, ModelMetadata model) {
ControllerProxy<?, ?> proxy = dynamicCrudControllers.get(modelType);
if (proxy == null) {
Call indexCall = routes.RouterCrudController.list(model.getName());
DynamicCrudController dynController = new DynamicCrudController(classLoader, model, indexCall);
proxy = new ControllerProxyCRUD<>(dynController, model);
dynamicCrudControllers.put(modelType, proxy);
}
return proxy;
}
示例7: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long forumId) {
return org.iatoki.judgels.raguel.forum.member.routes.ForumMemberController.viewMembers(forumId);
}
示例8: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long forumId) {
return org.iatoki.judgels.raguel.forum.thread.routes.ForumThreadController.viewThreads(forumId);
}
示例9: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.routes.ContestController.jumpToTeams(contestId);
}
示例10: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.routes.ContestController.jumpToClarifications(contestId);
}
示例11: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.routes.ContestController.jumpToPasswords(contestId);
}
示例12: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.routes.ContestController.jumpToSupervisors(contestId);
}
示例13: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.file.routes.ContestFileController.listFiles(contestId);
}
示例14: getDefaultJumpTo
import play.api.mvc.Call; //导入依赖的package包/类
@Override
public Call getDefaultJumpTo(long contestId) {
return org.iatoki.judgels.uriel.contest.routes.ContestController.jumpToScoreboards(contestId);
}
示例15: Referrer
import play.api.mvc.Call; //导入依赖的package包/类
public Referrer(String caption, Call call, String key) {
this.call = call;
this.caption = caption;
this.key = key;
}