Package org.xrace.model.evenements

Examples of org.xrace.model.evenements.Saison


    final Categorie categorieXmxF = getCategorieService().findByCode(
        "XMX30", "F", disciplineXC);
    final Categorie categorieDssF = getCategorieService().findByCode("DSS",
        "F", disciplineDH);

    final Saison saison2007 = getSaisonService().findByAnnee(2007)
        .iterator().next();

    final Evenement evenement1 = getEvenementService().getEvenementParNo(
        saison2007, 1);
    final Evenement evenement2 = getEvenementService().getEvenementParNo(
View Full Code Here


    }
    autresInfosForm.add(obligatoire);
    autresInfosForm.add(noPlaque);

    CheckBox conditionCheckBox;
    Saison saison = gestionProcessusInscription.getProcessusInscription()
        .getSaisonSelectionnee();
    autresInfosForm.add(conditionCheckBox = new CheckBox(
        "conditionCheckBox", new Model(new Boolean(false))));
    autresInfosForm.add(conditionARespecterFr = new Label(
        "conditionARespecterFr", new PropertyModel(saison,
            "conditionARespecterFr")));
    autresInfosForm.add(conditionARespecterEn = new Label(
        "conditionARespecterEn", new PropertyModel(saison,
            "conditionARespecterEn")));

    if (StringUtils.isNotBlank(saison.getConditionARespecterFr()))
    {
      conditionCheckBox.setVisible(true);
      conditionCheckBox.setRequired(true);
    }
    else
View Full Code Here

   * Permet de mettre à jour l'affichage des champs sensibles à langue.
   */
  @Override
  protected void onBeforeRender()
  {
    Saison saison = gestionProcessusInscription.getProcessusInscription()
        .getSaisonSelectionnee();
    conditionARespecterFr.setVisible(!StringUtils.isBlank(saison
        .getConditionARespecterFr())
        && getLocale().equals(Locale.FRENCH));
    conditionARespecterEn.setVisible(!StringUtils.isBlank(saison
        .getConditionARespecterEn())
        && getLocale().equals(Locale.ENGLISH));
    super.onBeforeRender();
  }
View Full Code Here

  public ListePlaquePage(final Saison saison)
  {
    super();

    final Saison saisonReload = saisonService.find(saison.getId());

    final Collection<PlaqueAttribueeLine> plaques = new Vector<PlaqueAttribueeLine>(
        CollectionUtils.collect(saisonReload.getInfosSaison(),
            PlaqueAttribueeLine.TR_INFO_SAISON));

    final List<CategorieParticipante> categoriesParticipantes = saisonReload
        .getCategoriesParticipantes();
    //Call pour initializer la liste.
    categoriesParticipantes.iterator();

    final WebResource export = new WebResource()
    {
      private static final long serialVersionUID = -479972350710704177L;

      @Override
      public IResourceStream getResourceStream()
      {
        final SelectionStrategy selectStr = new PlaqueFixeSelectionStrategy(
            saisonReload, categorieParticipanteService);
        final OrderingStrategy orderStr = new ComparatorOrderingStrategy(
            PlaqueAttribueeLine.COMP_NOM_PRENOM);

        final HSSFWorkbook wb = new HSSFWorkbook();
        int sheetIndex = -1;

        final HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 12);
        font.setFontName("Arial");

        final HSSFCellStyle style = wb.createCellStyle();
        style.setFont(font);

        for (CategorieParticipante catPart : categoriesParticipantes)
        {
          int categorySheetIndex = -1;

          Collection<PlaqueAttribueeLine> plaquesCategorie = selectStr
              .getResult(catPart.getCategorie(), plaques);
          plaquesCategorie = orderStr.getResult(plaquesCategorie);

          final Iterator<PlaqueAttribueeLine> itLine = plaquesCategorie
              .iterator();

          while (itLine.hasNext())
          {
            final HSSFSheet sheet = newSheet(wb, catPart
                .getCategorie(), ++categorySheetIndex);
            sheetIndex++;
            sheet.getPrintSetup().setLandscape(true);
            boolean emptySheet = true;

            for (short j = 0; j < ListePlaquePage.COLONNES_PAR_PAGE; j++)
            {
              for (short k = 0; k < ListePlaquePage.LIGNES_PAR_PAGE; k++)
              {
                if (itLine.hasNext())
                {
                  final PlaqueAttribueeLine line = itLine
                      .next();

                  //Seules les feuilles où il y a au moins un nom
                  //sont incluses dans le classeur.
                  if (line.getNomPrenom() != null
                      && !line.getNomPrenom().equals(""))
                  {
                    emptySheet = false;
                  }

                  final HSSFRow row = sheet
                      .createRow(getIndexLigne(k));

                  HSSFCell cell = row
                      .createCell(getIndexColonne(
                          j,
                          ListePlaquePage.INDEX_PLAQUE));
                  cell.setCellValue(new HSSFRichTextString(
                      line.getPlaque()));
                  cell.setCellStyle(style);

                  cell = row.createCell(getIndexColonne(j,
                      ListePlaquePage.INDEX_NOM));
                  cell.setCellValue(new HSSFRichTextString(
                      line.getNomPrenom()));
                  cell.setCellStyle(style);

                  cell = row.createCell(getIndexColonne(j,
                      ListePlaquePage.INDEX_COMMENTAIRE));
                  cell.setCellValue(new HSSFRichTextString(
                      line.getCommentaire()));
                  cell.setCellStyle(style);
                }
                else
                {
                  //Aucune ligne à écrire... Terminer la boucle.
                  break;
                }
              }
            }

            //Enlever la feuille si elle est vide.
            if (emptySheet)
            {
              wb.removeSheetAt(sheetIndex--);
            }
          }
        }

        try
        {
          File file = File.createTempFile("excel", null);
          FileOutputStream fileOut = new FileOutputStream(file);
          wb.write(fileOut);
          fileOut.close();

          return new FileResourceStream(file);
        }
        catch (FileNotFoundException e)
        {
          throw new SystemeException(e);
        }
        catch (IOException e)
        {
          throw new SystemeException(e);
        }
      }

      @Override
      protected void setHeaders(WebResponse response)
      {
        super.setHeaders(response);
        response.setAttachmentHeader("Plaques - "
            + saisonReload.getAnnee().toString() + ".xls");
      }

      private HSSFSheet newSheet(final HSSFWorkbook wb,
          final Categorie categorie, final int page)
      {
View Full Code Here

TOP

Related Classes of org.xrace.model.evenements.Saison

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.