Exemplo n.º 1
0
  /**
   * Cette fonction permet de retourner la branche antière d'un groupe en SKOS
   *
   * @param idGroup
   * @param idTheso
   * @return
   */
  public StreamedContent groupToSkos(String idGroup, String idTheso) {
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setServerAdress(serverAdress);
    exportFromBDD.setServerArk(serverArk);
    exportFromBDD.setArkActive(arkActive);

    StringBuffer skos_local =
        exportFromBDD.exportGroup(connect.getPoolConnexion(), idTheso, idGroup);

    InputStream stream;

    try {
      stream = new ByteArrayInputStream(skos_local.toString().getBytes("UTF-8"));
      file = new DefaultStreamedContent(stream, "application/xml", idGroup + "_Group_skos.xml");
    } catch (UnsupportedEncodingException ex) {
      Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
    }
    return file;
  }
Exemplo n.º 2
0
  /*    public void branchSkos(String idC, String idTheso) {
      ExportFromBDD exportFromBDD = new ExportFromBDD();
      exportFromBDD.setServerAdress(serverAdress);
      exportFromBDD.setServerArk(serverArk);
      exportFromBDD.setArkActive(arkActive);

      StringBuffer temp = exportFromBDD.exportBranchOfConcept(connect.getPoolConnexion(), idTheso, idC);
      if (temp.length() <= 1500000) {
          //    if(temp.length() <= 150) {
          skos = temp.toString();
          vue.setBranchToSkos(true);
      } else {
          InputStream stream;
          try {
              stream = new ByteArrayInputStream(temp.toString().getBytes("UTF-8"));
              file = new DefaultStreamedContent(stream, "application/xml ", "downloadedSkos.xml");
          } catch (UnsupportedEncodingException ex) {
              Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
          }
          vue.setBranchToSkosFile(true);
      }
  }*/
  public void branchGroupSkos(String idGroup, String idTheso) {
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setServerAdress(serverAdress);
    exportFromBDD.setServerArk(serverArk);
    exportFromBDD.setArkActive(arkActive);

    StringBuffer temp = exportFromBDD.exportGroup(connect.getPoolConnexion(), idTheso, idGroup);
    if (temp.length() <= 1500000) {
      skos = temp.toString();
      vue.setBranchToSkos(true);
    } else {
      InputStream stream;
      try {
        stream = new ByteArrayInputStream(temp.toString().getBytes("UTF-8"));
        file = new DefaultStreamedContent(stream, "application/xml ", "downloadedSkos.xml");
      } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
      }
      vue.setBranchToSkosFile(true);
    }
  }