Java 类play.mvc.Call 实例源码

项目:play-handlebars    文件:PlayHelpers.java   
/**
 * Get the URL by the controllers package, class, method and parameters. It
 * use reflection for get the reverse route.
 * 
 * @param controllerPackage
 *  The name of the package of the controller
 * @param controllerClass
 *  The name of the controller class
 * @param methodName
 *  The method name in the controller, i.e. action
 * @param methodArguments
 *  The arguments of the method
 * @return
 *  Reversed URL
 * @throws Exception
 *  Any exception in the case of reversion
 */
private static String reverseUrl(
    final ClassLoader classLoader,
    final String controllerPackage,
    final String controllerClass,
    final String methodName,
    final RouteMethodArguments methodArguments) throws Exception {

  // Load the auto generated class "routes".
  final Class<?> routerClass = classLoader.loadClass(controllerPackage + ".routes");

  // Get the reverse router object of the controller.
  final Field declaredField = routerClass.getDeclaredField(controllerClass);
  // It's static field.
  final Object object = declaredField.get(null);
  final Class<?> type = declaredField.getType();

  // Get the action of the reverse controller.
  final Method routerMethod = type.getMethod(methodName, methodArguments.types);
  final Call invoke = (Call) routerMethod.invoke(object, methodArguments.values);

  // Get the URL of the action.
  return invoke.url();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call auth(final String provider) {
    // You can provide your own authentication implementation,
    // however the default should be sufficient for most cases
    return com.feth.play.module.pa.controllers.routes.Authenticate
            .authenticate(provider);
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call onException(final AuthException e) {
    if (e instanceof AccessDeniedException) {
        return routes.Signup
                .oAuthDenied(((AccessDeniedException) e)
                        .getProviderKey());
    }

    // more custom problem handling here...
    return super.onException(e);
}
项目:vos_backend    文件:BindablesTest.java   
@Test
public void testPager() {
    start();
    Pager pager = new Pager();
    pager.index = 10;
    pager.size = 20;
    // Test that the pager is bound/unbound correctly
    Call call = routes.Application.paged(pager);
    assertEquals("/paged?p.index=10&p.size=20", call.url());
    Result result = route(fakeRequest(call.method(), call.url()));
    assertEquals("Pager{index=10, size=20}", contentAsString(result));
}
项目:demschooltools    文件:MyResolver.java   
@Override
public Call onException(final AuthException e) {
    if (e instanceof AccessDeniedException) {
        return routes.Public
                .oAuthDenied(((AccessDeniedException) e)
                        .getProviderKey());
    }

    // more custom problem handling here...

    return super.onException(e);
}
项目:commercetools-sunrise-java    文件:ProductBreadcrumbViewModelFactory.java   
private BreadcrumbLinkViewModel createProductLink(final ProductWithVariant productWithVariant) {
    final BreadcrumbLinkViewModel linkViewModel = new BreadcrumbLinkViewModel();
    linkViewModel.setText(productWithVariant.getProduct().getName());
    final String productUrl = getProductReverseRouter()
            .productDetailPageCall(productWithVariant.getProduct(), productWithVariant.getVariant())
            .map(Call::url)
            .orElse("");
    linkViewModel.setUrl(productUrl);
    return linkViewModel;
}
项目:commercetools-sunrise-java    文件:WishlistItemViewModelFactory.java   
protected void fillProductSlug(final WishlistItemViewModel viewModel, final LineItem lineItem) {
    if (lineItem != null) {
        final String productSlug = productReverseRouter
                .productDetailPageCall(lineItem)
                .map(Call::url)
                .orElse("");
        viewModel.setUrl(productSlug);
    }
}
项目:CS784-Data_Integration    文件:DebugController.java   
/**** PRIVATE OPERATIONS ****/
private static Result showPairs() {

    String pageTitle = "Debug";

    Html topBar = debug_topbar.render(project.getName());
    Html topNav = common_topnav.render(project);
    Html content = facets_layout.render();

    List<Call> dynamicJs = new ArrayList<Call>();
    dynamicJs.add(controllers.project.routes.ProjectController.javascriptRoutes());
    dynamicJs.add(controllers.routes.Assets.at("javascripts/project/project.js"));

    dynamicJs.add(controllers.debug.routes.DebugController.javascriptRoutes());
    dynamicJs.add(controllers.routes.Assets.at("javascripts/bootstrap/bootstrap-tree.js"));
    dynamicJs.add(controllers.routes.Assets.at("javascripts/facets_layout/facets_layout.js"));
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_error_filter.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_facets_layout.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_match_status_filter.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_matching_summary.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_rule_filter.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_feature_thresh_filter.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_skyline_filter.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug_table.js"));  
    dynamicJs.add(controllers.routes.Assets.at("javascripts/debug/debug.js")); 

    List<Call> dynamicCss = new ArrayList<Call>();
    dynamicCss.add(controllers.routes.Assets.at("stylesheets/bootstrap/bootstrap-tree.min.css"));
    dynamicCss.add(controllers.routes.Assets.at("stylesheets/facets_layout/facets_layout.css"));
    dynamicCss.add(controllers.routes.Assets.at("stylesheets/debug/debug.css"));

    Html page =  common_main.render(pageTitle, topBar, topNav, content,
            dynamicCss, dynamicJs);

    return ok(page);
}
项目:pfe-samples    文件:OAuth.java   
public String authorizeUrl(Call returnTo) {
    return URL.build(configuration.authorizationEndpoint, Scala.varargs(
            param("response_type", "code"),
            param("client_id", configuration.clientId),
            param("redirect_uri", routes.OAuth.callback().absoluteURL(request())),
            param("scope", configuration.scope),
            param("state", returnTo.url())
    ));
}
项目:songs_play    文件:MyUsernamePasswordAuthProvider.java   
@Override
protected Call userExists(final UsernamePasswordAuthUser authUser) {
    return routes.Signup.exists();
}
项目:songs_play    文件:MyUsernamePasswordAuthProvider.java   
@Override
protected Call userUnverified(final UsernamePasswordAuthUser authUser) {
    return routes.Signup.unverified();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call login() {
    // Your login page
    return routes.Application.login();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call afterAuth() {
    // The user will be redirected to this page after authentication
    // if no original URL was saved
    return routes.Application.index();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call afterLogout() {
    return routes.Application.index();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call askMerge() {
    return routes.Account.askMerge();
}
项目:songs_play    文件:MyResolver.java   
@Override
public Call askLink() {
    return routes.Account.askLink();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForAjaxWaitImage() {
    return controllers.routes.Assets.versioned(new Asset("images/ajax-loader.gif"));
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForDynamicSingleCustomAttributeApi() {
    return controllers.routes.Application.dynamicSingleCustomAttributeApi();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForDownloadAttachedFile(Long attachmentId) {
    return controllers.routes.Application.downloadFileAttachment(attachmentId);
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForDeleteAttachedFile(Long attachmentId) {
    return controllers.routes.Application.deleteFileAttachment(attachmentId);
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationCreate() {
    return framework.utils.routes.FilterConfigController.filterConfigurationCreate();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationSave() {
    return framework.utils.routes.FilterConfigController.filterConfigurationSave();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationChange() {
    return framework.utils.routes.FilterConfigController.filterConfigurationChange();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationEdit() {
    return framework.utils.routes.FilterConfigController.filterConfigurationEdit();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationDelete() {
    return framework.utils.routes.FilterConfigController.filterConfigurationDelete();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationShare() {
    return framework.utils.routes.FilterConfigController.filterConfigurationShare();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationSearchPrincipal() {
    return framework.utils.routes.FilterConfigController.filterConfigurationSearchPrincipal();
}
项目:maf-desktop-app    文件:ImplementationDefinedObjectImpl.java   
@Override
public Call getRouteForFilterConfigurationClear() {
    return routes.FilterConfigController.filterConfigurationClear();
}
项目:Rasbeb    文件:QuestionsTable.java   
@Override
protected Call list(QuestionsFilter questionsFilter, Sorter s, Pager p) {
    return routes.ListQuestions.list(f,s,p);
}
项目:Rasbeb    文件:QuestionsTable.java   
@Override
public Call resize() {
   return routes.ListQuestions.resize(f,s, p.offset());
}
项目:Rasbeb    文件:QuestionsTable.java   
@Override
public Call action() {
    return routes.ListQuestions.filter(s,p);
}
项目:Rasbeb    文件:AbstractTable.java   
@Override
public Call previous() {
    return list(f,s,p.previous());
}
项目:Rasbeb    文件:AbstractTable.java   
@Override
public Call next() {
    return list(f,s,p.next());
}
项目:Rasbeb    文件:AbstractTable.java   
@Override
public Call sort(String field) {
    return list(f,s.forColumn(field),p);
}
项目:Rasbeb    文件:SchoolsTable.java   
@Override
protected Call list(SchoolsFilter schoolsFilter, Sorter s, Pager p) {
    return routes.Schools.list(f,s,p);
}
项目:Rasbeb    文件:SchoolsTable.java   
@Override
public Call resize() {
   return routes.Schools.resize(f,s, p.offset());
}
项目:Rasbeb    文件:SchoolsTable.java   
@Override
public Call action() {
    return routes.Schools.filter(s,p);
}
项目:Rasbeb    文件:TeacherSchoolsTable.java   
@Override
protected Call list(SchoolsFilter schoolsFilter, Sorter s, Pager p) {
    return routes.TeacherSchools.show(f,s,p);
}
项目:Rasbeb    文件:TeacherSchoolsTable.java   
@Override
public Call resize() {
   return routes.TeacherSchools.resize(f,s, p.offset());
}