How to pass parameters to, and instantiate a Notificator?

I am trying to develop a Notifier for TeamCity, that will post info related to a build to a chat site. I am new to TeamCity development, and I need a way to pass arguments (username, and password), so that the notifier will be able to access the site, and post. How do I pass this? Can  pass it in the constructor of the `NotificatorAdapter`? If so, how do I make sure that those credential are passed? Do I have to create a JSP page for people to enter the credentials then create a controller to creaet and register the notifier?

1 comment
Comment actions Permalink

Hello James,

   You should configure global Username/Password parameters on a separate configuration screen, and provide JSP/controller for that.
   Such global configuration screen should extend jetbrains.buildServer.controllers.admin.AdminPage, and in extension of this page
   you can specify the JSP/controller for your settings page, its title, and relative position of your extension in the list.

   The sample code is:

 
public class BuildTimeTab extends AdminPage {
  private static final String NAME = "buildTime";
  private static final String TITLE = "Build Time";


  public BuildTimeTab(final @NotNull PagePlaces pagePlaces) {
    super(pagePlaces, NAME, "/admin/buildTime/buildTime.html", TITLE);
    register();
    setPosition(PositionConstraint.before("diskUsage"));
  }

  @NotNull
  public
String getGroup() {
    return Groupable.PROJECT_RELATED_GROUP;
  }
}



   Some more corresponding documentation is available here: https://confluence.jetbrains.com/display/TCD9/Web+UI+Extensions

   Regards,
   KIR

0

Please sign in to leave a comment.