jetbrains.buildServer.web.openapi.PluginDescriptor Java Examples

The following examples show how to use jetbrains.buildServer.web.openapi.PluginDescriptor. 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: SlackNotifierSettingsController.java    From tcSlackBuildNotifier with MIT License 6 votes vote down vote up
public SlackNotifierSettingsController(@NotNull SBuildServer server,
                                       @NotNull ServerPaths serverPaths,
                                       @NotNull WebControllerManager manager,
                                       @NotNull SlackNotificationMainConfig config,
                                       SlackNotificationPayloadManager payloadManager,
                                       PluginDescriptor descriptor){

    this.server = server;
    this.serverPaths = serverPaths;
    this.manager = manager;
    this.config = config;
    this.payloadManager = payloadManager;
    this.descriptor = descriptor;

    manager.registerController(CONTROLLER_PATH, this);
}
 
Example #2
Source File: KubeProfileEditController.java    From teamcity-kubernetes-plugin with Apache License 2.0 6 votes vote down vote up
public KubeProfileEditController(@NotNull final SBuildServer server,
                                 @NotNull final WebControllerManager web,
                                 @NotNull final PluginDescriptor pluginDescriptor,
                                 @NotNull final AgentPoolManager agentPoolManager,
                                 @NotNull final KubeAuthStrategyProvider authStrategyProvider,
                                 @NotNull final BuildAgentPodTemplateProviders podTemplateProviders,
                                 @NotNull final ChooserController.Namespaces namespacesChooser,
                                 @NotNull final ChooserController.Deployments deploymentsChooser,
                                 @NotNull final KubeDeleteImageDialogController kubeDeleteImageDialogController) {
    super(server);
    myPluginDescriptor = pluginDescriptor;
    myPath = pluginDescriptor.getPluginResourcesPath(EDIT_KUBE_HTML);
    myAgentPoolManager = agentPoolManager;
    myAuthStrategyProvider = authStrategyProvider;
    myPodTemplateProviders = podTemplateProviders;
    myNamespacesChooser = namespacesChooser;
    myDeploymentsChooser = deploymentsChooser;
    myKubeDeleteImageDialogController = kubeDeleteImageDialogController;
    web.registerController(myPath, this);
}
 
Example #3
Source File: SlackNotifierAdminPage.java    From tcSlackBuildNotifier with MIT License 6 votes vote down vote up
protected SlackNotifierAdminPage(@NotNull PagePlaces pagePlaces,
                                 @NotNull PluginDescriptor descriptor,
                                 @NotNull SBuildServer sBuildServer,
                                 @NotNull SlackNotificationMainSettings slackMainSettings
                                 ) {
    super(pagePlaces);
    this.sBuildServer = sBuildServer;
    this.slackMainSettings = slackMainSettings;

    setPluginName(PLUGIN_NAME);
    setIncludeUrl(descriptor.getPluginResourcesPath(PAGE));
    jspHome = descriptor.getPluginResourcesPath();
    setTabTitle(TAB_TITLE);
    ArrayList<String> after = new ArrayList<String>();
    after.add(AFTER_PAGE_ID);
    ArrayList<String> before = new ArrayList<String>();
    before.add(BEFORE_PAGE_ID);
    setPosition(PositionConstraint.between(after, before));
    register();
    Loggers.SERVER.info("Slack global configuration page registered");
}
 
Example #4
Source File: UserTelegramSettingsExtension.java    From teamcity-telegram-plugin with Apache License 2.0 6 votes vote down vote up
public UserTelegramSettingsExtension(@NotNull WebControllerManager manager,
                                     @NotNull NotificationRulesManager rulesManager,
                                     @NotNull UserModel userModel,
                                     @NotNull PluginDescriptor descriptor,
                                     @NotNull TelegramSettingsManager settingsManager) {
  super(manager);
  this.rulesManager = rulesManager;
  this.userModel = userModel;
  this.settingsManager = settingsManager;

  setPluginName(TelegramSettingsPage.PLUGIN_NAME);
  setIncludeUrl(descriptor.getPluginResourcesPath("userTelegramSettings.jsp"));
  // This extension required by two places. Don't looks clear
  // but works...
  setPlaceId(PlaceId.NOTIFIER_SETTINGS_FRAGMENT);
  register();
  setPlaceId(PlaceId.MY_SETTINGS_NOTIFIER_SECTION);
  register();
}
 
