コード例 #1
0
  public void createPosition() {
    if (scripts == null || scripts.isEmpty()) {
      MetaUtils.setMsg("Please select at least a script", FacesMessage.SEVERITY_ERROR);
      return;
    }
    positionService.createNewPosition(
        title,
        selectedLocalizations,
        state,
        vacancies,
        closingDate,
        sla,
        contactPerson,
        company,
        selectedTechnicalAreas,
        description,
        scripts,
        selectedChannels);
    title = null;
    selectedLocalizations = null;
    state = null;
    vacancies = 1;
    closingDate = null;
    sla = 1;
    contactPerson = null;
    company = null;
    selectedTechnicalAreas = null;
    description = null;
    script = null;
    selectedChannels = null;
    scripts = null;

    MetaUtils.setMsg("Position created", FacesMessage.SEVERITY_INFO);
  }
コード例 #2
0
 public void updatePosition() {
   if (scripts.size() == 0) {
     MetaUtils.setMsg("At least 1 script needed", FacesMessage.SEVERITY_ERROR);
     return;
   }
   position = positionService.updatePosition(position, scripts);
   MetaUtils.setMsg("Position updated", FacesMessage.SEVERITY_INFO);
 }
コード例 #3
0
  public void createChart(
      DataModel<String, Long> data, String label, String title, String axisX, String axisY) {
    if (data == null) {
      MetaUtils.setMsg("No data to display", FacesMessage.SEVERITY_INFO);
      return;
    }

    barModel = init(data, label);

    barModel.setTitle(title);
    barModel.setLegendPosition("ne");

    Axis xAxis = barModel.getAxis(AxisType.X);
    xAxis.setLabel(axisX);

    Axis yAxis = barModel.getAxis(AxisType.Y);
    yAxis.setLabel(axisY);
    yAxis.setMin(0);

    long max = 0;
    for (DataPoint<String, Long> p : data.getPoints()) {
      max = Math.max(max, p.getY());
    }
    yAxis.setMax(max);
  }