Esempio n. 1
0
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    String ictKey = req.getParameter("key");
    Map<String, Object> context = Maps.newHashMap();
    IctEntity ictEntity = IctSearcher.findByKey(ictKey);
    IctBurndownReport ictBurndownReport;
    if (ictEntity != null) {
      ictBurndownReport = new IctReporter().reportBurnDown(ictEntity);
      context.put("ictKey", ictKey);
      context.put("jsonIctEntity", Utils.objectToJson(ictEntity));
      context.put("jsonIctBurndownReport", Utils.objectToJson(ictBurndownReport));
    }

    resp.setContentType(MediaType.TEXT_HTML);
    templateRenderer.render("/templates/web/ict/report/report.vm", context, resp.getWriter());
  }
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    if (userManager != null) {

      if (!CommonJiraPluginUtils.isAnAuthorizedJiraUser(req, userManager)) {
        CommonJiraPluginUtils.unauthorize(res, templateRenderer);
        return;
      }

      loadWebResources();

      Map<String, Object> context = Maps.newHashMap();
      context.put("jiraIssueId", req.getParameter("id"));

      templateRenderer.render(CONFIG_BROWSER_TEMPLATE, context, res.getWriter());
    }
  }
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    if (userManager != null) {
      // validation user permissions
      if (!CommonJiraPluginUtils.isAnAuthorizedJiraAdministrator(req, userManager)) {
        CommonJiraPluginUtils.unauthorize(res, templateRenderer);
        return;
      }

      // load resources and show template
      loadWebResources();
      Map<String, Object> context = Maps.newHashMap();

      if (pluginConfigService.hasConfiguration()) {
        context.put("ciUser", pluginConfigService.getConfiguration().getCiUser());
        context.put("ciUrl", pluginConfigService.getConfiguration().getCiUrl());
        context.put("ciAccessKeyId", pluginConfigService.getConfiguration().getCiAccessKeyId());
      }

      templateRenderer.render(CONFIG_BROWSER_TEMPLATE, context, res.getWriter());
    }
  }
 protected void render(
     final String template, final Map<String, Object> renderContext, final Writer output)
     throws IOException {
   templateRenderer.render(template, renderContext, output);
 }