Example #5
Source File: VMWareCloudClientFactory.java    From teamcity-vmware-plugin with Apache License 2.0 6 votes vote down vote up
public VMWareCloudClientFactory(@NotNull final CloudRegistrar cloudRegistrar,
                                @NotNull final PluginDescriptor pluginDescriptor,
                                @NotNull final ServerPaths serverPaths,
                                @NotNull final CloudInstancesProvider instancesProvider,
                                @NotNull final CloudManagerBase cloudManager,
                                @NotNull final ServerSettings serverSettings,
                                @NotNull final VmwareUpdateTaskManager updateTaskManager,
                                @NotNull final SSLTrustStoreProvider sslTrustStoreProvider
                                ) {
  super(cloudRegistrar);
  myInstancesProvider = instancesProvider;
  myIdxStorage = new File(serverPaths.getPluginDataDirectory(), "vmwareIdx");
  myCloudManager = cloudManager;
  myUpdateTaskManager = updateTaskManager;
  mySslTrustStoreProvider = sslTrustStoreProvider;
  if (!myIdxStorage.exists()){
    myIdxStorage.mkdirs();
  }
  myHtmlPath = pluginDescriptor.getPluginResourcesPath("vmware-settings.html");
  myServerSettings = serverSettings;
}
 
Example #6
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 #7
Source File: SlackProjectTab.java    From TCSlackNotifierPlugin with MIT License 5 votes vote down vote up
public SlackProjectTab(PagePlaces pagePlaces , ProjectManager projectManager , PluginDescriptor pluginDescriptor , ProjectSettingsManager projectSettingsManager , SlackConfigProcessor slackConfigProcessor)
{
    super("slackNotifierProjectTab","Slack" , pagePlaces , projectManager);
    setIncludeUrl(pluginDescriptor.getPluginResourcesPath("/admin/slackProjectPage.jsp"));

    this.slackConfigProcessor = slackConfigProcessor;
    this.projectSettingsManager = projectSettingsManager ;
}
 
Example #8
Source File: SlackNotificationAjaxEditPageController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationAjaxEditPageController(SBuildServer server, WebControllerManager webManager,
                                                  ProjectSettingsManager settings, SlackNotificationProjectSettings whSettings, SlackNotificationPayloadManager manager,
                                                  PluginDescriptor pluginDescriptor, SlackNotificationMainSettings mainSettings) {
    super(server);
    myWebManager = webManager;
    myServer = server;
    mySettings = settings;
    myPluginPath = pluginDescriptor.getPluginResourcesPath();
    myManager = manager;
       myMainSettings = mainSettings;
}
 
Example #9
Source File: AnsibleRunResultsTab.java    From tc-ansible-runner with MIT License 5 votes vote down vote up
public AnsibleRunResultsTab(@NotNull PagePlaces pagePlaces, @NotNull SBuildServer server, @NotNull PluginDescriptor descriptor) {
    super("", "", pagePlaces, server);
    setTabTitle(getTitle());
    setPluginName(getClass().getSimpleName());
    setIncludeUrl(getJspPage(descriptor));
    addCssFile(descriptor.getPluginResourcesPath("css/style.css"));
    addJsFile(descriptor.getPluginResourcesPath("js/angular.min.js"));
    addJsFile(descriptor.getPluginResourcesPath("js/angular-app.js"));
}
 
