Search in sources :

Example 1 with ConceptGroupLabel

use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.

the class ImportSkosHelper method addGroups.

/**
 * recupération des groups, subgroups
 * @return
 */
public boolean addGroups() {
    // récupération des groups ou domaine
    GroupHelper groupHelper = new GroupHelper();
    for (String idGroup : idGroups) {
        groupHelper.insertGroup(ds, idGroup, thesaurus.getId_thesaurus(), "MT", // notation
        "", adressSite, useArk, idUser);
    }
    groupHelper.insertGroup(ds, idGroupDefault, thesaurus.getId_thesaurus(), "MT", // notation
    "", adressSite, useArk, idUser);
    // ajouter les traductions des Groupes
    ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
    conceptGroupLabel.setIdgroup(idGroupDefault);
    conceptGroupLabel.setIdthesaurus(thesaurus.getId_thesaurus());
    conceptGroupLabel.setLang(langueSource);
    conceptGroupLabel.setLexicalvalue("groupDefault");
    groupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
    /*    
        GroupHelper groupHelper = new GroupHelper();
        idGroup = new ArrayList<>();//getGroups();
        idGroup.add("1");
        groupHelper.insertGroup(ds, idGroup.get(0),
                thesaurus.getId_thesaurus(), "MT", "", "", "",
                adressSite, useArk, idUser);
        
      // ajouter les traductions des Groupes
        ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
            conceptGroupLabel.setIdgroup(idGroup.get(0));
            conceptGroupLabel.setIdthesaurus(thesaurus.getId_thesaurus());
            conceptGroupLabel.setLang(langueSource);
            conceptGroupLabel.setLexicalvalue("group1");

        groupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
    */
    return true;
}
Also used : ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 2 with ConceptGroupLabel

use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.

the class WriteBranchSkosBDD method writeDomaine.

private String writeDomaine(SKOSResource resource, String id_thesaurus, String adressSite, boolean useArk, int idUser) {
    GroupHelper conceptGroupHelper = new GroupHelper();
    String idConceptGroup = getId(resource.getUri());
    conceptGroupHelper.insertGroup(ds, idConceptGroup, id_thesaurus, "D", "", adressSite, useArk, idUser);
    // ajouter les traductions des Groupes
    ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
    for (int i = 0; i < resource.getLabelsList().size(); i++) {
        conceptGroupLabel.setIdgroup(idConceptGroup);
        conceptGroupLabel.setIdthesaurus(id_thesaurus);
        conceptGroupLabel.setLang(resource.getLabelsList().get(i).getLanguage());
        conceptGroupLabel.setLexicalvalue(resource.getLabelsList().get(i).getLabel());
        conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
    }
    return idConceptGroup;
}
Also used : ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 3 with ConceptGroupLabel

use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.

the class WriteSkosBDD method writeDomaine.

public void writeDomaine(SKOSResource resource, String id_thesaurus, String id_langueSource, String adressSite, boolean useArk, int idUser) {
    GroupHelper conceptGroupHelper = new GroupHelper();
    String idConceptGroup = getId(resource.getUri());
    conceptGroupHelper.insertGroup(ds, idConceptGroup, id_thesaurus, "D", "", adressSite, useArk, idUser);
    // ajouter les traductions des Groupes
    ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
    for (int i = 0; i < resource.getLabelsList().size(); i++) {
        conceptGroupLabel.setIdgroup(idConceptGroup);
        conceptGroupLabel.setIdthesaurus(id_thesaurus);
        conceptGroupLabel.setLang(resource.getLabelsList().get(i).getLanguage());
        conceptGroupLabel.setLexicalvalue(resource.getLabelsList().get(i).getLabel());
        conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
    }
    ArrayList<SKOSRelation> relationsList = resource.getRelationsList();
    for (SKOSRelation relation : relationsList) {
        switch(relation.getProperty()) {
            // ici on a les identifiants des TopConcepts
            case SKOSProperty.narrower:
                idsTopConcept.add(getId(relation.getTargetUri()));
                break;
            default:
                break;
        }
    }
}
Also used : ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) SKOSRelation(skos.SKOSRelation) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 4 with ConceptGroupLabel

use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.

the class ImportTabuleIntoBDD method insertGroup.

private boolean insertGroup(HikariDataSource ds, TabulateDocument tabulateDocument, String idThesaurus, int idUser) {
    GroupHelper conceptGroupHelper = new GroupHelper();
    if (!conceptGroupHelper.insertGroup(ds, tabulateDocument.getId(), idThesaurus, tabulateDocument.getType(), "", "", false, idUser)) {
        return false;
    }
    // ajouter les traductions des Groupes
    ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
    for (Label prefLabel : tabulateDocument.getPrefLabels()) {
        conceptGroupLabel.setIdgroup(tabulateDocument.getId());
        conceptGroupLabel.setIdthesaurus(idThesaurus);
        conceptGroupLabel.setLang(prefLabel.getLang());
        conceptGroupLabel.setLexicalvalue(prefLabel.getLabel());
        conceptGroupHelper.addGroupTraduction(ds, conceptGroupLabel, idUser);
    }
    return true;
}
Also used : ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) Label(mom.trd.opentheso.core.exports.tabulate.Label) ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 5 with ConceptGroupLabel

use of mom.trd.opentheso.bdd.datas.ConceptGroupLabel in project opentheso by miledrousset.

the class SelectedTerme method editGroupName.

/**
 * *************************************** EDITION
 * ****************************************
 */
/**
 * Permet de modifier le nom d'un Group ou sousGroup
 *
 * @param idTheso
 * @param idGroup
 * @param idLangue
 * @param value
 * @return
 * #MR
 */
public boolean editGroupName(String idTheso, String idGroup, String idLangue, String value) {
    GroupHelper groupHelper = new GroupHelper();
    ConceptGroupLabel conceptGroupLabel = new ConceptGroupLabel();
    conceptGroupLabel.setIdthesaurus(idTheso);
    conceptGroupLabel.setIdgroup(idGroup);
    conceptGroupLabel.setLang(idLangue);
    conceptGroupLabel.setLexicalvalue(value);
    // vérification si le Groupe est traduit déjà, on fait un update
    if (groupHelper.isHaveTraduction(connect.getPoolConnexion(), idGroup, idTheso, idLangue)) {
        if (!groupHelper.updateConceptGroupLabel(connect.getPoolConnexion(), conceptGroupLabel, user.getUser().getId())) {
            return false;
        }
    } else {
        if (!groupHelper.addGroupTraduction(connect.getPoolConnexion(), conceptGroupLabel, user.getUser().getId())) {
            return false;
        }
    }
    return true;
}
Also used : ConceptGroupLabel(mom.trd.opentheso.bdd.datas.ConceptGroupLabel) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Aggregations

ConceptGroupLabel (mom.trd.opentheso.bdd.datas.ConceptGroupLabel)9 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)8 ArrayList (java.util.ArrayList)2 PrefixString (com.k_int.IR.QueryModels.PrefixString)1 DcElement (fr.mom.arkeo.soap.DcElement)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 HashMap (java.util.HashMap)1 FacesMessage (javax.faces.application.FacesMessage)1 Term (mom.trd.opentheso.bdd.datas.Term)1 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)1 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)1 NodeGroupTraductions (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroupTraductions)1 NodeTermTraduction (mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction)1 FileUtilities (mom.trd.opentheso.bdd.tools.FileUtilities)1 StringPlus (mom.trd.opentheso.bdd.tools.StringPlus)1 Label (mom.trd.opentheso.core.exports.tabulate.Label)1