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


Java ProjectManager类代码示例

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


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

示例1: handleAjaxAction

import azkaban.project.ProjectManager; //导入依赖的package包/类
/**
 * ProjectServlet class now handles ajax requests. It returns a
 * @SimplifiedProject object: information regarding projects, and information
 * regarding user and project association
 * 
 * @param req
 * @param resp
 * @param session
 * @param manager
 * @throws ServletException
 * @throws IOException
 */
private void handleAjaxAction(HttpServletRequest req,
    HttpServletResponse resp, Session session, ProjectManager manager)
    throws ServletException, IOException {

  String ajaxName = getParam(req, "ajax");
  HashMap<String, Object> ret = new HashMap<String, Object>();

  if (ajaxName.equals("fetchallprojects")) {
    List<Project> projects = manager.getProjects();
    List<SimplifiedProject> simplifiedProjects =
        toSimplifiedProjects(projects);
    ret.put("projects", simplifiedProjects);
  } else if (ajaxName.equals("fetchuserprojects")) {
    handleFetchUserProjects(req, session, manager, ret);
  }

  this.writeJSON(resp, ret);
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:31,代码来源:ProjectServlet.java

示例2: handleGet

import azkaban.project.ProjectManager; //导入依赖的package包/类
@Override
protected void handleGet(HttpServletRequest req, HttpServletResponse resp,
    Session session) throws ServletException, IOException {

  ProjectManager manager =
      ((AzkabanWebServer) getApplication()).getProjectManager();

  if (hasParam(req, "ajax")) {
    handleAjaxAction(req, resp, session, manager);
  } else if (hasParam(req, "doaction")) {
    handleDoAction(req, resp, session);
  } else {
    handlePageRender(req, resp, session, manager);
  }
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:16,代码来源:ProjectServlet.java

示例3: handlePageRender

import azkaban.project.ProjectManager; //导入依赖的package包/类
/**
 * Renders the user homepage that users see when they log in
 * 
 * @param req
 * @param resp
 * @param session
 * @param manager
 */
private void handlePageRender(HttpServletRequest req,
    HttpServletResponse resp, Session session, ProjectManager manager) {
  User user = session.getUser();

  Page page =
      newPage(req, resp, session, "azkaban/webapp/servlet/velocity/index.vm");

  if (lockdownCreateProjects && !hasPermissionToCreateProject(user)) {
    page.add("hideCreateProject", true);
  }

  List<Project> projects;
  if (hasParam(req, "all")) {
    projects = manager.getProjects();
    page.add("viewProjects", "all");
  } else if (hasParam(req, "group")) {
    projects = manager.getGroupProjects(user);
    page.add("viewProjects", "group");
  } else {
    projects = manager.getUserProjects(user);
    page.add("viewProjects", "personal");
  }
  for (Project pro : projects) {
    String des = pro.getDescription();
    des = des.replace("\n", "<br/>");
    pro.setDescription(des);
  }
  Collections.sort(projects, new Comparator() {
    public int compare(Object a, Object b) {
      int one = ((Project) a).getId();
      int two = ((Project) b).getId();
      return one - two;
    }
  });
  page.add("projects", projects);

  page.render();
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:47,代码来源:ProjectServlet.java

示例4: handleFilter

import azkaban.project.ProjectManager; //导入依赖的package包/类
private void handleFilter(HttpServletRequest req, HttpServletResponse resp,
    Session session, String searchTerm) {
  User user = session.getUser();
  ProjectManager manager =
      ((AzkabanWebServer) getApplication()).getProjectManager();
  Page page =
      newPage(req, resp, session, "azkaban/webapp/servlet/velocity/index.vm");
  List<Project> projects;
  if (hasParam(req, "all")) {
    // do nothing special if one asks for 'ALL' projects
    projects = manager.getProjectsByRegex(searchTerm);
    page.add("allProjects", "");
    page.add("search_term", searchTerm);
  } else {
    projects = manager.getUserProjectsByRegex(user, searchTerm);
    page.add("search_term", searchTerm);
  }
  Collections.sort(projects, new Comparator() {
    public int compare(Object a, Object b) {
      int one = ((Project) a).getId();
      int two = ((Project) b).getId();
      return one - two;
    }
  });
  page.add("projects", projects);

  page.render();
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:29,代码来源:ProjectServlet.java

示例5: getUserReportalProjects

import azkaban.project.ProjectManager; //导入依赖的package包/类
public static List<Project> getUserReportalProjects(AzkabanWebServer server,
    String userName) throws ProjectManagerException {
  ProjectManager projectManager = server.getProjectManager();
  List<Project> projects = projectManager.getProjects();
  List<Project> result = new ArrayList<Project>();

  for (Project project : projects) {
    if (userName.equals(project.getMetadata().get("reportal-user"))) {
      result.add(project);
    }
  }

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

示例6: 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

示例7: 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

示例8: loadProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
private ProjectManager loadProjectManager(Props props) {
  logger.info("Loading JDBC for project management");
  JdbcProjectLoader loader = new JdbcProjectLoader(props);
  ProjectManager manager = new ProjectManager(loader, props);
  return manager;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:7,代码来源:AzkabanWebServer.java

示例9: getProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
public static ProjectManager getProjectManager() {
  return projectManager;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:4,代码来源:ExecuteFlowAction.java

示例10: setProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
public static void setProjectManager(ProjectManager projectManager) {
  ExecuteFlowAction.projectManager = projectManager;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:4,代码来源:ExecuteFlowAction.java

示例11: loadProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
private ProjectManager loadProjectManager(Props props) {
	logger.info("Loading JDBC for project management");
	JdbcProjectLoader loader = new JdbcProjectLoader(props);
	ProjectManager manager = new ProjectManager(loader, props);
	return manager;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:7,代码来源:AzkabanWebServer.java

示例12: getProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
public static ProjectManager getProjectManager() {
	return projectManager;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:4,代码来源:ExecuteFlowAction.java

示例13: setProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
public static void setProjectManager(ProjectManager projectManager) {
	ExecuteFlowAction.projectManager = projectManager;
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:4,代码来源:ExecuteFlowAction.java

示例14: 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

示例15: getProjectManager

import azkaban.project.ProjectManager; //导入依赖的package包/类
/**
 *
 * @return
 */
public ProjectManager getProjectManager() {
  return projectManager;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:8,代码来源:AzkabanWebServer.java


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