Example #10
Source File: OAuthAuthenticationScheme.java    From teamcity-oauth with Apache License 2.0 5 votes vote down vote up
public OAuthAuthenticationScheme(@NotNull final PluginDescriptor pluginDescriptor,
                                 @NotNull final ServerPrincipalFactory principalFactory,
                                 @NotNull final OAuthClient authClient,
                                 @NotNull final AuthenticationSchemeProperties properties) {
    this.pluginDescriptor = pluginDescriptor;
    this.principalFactory = principalFactory;
    this.authClient = authClient;
    this.properties = properties;
}
 
Example #11
Source File: SlackAdminPage.java    From TCSlackNotifierPlugin with MIT License 5 votes vote down vote up
public SlackAdminPage(PagePlaces pagePlaces, PluginDescriptor descriptor , SlackConfigProcessor configProcessor) {
    super(pagePlaces);
    setPluginName("slackNotifier");
    setIncludeUrl(descriptor.getPluginResourcesPath("/admin/slackAdminPage.jsp"));
    setTabTitle("Slack Notifier");
    setPosition(PositionConstraint.after("clouds", "email", "jabber"));
    register();

    this.configProcesser = configProcessor ;
}
 
Example #12
Source File: PluginConfiguration.java    From teamcity-oauth with Apache License 2.0 5 votes vote down vote up
@Bean
public OAuthAuthenticationScheme oAuthAuthenticationScheme(LoginConfiguration loginConfiguration,
                                                    PluginDescriptor pluginDescriptor,
                                                    ServerPrincipalFactory principalFactory,
                                                    OAuthClient authClient,
                                                    AuthenticationSchemeProperties schemeProperties) {
    OAuthAuthenticationScheme authenticationScheme = new OAuthAuthenticationScheme(pluginDescriptor, principalFactory, authClient, schemeProperties);
    loginConfiguration.registerAuthModuleType(authenticationScheme);
    return authenticationScheme;
}
 
Example #13
Source File: LoginViaOAuthLoginPageExtension.java    From teamcity-oauth with Apache License 2.0 5 votes vote down vote up
public LoginViaOAuthLoginPageExtension(@NotNull final PagePlaces pagePlaces,
                                       @NotNull final PluginDescriptor pluginDescriptor,
                                       @NotNull final AuthenticationSchemeProperties schemeProperties) {
    super(pagePlaces,
            PlaceId.LOGIN_PAGE,
            LoginViaOAuthLoginPageExtension.class.getName(),
            pluginDescriptor.getPluginResourcesPath(PluginConstants.Web.LOGIN_EXTENSION_PAGE));
    this.schemeProperties = schemeProperties;
    register();
}
 
Example #14
Source File: SlackNotificationAjaxSettingsListPageController.java    From tcSlackBuildNotifier with MIT License 5 votes vote down vote up
public SlackNotificationAjaxSettingsListPageController(SBuildServer server, WebControllerManager webManager,
                                                          ProjectSettingsManager settings, SlackNotificationPayloadManager manager, PluginDescriptor pluginDescriptor,
                                                          SlackNotificationMainSettings mainSettings) {
    super(server);
    myWebManager = webManager;
    myServer = server;
    mySettings = settings;
    myPluginDescriptor = pluginDescriptor;
    myManager = manager;
       myMainSettings = mainSettings;
}
 
Example #15
Source File: BuildSummaryLinkExtension.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
public BuildSummaryLinkExtension(@NotNull final WebControllerManager manager,
                                 @NotNull final PluginDescriptor pluginDescriptor,
                                 @NotNull final SBuildServer server) {
    super(manager, PlaceId.BUILD_SUMMARY, pluginDescriptor.getPluginName(), "buildSummary.jsp");
    myServer = server;
    register();
}
 
Example #16
Source File: ServerManagementProjectTab.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
public ServerManagementProjectTab(@NotNull final PagePlaces pagePlaces,
                                  @NotNull final PluginDescriptor pluginDescriptor,
                                  @NotNull final SQSManager sqsManager,
                                  @NotNull final SecurityContext securityContext) {
    super(pagePlaces, pluginDescriptor.getPluginName(), "manageSonarServers.jsp", TAB_TITLE);
    mySqsManager = sqsManager;
    this.securityContext = securityContext;
    addCssFile(pluginDescriptor.getPluginResourcesPath("manageSonarServers.css"));
    addJsFile(pluginDescriptor.getPluginResourcesPath("manageSonarServers.js"));
}
 
