use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class WriteFileSKOS_Frantiq method writeThesaurus.
public boolean writeThesaurus(NodeThesaurus nodeThesaurus) {
// Ecriture de la balise de declaration du thesaurus
String xml = " <skos:ConceptScheme rdf:about=\"" + URI + "idt=" + nodeThesaurus.getIdThesaurus() + "\">\n";
// balises DublinCore pour le libellé du thésaurus
for (Thesaurus listThesaurusTraduction : nodeThesaurus.getListThesaurusTraduction()) {
if (!listThesaurusTraduction.getTitle().trim().isEmpty()) {
xml += " <dc:title xml:lang=";
xml += "\"" + listThesaurusTraduction.getLanguage() + "\">";
xml += listThesaurusTraduction.getTitle();
xml += "</dc:title>";
xml += "\n";
}
}
skosBuff.append(xml);
return true;
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class SelectedThesaurus method getThisTheso.
/**
* *************************************** AUTRE
* ****************************************
*/
/**
* Récupère le thésaurus courant
*
* @return le thésaurus s'il existe, null sinon
*/
public Thesaurus getThisTheso() {
String idTemp = "", lTemp = "";
if (thesaurus == null || thesaurus.getLanguage() == null || thesaurus.getId_thesaurus() == null) {
return null;
}
if (thesaurus.getLanguage() != null) {
lTemp = thesaurus.getLanguage();
}
if (thesaurus.getId_thesaurus() != null) {
idTemp = thesaurus.getId_thesaurus();
}
Thesaurus tempT = new ThesaurusHelper().getThisThesaurus(connect.getPoolConnexion(), idTemp, lTemp);
return tempT;
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class showPermuted method loadStatPermuted.
public void loadStatPermuted(String idTheso, String idLange) throws SQLException {
Thesaurus datatheso = new Thesaurus();
Connexion conn = new Connexion();
String id_theso = datatheso.getId_thesaurus();
String langue = datatheso.getLanguage();
statTheso = new ArrayList<>();
ArrayList<NodeGroup> lng = new GroupHelper().getListConceptGroup2(connect.getPoolConnexion(), idTheso, idLange);
StatisticHelper sh = new StatisticHelper();
for (NodeGroup ng : lng) {
prendrePermuted nst = new prendrePermuted();
nst.setOrd(ng.getOrde());
nst.setId_concept(ng.getId_concept());
nst.setId_group(ng.getId_group());
nst.setId_theso(idTheso);
nst.setId_lang(idLange);
nst.setLexical_value(ng.getLexicalValue());
nst.setIspreferredterm(ng.isIspreferredterm());
nst.setOriginal_value(ng.getOriginal_value());
statTheso.add(nst);
}
vue.setStatPermuted(true);
vue.setStatTheso(false);
vue.setStatCpt(false);
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class AccessThesaurusHelper method getAThesaurus.
/**
* Fonction getAThesaurus
* #JM
* permet de récupérer un thésaurus d'après son identifiant
* @param ds
* @param idTheso
* @param idLang
* @return
*/
public Thesaurus getAThesaurus(HikariDataSource ds, String idTheso, String idLang) {
Connection conn;
PreparedStatement stmt;
Thesaurus th = new Thesaurus();
ResultSet rs;
try {
conn = ds.getConnection();
try {
String sql = "SELECT * FROM thesaurus INNER JOIN thesaurus_label ON thesaurus.id_thesaurus=thesaurus_label.id_thesaurus WHERE thesaurus.id_thesaurus=? AND lang=?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, idTheso);
stmt.setString(2, idLang);
try {
rs = stmt.executeQuery();
if (rs.next()) {
th.setContributor(rs.getString("contributor"));
th.setCoverage(rs.getString("coverage"));
th.setCreated(rs.getDate("created"));
th.setCreator(rs.getString("creator"));
th.setDescription(rs.getString("description"));
th.setFormat(rs.getString("format"));
th.setId_ark(rs.getString("id_ark"));
th.setId_thesaurus(rs.getString("id_thesaurus"));
th.setLanguage(rs.getString("lang"));
th.setModified(rs.getDate("modified"));
th.setPublisher(rs.getString("publisher"));
th.setRelation(rs.getString("relation"));
th.setRights(rs.getString("rights"));
th.setSource(rs.getString("source"));
th.setSubject(rs.getString("subject"));
th.setTitle(rs.getString("title"));
th.setType(rs.getString("type"));
th.setVisibility(rs.getBoolean("private"));
} else {
log.error("la requete n'a pas trouver de thesaurus associé à l'idenitifiant");
}
} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException e) {
log.error("error while retrieving a thesaurus from the bdd " + th.toString(), e);
}
return th;
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class BaseDeDonnesBean method pdf.
/**
* permet de generer une document pour pouvoir le telecharger
* le format c'est pdf
* @return
* @throws SQLException
* @throws Exception
*/
public StreamedContent pdf() throws SQLException, Exception {
Thesaurus thesaurus = new Thesaurus();
ExportStatistiques expo = new ExportStatistiques();
expo.recuperatefils(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage(), 2);
Document pdf = new Document(PageSize.LETTER);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter writer;
Paragraph para = new Paragraph(expo.getDocument());
writer = PdfWriter.getInstance(pdf, baos);
if (!pdf.isOpen()) {
pdf.open();
}
pdf.addTitle("theso");
pdf.add(para);
// Adding content to pdf
pdf.close();
InputStream stream = new ByteArrayInputStream(baos.toByteArray());
fileDownload = new DefaultStreamedContent(stream, "application/pdf", "Thésaurus" + thesaurus.getId_thesaurus() + ".pdf");
return fileDownload;
}
Aggregations