Search in sources :

Example 61 with ConceptHelper

use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.

the class DownloadBean method thesoCsv2.

/**
 * Cette fonction permet d'exporter un thésaurus au format CSV à partir de
 * son identifiant.
 * Il est filtré par Langue et par Groupe
 * Le résultat est enregistré dans la variable 'skos' du
 * downloadBean si la taille est petite, ou dans la variable 'file' du
 * downloadBean sinon. Dans le premier cas on affiche la variable, dans le
 * second cas l'utilisateur télécharge de fichier.
 *
 * @param idTheso
 * @param selectedLanguages
 * @param selectedGroups
 * @return
 */
public StreamedContent thesoCsv2(String idTheso, List<NodeLang> selectedLanguages, List<NodeGroup> selectedGroups) {
    progress_per_100 = 0;
    progress_abs = 0;
    ConceptHelper conceptHelper = new ConceptHelper();
    sizeOfTheso = conceptHelper.getAllIdConceptOfThesaurus(connect.getPoolConnexion(), idTheso).size();
    ExportTabulateHelper exportTabulateHelper = new ExportTabulateHelper();
    exportTabulateHelper.setThesaurusDatas(connect.getPoolConnexion(), idTheso, selectedLanguages, selectedGroups);
    exportTabulateHelper.exportToTabulate();
    StringBuffer temp = exportTabulateHelper.getTabulateBuff();
    InputStream stream;
    try {
        stream = new ByteArrayInputStream(temp.toString().getBytes("UTF-8"));
        file = new DefaultStreamedContent(stream, "text/csv", "downloadedCsv.csv");
    } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
    }
    return file;
}
Also used : DefaultStreamedContent(org.primefaces.model.DefaultStreamedContent) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ExportTabulateHelper(mom.trd.opentheso.core.exports.helper.ExportTabulateHelper) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 62 with ConceptHelper

use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.

the class DownloadBean method thesoCsv.

/**
 * Cette fonction permet d'exporter un thésaurus au format CSV à partir de
 * son identifiant. Le résultat est enregistré dans la variable 'skos' du
 * downloadBean si la taille est petite, ou dans la variable 'file' du
 * downloadBean sinon. Dans le premier cas on affiche la variable, dans le
 * second cas l'utilisateur télécharge de fichier.
 *
 * @param idTheso
 * @return
 */
public StreamedContent thesoCsv(String idTheso) {
    progress_per_100 = 0;
    progress_abs = 0;
    ConceptHelper conceptHelper = new ConceptHelper();
    sizeOfTheso = conceptHelper.getAllIdConceptOfThesaurus(connect.getPoolConnexion(), idTheso).size();
    ExportTabulateHelper exportTabulateHelper = new ExportTabulateHelper();
    exportTabulateHelper.setThesaurusDatas(connect.getPoolConnexion(), idTheso);
    exportTabulateHelper.exportToTabulate();
    StringBuffer temp = exportTabulateHelper.getTabulateBuff();
    InputStream stream;
    try {
        stream = new ByteArrayInputStream(temp.toString().getBytes("UTF-8"));
        file = new DefaultStreamedContent(stream, "text/csv", "downloadedCsv.csv");
    } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
    }
    return file;
}
Also used : DefaultStreamedContent(org.primefaces.model.DefaultStreamedContent) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ExportTabulateHelper(mom.trd.opentheso.core.exports.helper.ExportTabulateHelper) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 63 with ConceptHelper

use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.

the class GpsBeans method getListChildren.

// ///////////////*******************/////////////////////
// ///////////////*******************/////////////////////
// ///////////////   GPS PAR LOT     /////////////////////
// ///////////////*******************/////////////////////
// ///////////////*******************/////////////////////
/**
 * Permet de savoir combien d'enfants a le concept selectionnée
 *
 * @param id_Theso
 * @param id_Concept
 * @param id_lang
 */