Example #17
Source File: SQMSBeginRunType.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
public SQMSBeginRunType(@NotNull final RunTypeRegistry runTypeRegistry,
                        @NotNull final PropertiesProcessorProvider propertiesProcessorProvider,
                        @NotNull final PluginDescriptor pluginDescriptor) {
    myPropertiesProcessorProvider = propertiesProcessorProvider;
    myPluginDescriptor = pluginDescriptor;
    runTypeRegistry.registerRunType(this);
}
 
Example #18
Source File: SimpleZipToolProviderSQMSBuild.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
public SimpleZipToolProviderSQMSBuild(@NotNull final PluginDescriptor pluginDescriptor,
                                      @NotNull final SonarQubeMSBuildToolType sonarQubeScannerToolType) {
    myPluginDescriptor = pluginDescriptor;
    myToolType = sonarQubeScannerToolType;
    myPackedSonarQubeScannerRootZipPattern = myToolType.getType() + "[\\.-]" + VERSION_PATTERN + ZIP_EXTENSION;
    myPackedSonarQubeScannerRootDirPattern = myToolType.getType() + "[\\.-]" + VERSION_PATTERN;
}
 
Example #19
Source File: SQMSFinishRunType.java    From TeamCity.SonarQubePlugin with Apache License 2.0 5 votes vote down vote up
public SQMSFinishRunType(@NotNull final RunTypeRegistry runTypeRegistry,
                         @NotNull final PropertiesProcessorProvider propertiesProcessorProvider,
                         @NotNull final PluginDescriptor pluginDescriptor) {
    myPropertiesProcessorProvider = propertiesProcessorProvider;
    myPluginDescriptor = pluginDescriptor;
    runTypeRegistry.registerRunType(this);
}
 
Example #20
Source File: WebParameterProvider.java    From teamcity-web-parameters with MIT License 5 votes vote down vote up
public WebParameterProvider(
        @NotNull PluginDescriptor pluginDescriptor,
        @NotNull WebOptionsManager webOptionsManager,
        @NotNull ProjectManager projectManager) {
    this.pluginDescriptor = pluginDescriptor;
    this.webOptionsManager = webOptionsManager;
    this.projectManager = projectManager;
    this.errors = new HashMap<>();
}
 
Example #21
Source File: SymbolServerSettingsTab.java    From teamcity-symbol-server with Apache License 2.0 5 votes vote down vote up
public SymbolServerSettingsTab(@NotNull final PagePlaces pagePlaces,
                               @NotNull final SecurityContext context,
                               @NotNull final PluginDescriptor descriptor) {
  super(pagePlaces,
          PlaceId.ADMIN_SERVER_CONFIGURATION_TAB,
          TAB_ID,
          descriptor.getPluginResourcesPath("symbolServerSettings.jsp"),
          "Symbol Server");
  mySecurityContext = context;
  register();
}
 
Example #22
Source File: ChooserController.java    From teamcity-kubernetes-plugin with Apache License 2.0 5 votes vote down vote up
public ChooserController(WebControllerManager web,
                         PluginDescriptor pluginDescriptor,
                         KubeAuthStrategyProvider authStrategyProvider) {
    myPluginDescriptor = pluginDescriptor;
    myAuthStrategyProvider = authStrategyProvider;
    web.registerController(getUrl(), this);
}
 
Example #23
Source File: AllureRunType.java    From allure-teamcity with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public AllureRunType(
        @NotNull final RunTypeRegistry registry,
        @NotNull final PluginDescriptor descriptor) {
    this.pluginDescriptor = descriptor;
    registry.registerRunType(this);
}
 
