Is there a tutorial on step by step implementation of developing plugin

All,
I 'm beginner to teamcity and have begun to explore how to write plugins.

What I wanted to acheieve is
   1.Hide the top Navigation Bar when I click on a project (Projects, Build Queue, myChanges should be hidden)


I was looking at page.tag and I knew how to acheive it. Currently I''m taking a parameter called displayHeader which will be set to false. If it it set to false, then I will not add the following code in page.tag



<c:if test="${empty sessionScope['displayHeader'] or sessionScope['displayHeader'] =='true'}">  
     <script type="text/javascript">
      if (topNavPane) {
             topNavPane.showIn('tabsContainer');
             BS.AllProjectsPopup.install();
      }
      if (userPanelNav) {
        userPanelNav.showIn('userPanel');
      }      
    </script>

  </c:if>

How do I write a plugin so that all jsp's will point to new page.tag rather than System page.tag..

Any team city guru's help will be appreciated...

Thanks
Subbarao

6 comments
Comment actions Permalink

Some useful information about plugin development in TeamCity can be obtained here: http://confluence.jetbrains.net/display/TCD5/Extending+TeamCity

In your case I think you can write an extension for page header, (see http://confluence.jetbrains.net/display/TCD5/Web+UI+Extensions) which will hide navigation tab using JavaScript. page.tag itself can't be modified programmatically, that is why JS way is better.

0
Comment actions Permalink

What I was asking some Examples with Step by step approach for different plugins such web UI Extensions, Server side etc...
May be this is my 3rd day with teamcity, I'm struggling...

Any inputs or Examples will be appreciated...

Thanks
Subbarao

0
Comment actions Permalink

Paver,
I created a redirect.jsp file as follows


<script type="text/javascript">
Behaviour.addLoadEvent(function() {
BS.Hider.hideDiv('tabsContainer')
BS.Hider.hideDiv('userPanel');
});
</script>

I created a Extension called
import javax.servlet.http.HttpServletRequest;
import jetbrains.buildServer.web.openapi.PagePlaces;
import jetbrains.buildServer.web.openapi.PlaceId;
import jetbrains.buildServer.web.openapi.SimplePageExtension;
import jetbrains.buildServer.web.util.WebUtil;
import org.jetbrains.annotations.NotNull;

public class PageExtension extends SimplePageExtension {
  public PageExtension(PagePlaces pagePlaces) {
    super(pagePlaces, PlaceId.ALL_PAGES_HEADER, "myPlugin", "redirect.jsp");
    register();
  }
  @Override
  public boolean isAvailable(@NotNull final HttpServletRequest request) {
      return  isProjectView(request);
  }

  private boolean isProjectView(HttpServletRequest request) {
        return request.getRequestURI().endsWith("/project.html");
    }
}


Still it doesnt hide the nvaigation panel.. Can you please help in identifying the mistake..

0
Comment actions Permalink

Try to use BS.Util.hide or Prototype's Element.hide instead of BS.Hider. Actually, BS.Hider is not for hiding divs, it solves different tasks (in spite of its name).
If it won't work, please ensure your plugin is loaded by TeamCity (it should be mentioned in teamcity-server.log on startup).

0
Comment actions Permalink

Please take a look at samplePlugin.zip bundled with TeamCity distribution. While it does not contain exact solution for your task, it contains some examples of page extensions which might be useful.

0
Comment actions Permalink

team city support has been really good. Thans Paver

0

Please sign in to leave a comment.