Search in sources :

Example 41 with GroupHelper

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

the class SelectedThesaurus method regenArkIdGroup.

/**
 * Cette fonction remplace tout les id des groupes du théso
 *
 * @param conn
 * @param idTheso
 * @return la liste des nouveaux id group #MR
 */
private boolean regenArkIdGroup(Connection conn, String idTheso) throws Exception {
    // récup les concepts
    GroupHelper groupHelper = new GroupHelper();
    ArrayList<String> idGroups = groupHelper.getListIdOfGroup(conn, idTheso);
    if (idGroups == null || idGroups.isEmpty()) {
        throw new Exception("No group in this thesaurus");
    }
    // vérification et génération des nouveaux id Ark
    for (String idGroup : idGroups) {
    // if(!) return false;
    }
    return true;
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) SQLException(java.sql.SQLException)

Example 42 with GroupHelper

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

the class StatBean method getGroupFromThesaurus.

/**
 * #JM
 * Méthode pour avoir les grouep d'un thésaurus
 * @param idTheso
 * @param langue
 */
public void getGroupFromThesaurus(String idTheso, String langue) {
    ArrayList<NodeGroup> ngs = new GroupHelper().getListConceptGroup(connect.getPoolConnexion(), idTheso, langue);
    statGroup = new ArrayList<>();
    for (NodeGroup ng : ngs) {
        this.statGroup.add(ng.getLexicalValue() + "(" + ng.getConceptGroup().getIdgroup() + ")");
    }
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Example 43 with GroupHelper

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

the class NewTreeBean method changeNumerotation.

/**
 *fin fonction *
 */
/**
 *fonction pour changer la numérotation d'un souis groupe *************
 */
public void changeNumerotation() {
    GroupHelper gh = new GroupHelper();
    gh.saveSuffixFromNode(this.connect.getPoolConnexion(), idThesoSelected, ((MyTreeNode) this.selectedNode).getIdConcept(), "" + this.nouveauSuffixe);
    reInit();
    this.initTree(idThesoSelected, ((MyTreeNode) this.selectedNode).getLangue());
// reExpand();
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 44 with GroupHelper

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

the class NewTreeBean method onDragDrop.

/**
 * *******************fonctions drag drop #JM*****************************
 */
/**
 * ***********************************************************************
 */
/**
 * Fonction pour récupérer l'éveneme drag drop de l'arbre
 *
 * @param event
 */
public void onDragDrop(TreeDragDropEvent event) {
    MyTreeNode dragNode = (MyTreeNode) event.getDragNode();
    MyTreeNode dropNode = (MyTreeNode) event.getDropNode();
    idsBT = new ArrayList<>();
    idsBTRemoveNode = new ArrayList<>();
    TreeChange treeChange = new TreeChange();
    // int dropIndex = event.getDropIndex();
    this.draggedNode = dragNode;
    this.parentId = dragNode.getIdParent();
    this.droppedNode = dropNode;
    ArrayList<String> idsbt = null;
    RelationsHelper relationsHelper = new RelationsHelper();
    ConceptHelper conceptHelper = new ConceptHelper();
    GroupHelper groupHelper = new GroupHelper();
    if (dragNode.isIsTopConcept()) {
        idsbt = dragNode.getOtherGroup();
    } else {
        idsbt = relationsHelper.getListIdOfBT(connect.getPoolConnexion(), dragNode.getIdConcept(), idThesoSelected);
    }
    ArrayList<StructIdBroaderTerm> sibt = new ArrayList<>();
    for (String id : idsbt) {
        StructIdBroaderTerm elem = new StructIdBroaderTerm();
        String idLang = (selectedTerme.getIdlangue().isEmpty()) ? defaultLanguage : selectedTerme.getIdlangue();
        String idGroup = conceptHelper.getGroupIdOfConcept(connect.getPoolConnexion(), id, idThesoSelected);
        String lexicalValue = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id, idThesoSelected, idLang);
        String lexicalValueGroup = groupHelper.getLexicalValueOfGroup(connect.getPoolConnexion(), idGroup, idThesoSelected, idLang);
        elem.setIdBroaderTerm(id);
        elem.setIdGroupBroaderTerm(idGroup);
        elem.setLexicalValueTerm(lexicalValue);
        elem.setLexicalValueGroup(lexicalValueGroup);
        sibt.add(elem);
    }
    idsBT.addAll(sibt);
    if ("fichier".equals(event.getDropNode().getType())) {
        treeChange.changeLeafToDirectory(event.getDragNode(), event.getDropNode());
    }
    if (!"fichier".equals(event.getDropNode().getType()) && !"dossier".equals(event.getDropNode().getType())) {
        treeChange.changeToGroupChild(event.getDragNode(), event.getDropNode());
    }
    treeChange.saveExpandedNodes(root);
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ArrayList(java.util.ArrayList) MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode) StructIdBroaderTerm(mom.trd.opentheso.dragdrop.StructIdBroaderTerm) RelationsHelper(mom.trd.opentheso.bdd.helper.RelationsHelper) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 45 with GroupHelper

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

the class NewTreeBean method delGroup.

/**
 * ************************** ACTIONS SELECTEDTERME
 * ***************************
 */
/**
 * Supprime le groupe sélectionné
 */
public void delGroup() {
    new GroupHelper().deleteConceptGroup(connect.getPoolConnexion(), selectedTerme.getIdC(), selectedTerme.getIdTheso(), selectedTerme.getUser().getUser().getId());
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("tree.info7")));
    reInit();
    initTree(selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    selectedTerme.reInitTerme();
}
Also used : GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) FacesMessage(javax.faces.application.FacesMessage)

Aggregations

GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)79 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)38 ArrayList (java.util.ArrayList)22 NodeGroup (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)18 SQLException (java.sql.SQLException)16 Connection (java.sql.Connection)14 FacesMessage (javax.faces.application.FacesMessage)13 ThesaurusHelper (mom.trd.opentheso.bdd.helper.ThesaurusHelper)9 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)9 ConceptGroupLabel (mom.trd.opentheso.bdd.datas.ConceptGroupLabel)8 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)8 NodeUri (mom.trd.opentheso.bdd.helper.nodes.NodeUri)8 NodeGroupLabel (mom.trd.opentheso.bdd.helper.nodes.group.NodeGroupLabel)8 PrefixString (com.k_int.IR.QueryModels.PrefixString)7 NodeAutoCompletion (mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)6 DefaultTreeNode (org.primefaces.model.DefaultTreeNode)6 HashMap (java.util.HashMap)5 Concept (mom.trd.opentheso.bdd.datas.Concept)5 OrphanHelper (mom.trd.opentheso.bdd.helper.OrphanHelper)5 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)5