当前位置: 首页>>代码示例>>Java>>正文


Java ProjectManager.getProject方法代码示例

本文整理汇总了Java中azkaban.project.ProjectManager.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager.getProject方法的具体用法?Java ProjectManager.getProject怎么用?Java ProjectManager.getProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azkaban.project.ProjectManager的用法示例。


在下文中一共展示了ProjectManager.getProject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createReportalProject

import azkaban.project.ProjectManager; //导入方法依赖的package包/类
public static Project createReportalProject(AzkabanWebServer server,
    String title, String description, User user)
    throws ProjectManagerException {
  ProjectManager projectManager = server.getProjectManager();
  String projectName =
      "reportal-" + user.getUserId() + "-" + sanitizeText(title);
  Project project = projectManager.getProject(projectName);
  if (project != null) {
    return null;
  }
  project = projectManager.createProject(projectName, description, user);

  return project;
}
 
开发者ID:azkaban,项目名称:azkaban-plugins,代码行数:15,代码来源:ReportalHelper.java

示例2: handleRunReportal

import azkaban.project.ProjectManager; //导入方法依赖的package包/类
private void handleRunReportal(HttpServletRequest req,
    HttpServletResponse resp, Session session) throws ServletException,
    IOException {
  int id = getIntParam(req, "id");
  ProjectManager projectManager = server.getProjectManager();
  Page page =
      newPage(req, resp, session,
          "azkaban/viewer/reportal/reportalrunpage.vm");
  preparePage(page, session);

  Project project = projectManager.getProject(id);
  Reportal reportal = Reportal.loadFromProject(project);

  if (reportal == null) {
    page.add("errorMsg", "Report not found");
    page.render();
    return;
  }

  if (reportal.getAccessExecutors().size() > 0
      && !hasPermission(project, session.getUser(), Type.EXECUTE)) {
    page.add("errorMsg", "You are not allowed to run this report.");
    page.render();
    return;
  }

  page.add("projectId", id);
  page.add("title", reportal.title);
  page.add("description", reportal.description);

  List<Variable> runtimeVariables =
    ReportalUtil.getRunTimeVariables(reportal.variables);
  if (runtimeVariables.size() > 0) {
    page.add("variableNumber", runtimeVariables.size());
    page.add("variables", runtimeVariables);
  }

  page.render();
}
 
开发者ID:azkaban,项目名称:azkaban-plugins,代码行数:40,代码来源:ReportalServlet.java

示例3: handleEditReportal

import azkaban.project.ProjectManager; //导入方法依赖的package包/类
private void handleEditReportal(HttpServletRequest req,
    HttpServletResponse resp, Session session) throws ServletException,
    IOException {
  int id = getIntParam(req, "id");
  ProjectManager projectManager = server.getProjectManager();

  Page page =
      newPage(req, resp, session,
          "azkaban/viewer/reportal/reportaleditpage.vm");
  preparePage(page, session);
  page.add("ReportalHelper", ReportalHelper.class);

  Project project = projectManager.getProject(id);
  Reportal reportal = Reportal.loadFromProject(project);

  List<String> errors = new ArrayList<String>();

  if (reportal == null) {
    errors.add("Report not found");
    page.add("errorMsgs", errors);
    page.render();
    return;
  }

  if (!hasPermission(project, session.getUser(), Type.ADMIN)) {
    errors.add("You are not allowed to edit this report.");
    page.add("errorMsgs", errors);
    page.render();
    return;
  }

  page.add("projectId", id);
  page.add("title", reportal.title);
  page.add("description", reportal.description);
  page.add("queryNumber", reportal.queries.size());
  page.add("queries", reportal.queries);
  page.add("variableNumber", reportal.variables.size());
  page.add("variables", reportal.variables);
  page.add("schedule", reportal.schedule);
  page.add("scheduleHour", reportal.scheduleHour);
  page.add("scheduleMinute", reportal.scheduleMinute);
  page.add("scheduleAmPm", reportal.scheduleAmPm);
  page.add("scheduleTimeZone", reportal.scheduleTimeZone);
  page.add("scheduleDate", reportal.scheduleDate);
  page.add("endScheduleDate", reportal.endSchedule);
  page.add("scheduleRepeat", reportal.scheduleRepeat);
  page.add("scheduleIntervalQuantity", reportal.scheduleIntervalQuantity);
  page.add("scheduleInterval", reportal.scheduleInterval);
  page.add("renderResultsAsHtml", reportal.renderResultsAsHtml);
  page.add("notifications", reportal.notifications);
  page.add("failureNotifications", reportal.failureNotifications);
  page.add("accessViewer", reportal.accessViewer);
  page.add("accessExecutor", reportal.accessExecutor);
  page.add("accessOwner", reportal.accessOwner);

  page.add("max_allowed_schedule_dates", max_allowed_schedule_dates);
  page.add("default_schedule_dates", default_schedule_dates);
  page.render();
}
 
开发者ID:azkaban,项目名称:azkaban-plugins,代码行数:60,代码来源:ReportalServlet.java


注:本文中的azkaban.project.ProjectManager.getProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。