public void getListChildren(String id_Theso, String id_Concept, String id_lang, int id_user) {
    reinitTotal();
    initOption();
    id_user1 = id_user;
    id_concept_depart = id_Concept;
    id_concept = id_Concept;
    id_theso = id_Theso;
    id_langue = id_lang;
    ConceptHelper conceptHelper = new ConceptHelper();
    listOfChildrenInConcept = new ArrayList<>();
    listOfChildrenInConcept = conceptHelper.getIdsOfBranch(connect.getPoolConnexion(), id_concept, id_Theso, listOfChildrenInConcept);
    if (listOfChildrenInConcept.isEmpty() || listOfChildrenInConcept.size() == 1) {
        last = true;
    }
    nomduterm = selectedTerme.nom;
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper)

Example 64 with ConceptHelper

use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.

the class GpsBeans method ismiseAJour.

/**
 * c'est va a faire tout les concept
 */
public void ismiseAJour(String idTheso, String id_lang) {
    ConceptHelper conceptHelper = new ConceptHelper();
    nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    try {
        creerAlignAutoParLot(id_concept, idTheso, nomduterm, id_lang);
    } catch (Exception e) {
    }
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException)

Example 65 with ConceptHelper

use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.

the class HistoriqueBean method load.

public void load(String idThesaurus, String idConcept, String idTerm, String lang) {
    if (typeHisto == 0 && dateHisto != null) {
        conceptHisto = new ConceptHelper().getConceptHisoriqueFromDate(connect.getPoolConnexion(), idConcept, idThesaurus, dateHisto);
        groupHisto = new GroupHelper().getGroupHistoriqueFromDate(connect.getPoolConnexion(), idConcept, idThesaurus, dateHisto);
        noteHisto = new NoteHelper().getNoteHistoriqueFromDate(connect.getPoolConnexion(), idConcept, idThesaurus, idTerm, lang, dateHisto);
        relationHisto = new RelationsHelper().getRelationHistoriqueFromDate(connect.getPoolConnexion(), idConcept, idThesaurus, dateHisto, lang);
        nonPrefTermHisto = new TermHelper().getNonPreferredTermsHistoriqueFromDate(connect.getPoolConnexion(), idTerm, idThesaurus, lang, dateHisto);
        termHisto = new TermHelper().getTermsHistoriqueFromDate(connect.getPoolConnexion(), idTerm, idThesaurus, lang, dateHisto);
    } else if (typeHisto == 1) {
        conceptHisto = new ConceptHelper().getConceptHisoriqueAll(connect.getPoolConnexion(), idConcept, idThesaurus);
        groupHisto = new GroupHelper().getGroupHistoriqueAll(connect.getPoolConnexion(), idConcept, idThesaurus);
        noteHisto = new NoteHelper().getNoteHistoriqueAll(connect.getPoolConnexion(), idConcept, idThesaurus, idTerm, lang);
        relationHisto = new RelationsHelper().getRelationHistoriqueAll(connect.getPoolConnexion(), idConcept, idThesaurus, lang);
        nonPrefTermHisto = new TermHelper().getNonPreferredTermsHistoriqueAll(connect.getPoolConnexion(), idTerm, idThesaurus, lang);
        termHisto = new TermHelper().getTermsHistoriqueAll(connect.getPoolConnexion(), idTerm, idThesaurus, lang);
    }
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) NoteHelper(mom.trd.opentheso.bdd.helper.NoteHelper) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) RelationsHelper(mom.trd.opentheso.bdd.helper.RelationsHelper) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Aggregations

ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)125 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)38 SQLException (java.sql.SQLException)36 Connection (java.sql.Connection)29 ArrayList (java.util.ArrayList)28 FacesMessage (javax.faces.application.FacesMessage)23 Concept (mom.trd.opentheso.bdd.datas.Concept)18 AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)16 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)16 Term (mom.trd.opentheso.bdd.datas.Term)15 PrefixString (com.k_int.IR.QueryModels.PrefixString)14 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)14 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)13 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)12 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)12 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)12 HashMap (java.util.HashMap)9 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)9 NodeConceptExport (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport)9 NodeTerm (mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm)9