Search in sources :

Example 11 with ConceptHelper

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

the class GpsBeans method doForLot.

public void doForLot(int id_user) {
    ConceptHelper conceptHelper = new ConceptHelper();
    TermHelper termHelper = new TermHelper();
    String id_term = termHelper.getIdTermOfConcept(connect.getPoolConnexion(), id_concept, id_theso);
    try {
        doAll(id_concept, id_theso, id_user, id_langue, id_term);
    } catch (ParserConfigurationException ex) {
        Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Example 12 with ConceptHelper

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

the class NewTreeBean method fusionConcept.

/**
 * Fusionne les concepts avec mise à  jour dans l'abre
 */
public void fusionConcept() {
    if (selectedTerme.getConceptFusionId().equals(selectedTerme.getIdC())) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error"), langueBean.getMsg("error")));
        selectedTerme.setConceptFusionId(null);
        selectedTerme.setConceptFusionAlign(null);
        selectedTerme.setConceptFusionNodeRT(null);
    } else {
        int idUser = selectedTerme.getUser().getUser().getId();
        for (NodeRT rt : selectedTerme.getConceptFusionNodeRT()) {
            HierarchicalRelationship hr = new HierarchicalRelationship(rt.getIdConcept(), selectedTerme.getConceptFusionId(), selectedTerme.getIdTheso(), "RT");
            new ConceptHelper().addAssociativeRelation(connect.getPoolConnexion(), hr, idUser);
        }
        for (NodeAlignment na : selectedTerme.getConceptFusionAlign()) {
            new AlignmentHelper().addNewAlignment(connect.getPoolConnexion(), idUser, na.getConcept_target(), na.getThesaurus_target(), na.getUri_target(), na.getAlignement_id_type(), selectedTerme.getConceptFusionId(), selectedTerme.getIdTheso(), 0);
        }
        new ConceptHelper().addConceptFusion(connect.getPoolConnexion(), selectedTerme.getConceptFusionId(), selectedTerme.getIdC(), selectedTerme.getIdTheso(), idUser);
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("tree.info6")));
        reInit();
        reExpand();
    }
    selectedTerme.setSelectedTermComp(new NodeAutoCompletion());
    vue.setAddTInfo(0);
}
Also used : NodeRT(mom.trd.opentheso.bdd.helper.nodes.NodeRT) NodeAlignment(mom.trd.opentheso.bdd.helper.nodes.NodeAlignment) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) HierarchicalRelationship(mom.trd.opentheso.bdd.datas.HierarchicalRelationship) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) FacesMessage(javax.faces.application.FacesMessage) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 13 with ConceptHelper

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

the class AlignementParLotBean method nextPosition.

/**
 * Cette fonction permet de passer au concept suivant. et fait l'apelation a
 * la funtion pour créer l'alignement (la funtion apelé est dans
 * selecteTerme
 */
public void nextPosition() {
    if (fin) {
        return;
    }
    erreur = "";
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    ConceptHelper conceptHelper = new ConceptHelper();
    listConceptTrates.add(id_concept);
    if (optionNonAligned == optionOfAlignement) {
        position++;
        if (position < listOfChildrenInConcept.size()) {
            id_concept = listOfChildrenInConcept.get(position);
        }
        checkEndConcepts();
        while (alignmentHelper.isAlignedWithThisSource(connect.getPoolConnexion(), id_concept, id_theso, selectedTerme.alignementSource.getId())) {
            // alignement_id_type)) {
            position++;
            if (fin) {
                return;
            }
            if (position < listOfChildrenInConcept.size()) {
                id_concept = listOfChildrenInConcept.get(position);
            }
            checkEndConcepts();
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    if ((optionAllBranch == optionOfAlignement) || (optionWorkFlow == optionOfAlignement)) {
        position++;
        checkEndConcepts();
        if (position < listOfChildrenInConcept.size()) {
            id_concept = listOfChildrenInConcept.get(position);
        } else {
            return;
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    selectedTerme.creerAlignAuto(id_concept, nomduterm);
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper)

Example 14 with ConceptHelper

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

the class AlignementParLotBean method isNonAligne.

/**
 * Permet d'avoir le premier element si la option c'est non aligne
 *
 * @param id_Concept
 * @param id_theso
 * @param id_user
 */
public void isNonAligne(String id_Concept, String id_theso, int id_user) {
    ConceptHelper conceptHelper = new ConceptHelper();
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    if (!alignmentHelper.isAlignedWithThisSource(connect.getPoolConnexion(), id_Concept, id_theso, selectedTerme.alignementSource.getId())) {
        // si n'est pas aligne
        id_concept = listOfChildrenInConcept.get(0);
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), listOfChildrenInConcept.get(0), selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
        selectedTerme.creerAlignAuto(listOfChildrenInConcept.get(0), nomduterm);
    } else {
        // si il est déjà aligne
        nextPosition();
    }
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper)

Example 15 with ConceptHelper

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

the class AlignementParLotBean method getListChildren.

/**
 * Permet de savoir combien d'enfants a le concept selectionnée
 *
 * @param id_Theso
 * @param id_Concept
 */
public void getListChildren(String id_Theso, String id_Concept) {
    reinitTotal();
    initOption();
    id_concept_depart = id_Concept;
    id_concept = id_Concept;
    id_theso = id_Theso;
    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)

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