Example #24
Source File: KubeDeleteImageDialogController.java    From teamcity-kubernetes-plugin with Apache License 2.0 5 votes vote down vote up
public KubeDeleteImageDialogController(WebControllerManager web,
                                       PluginDescriptor pluginDescriptor,
                                       CloudManagerBase cloudManager) {
    myPluginDescriptor = pluginDescriptor;
    myCloudManager = cloudManager;
    web.registerController(getUrl(), this);
}
 
Example #25
Source File: KubeCloudClientFactory.java    From teamcity-kubernetes-plugin with Apache License 2.0 5 votes vote down vote up
public KubeCloudClientFactory(@NotNull final CloudRegistrar registrar,
                              @NotNull final PluginDescriptor pluginDescriptor,
                              @NotNull final ServerSettings serverSettings,
                              @NotNull final KubeAuthStrategyProvider authStrategies,
                              @NotNull final BuildAgentPodTemplateProviders podTemplateProviders,
                              @NotNull final KubePodNameGenerator kubePodNameGenerator,
                              @NotNull final KubeBackgroundUpdater updater) {
    myPluginDescriptor = pluginDescriptor;
    myServerSettings = serverSettings;
    myAuthStrategies = authStrategies;
    myPodTemplateProviders = podTemplateProviders;
    myKubePodNameGenerator = kubePodNameGenerator;
    myUpdater = updater;
    registrar.registerCloudFactory(this);
}
 
Example #26
Source File: TelegramSettingsPage.java    From teamcity-telegram-plugin with Apache License 2.0 5 votes vote down vote up
public TelegramSettingsPage(@NotNull PagePlaces places,
                            @NotNull PluginDescriptor descriptor,
                            @NotNull TelegramSettingsManager settingsManager) {
  super(places);
  setPluginName(PLUGIN_NAME);
  setTabTitle("Telegram Notifier");
  setIncludeUrl(descriptor.getPluginResourcesPath("telegramSettings.jsp"));
  setPosition(PositionConstraint.after("email", "jabber"));
  register();
  this.settingsManager = settingsManager;
}
 
Example #27
Source File: S3SettingsController.java    From teamcity-s3-artifact-storage-plugin with Apache License 2.0 5 votes vote down vote up
public S3SettingsController(@NotNull final WebControllerManager manager,
                            @NotNull final PluginDescriptor descriptor,
                            @NotNull final ServerPaths serverPaths) {
  myServerPaths = serverPaths;
  final String path = descriptor.getPluginResourcesPath(S3Constants.S3_SETTINGS_PATH + ".html");
  manager.registerController(path, this);
  myHandlers.put("buckets", new BucketsResourceHandler());
  myHandlers.put("bucketLocation", new BucketLocationHandler());
}
 
Example #28
Source File: S3StorageType.java    From teamcity-s3-artifact-storage-plugin with Apache License 2.0 5 votes vote down vote up
public S3StorageType(@NotNull ArtifactStorageTypeRegistry registry,
                     @NotNull PluginDescriptor descriptor,
                     @NotNull ServerSettings serverSettings,
                     @NotNull ServerPaths serverPaths) {
  mySettingsJSP = descriptor.getPluginResourcesPath(S3Constants.S3_SETTINGS_PATH + ".jsp");
  myServerSettings = serverSettings;
  myServerPaths = serverPaths;
  registry.registerStorageType(this);
}
 
Example #29
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 #30
Source File: DeployerRunTypeTest.java    From teamcity-deployer-plugin with Apache License 2.0 5 votes vote down vote up
@BeforeMethod
public void setUp() {
  myContext = new Mockery();
  final RunTypeRegistry registry = myContext.mock(RunTypeRegistry.class);
  final PluginDescriptor descriptor = myContext.mock(PluginDescriptor.class);
  myContext.checking(new Expectations() {{
    allowing(registry).registerRunType(with(aNonNull(SSHExecRunType.class)));
  }});
  createRunType(registry, descriptor);
}