Examples of WebResource


Examples of org.eclipse.wst.server.core.util.WebResource

    IModule[] modules = ServerUtil.getModules(project);
    if (modules == null || modules.length == 0) {
      return null;
    }
    return new WebResource(modules[0], Path.EMPTY);
  }
View Full Code Here

Examples of org.eclipse.wst.server.core.util.WebResource

                            url = new URL(url, path);
                        } else {
                            url = new URL(url, "servlet/" + servlet.getServletClassName()); //$NON-NLS-1$
                        }
                    } else if (moduleObject instanceof WebResource) {
                        WebResource resource = (WebResource) moduleObject;
                        String path = resource.getPath().toString();
                        if (path != null && path.startsWith("/") && path.length() > 0) { //$NON-NLS-1$
                            path = path.substring(1);
                        }
                        if (path != null && path.length() > 0) {
                            url = new URL(url, path);
View Full Code Here

Examples of org.jboss.security.authorization.resources.WebResource

      final HashMap map =  new HashMap();
      map.put("catalina.request",request);
      map.put("catalina.constraints",constraints);
      map.put("catalina.context", context);
      map.put("authorizationManager",authzManager);
      WebResource resource = new WebResource(map);
      try
      {
         int check = authzManager.authorize(resource);
         isAuthorized = (check == AuthorizationContext.PERMIT);
      }
View Full Code Here

Examples of org.sonatype.nexus.webresources.WebResource

    }
    else if (path.endsWith("/")) {
      path += "index.html";
    }

    WebResource resource = webResources.getResource(path);
    if (resource == null) {
      // if there is an index.html for the requested path, redirect to it
      if (webResources.getResource(path + "/index.html") != null) {
        String location = String.format("%s%s/", BaseUrlHolder.get(), path);
        log.debug("Redirecting: {} -> {}", path, location);
View Full Code Here

Examples of wicket.markup.html.WebResource

  {
    super(id, parameters);

    this.course = (Course) parameters.get(Parameters.COURSE);

    final WebResource export = new WebResource()
    {
      /**
       *
       */
      private static final long serialVersionUID = 7267314593474884211L;

      @Override
      public IResourceStream getResourceStream()
      {
        final List<InscriptionLine> inscriptions = new Vector<InscriptionLine>(
            CollectionUtils.collect(ListeInscritsPanel.this.course.getInscriptions()
                .getList(), InscriptionLine.TR_INSCRIPTION));

        final HSSFWorkbook wb = new HSSFWorkbook();
        final HSSFSheet sheet = wb.createSheet("Inscriptions");

        sheet.setColumnWidth((short) 0, (short) 5500);
        sheet.setColumnWidth((short) 1, (short) 6500);
        sheet.setColumnWidth((short) 2, (short) 6500);
        sheet.setColumnWidth((short) 3, (short) 2000);
        sheet.setColumnWidth((short) 4, (short) 3500);
        sheet.setColumnWidth((short) 5, (short) 6000);
        sheet.setColumnWidth((short) 6, (short) 7000);
        sheet.setColumnWidth((short) 7, (short) 3500);
        sheet.setColumnWidth((short) 8, (short) 3500);

        // --------- En-tête -----------
        HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 18);
        font.setFontName("Arial");

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

        HSSFRow row = sheet.createRow((short) 0);
        HSSFCell cell = row.createCell((short) 0);
        cell.setCellValue(ListeInscritsPanel.this.course.getEvenement().getSaison().getNom()
            + " - " + ListeInscritsPanel.this.course.getEvenement().getNom() + " - "
            + ListeInscritsPanel.this.course.getNom() + " - Liste des inscriptions");
        cell.setCellStyle(style);

        // --------- Séparateur -----------
        sheet.createRow((short) 1);

        // --------- En-tête de colonne -------
        font = wb.createFont();
        font.setFontHeightInPoints((short) 10);
        font.setFontName("Arial");
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

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

        row = sheet.createRow((short) 2);
        row.createCell((short) 0).setCellValue("No. Licence");
        row.createCell((short) 1).setCellValue("Nom");
        row.createCell((short) 2).setCellValue("Prénom");
        row.createCell((short) 3).setCellValue("Sexe");
        row.createCell((short) 4).setCellValue("Date de naissance");
        row.createCell((short) 5).setCellValue("Catégorie");
        row.createCell((short) 6).setCellValue("Club");
        row.createCell((short) 7).setCellValue("No. Plaque");
        row.createCell((short) 8).setCellValue("No. Confirmation");

        HSSFUtils.applyStyle(row, style);

        // --------- Liste des inscrits -------
        int i = 3;

        for (final InscriptionLine line : inscriptions)
        {
          row = sheet.createRow((short) ++i);
          row.createCell((short) 0).setCellValue(line.getLicence());
          row.createCell((short) 1).setCellValue(line.getNom());
          row.createCell((short) 2).setCellValue(line.getPrenom());
          row.createCell((short) 3).setCellValue(line.getSexe());

          cell = row.createCell((short) 4);
          cell.setCellValue(line.getDateNaissance());

          style = wb.createCellStyle();
          style.setDataFormat(HSSFDataFormat
              .getBuiltinFormat("m/d/yy"));
          cell.setCellStyle(style);

          row.createCell((short) 5).setCellValue(line.getCategorie());
          row.createCell((short) 6).setCellValue(line.getClub());
          row.createCell((short) 7).setCellValue(line.getNoPlaque());
          row.createCell((short) 8).setCellValue(
              line.getNoConfirmation());
        }

        try
        {
          FileOutputStream fileOut = new FileOutputStream("temp.xls");
          wb.write(fileOut);
          fileOut.close();
        }
        catch (FileNotFoundException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        catch (IOException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
       
        return new FileResourceStream(new File("temp.xls"));
      }

      @Override
      protected void setHeaders(WebResponse response)
      {
        super.setHeaders(response);
        response.setAttachmentHeader("inscriptions - "
            + ListeInscritsPanel.this.course.getEvenement().getEndroit() + ".xls");
      }
    };
    export.setCacheable(false);
    this.add(new ResourceLink("download", export));

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.