jetbrains.buildServer.controllers.BaseController Java Examples

The following examples show how to use jetbrains.buildServer.controllers.BaseController. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PhabricatorPlugin.java    From TeamCity-Phabricator-Plugin with MIT License 6 votes vote down vote up
public PhabricatorPlugin(
        @NotNull final PluginDescriptor pluginDescriptor,
        @NotNull final WebControllerManager webControllerManager
){
    final String jsp = pluginDescriptor.getPluginResourcesPath("tcPhabSettings.jsp");
    final String html = pluginDescriptor.getPluginResourcesPath("tcPhabSettings.html");

    webControllerManager.registerController(html, new BaseController() {
        @Override
        protected ModelAndView doHandle(@NotNull HttpServletRequest httpServletRequest, @NotNull HttpServletResponse httpServletResponse) throws Exception {
            ModelAndView mv = new ModelAndView(jsp);
            mv.getModel().put("requestUrl", html);
            mv.getModel().put("buildTypeId", getBuildTypeIdParameter(httpServletRequest));
            return mv;
        }
    });

    this.myEditUrl = html;
}
 
Example #2
Source File: IndexSymbolsBuildFeature.java    From teamcity-symbol-server with Apache License 2.0 5 votes vote down vote up
public IndexSymbolsBuildFeature(final PluginDescriptor pluginDescriptor, final WebControllerManager web) {
  final String jsp = pluginDescriptor.getPluginResourcesPath("editSymbolsBuildFeatureParams.jsp");
  final String html = pluginDescriptor.getPluginResourcesPath("symbolIndexerSettings.html");

  web.registerController(html, new BaseController() {
    @Override
    protected ModelAndView doHandle(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
      return new ModelAndView(jsp);
    }
  });

  myEditParametersUrl = html;
}
 
Example #3
Source File: DownloadSymbolsControllerTest.java    From teamcity-symbol-server with Apache License 2.0 5 votes vote down vote up
@Override
protected BaseController createController() throws IOException {
  AuthorizationInterceptor authInterceptor = myFixture.getSingletonService(AuthorizationInterceptor.class);
  AuthHelper authHelper = new AuthHelper(myFixture.getLoginConfiguration(), myFixture.getUserModel(), myFixture.getSingletonService(HttpAuthenticationManager.class));
  SymbolsCache symbolsCache = new SymbolsCache(myFixture.getEventDispatcher());
  return new DownloadSymbolsController(myServer, myWebManager, authInterceptor,  myFixture.getSecurityContext(), myBuildMetadataStorage, authHelper, symbolsCache);
}