Search in sources :

Example 11 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromTTToSubGroupOtherDomain.

/**
 * fromTTToSubGroupOtherDomain déplace un top terme vers un sous groupe d'un
 * autre domaine
 */
public void fromTTToSubGroupOtherDomain() {
    TreeChange tc = new TreeChange();
    tc.moveTopTermToOtherDomaine(connect, draggedNode.getIdConcept(), draggedNode.getIdCurrentGroup(), droppedNode.getIdCurrentGroup(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
// System.out.println("from top term to sub group other domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Example 12 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromConceptToTTOtherDomain.

/**
 * fromConceptToTTOtherDomain déplace un concept vers un top terme d'un
 * autre domaine
 */
public void fromConceptToTTOtherDomain() {
    for (String idBT : idsBTRemoveNode) {
        TreeChange tc = new TreeChange();
        tc.moveConceptTermToConceptTermOtherDomain(connect, draggedNode.getIdConcept(), draggedNode.getIdCurrentGroup(), idBT, droppedNode.getIdConcept(), droppedNode.getIdCurrentGroup(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
    }
// System.out.println(" from concept m to top term other  domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Example 13 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange 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 14 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromConceptToSubGroupOtherDomain.

/**
 * fromConceptToSubGroupOtherDomain déplacement d'un concept vers un sous
 * groupe d'un autre domaine
 */
public void fromConceptToSubGroupOtherDomain() {
    for (String idBT : idsBTRemoveNode) {
        TreeChange tc = new TreeChange();
        tc.moveConceptToGroupOtherDomain(connect, draggedNode.getIdConcept(), idBT, draggedNode.getIdCurrentGroup(), droppedNode.getIdConcept(), droppedNode.getIdCurrentGroup(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
    }
// System.out.println(" from concept  to  sub group other domain   domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Example 15 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method callreExpande.

private void callreExpande() {
    TreeChange tc = new TreeChange();
    tc.saveExpandedNodes(root);
    if (selectedTerme.getIdlangue().isEmpty()) {
        initTree(idThesoSelected, defaultLanguage);
    } else {
        initTree(idThesoSelected, selectedTerme.getIdlangue());
    }
    this.reExpandNodes(root, tc);
    idsBT = new ArrayList<>();
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Aggregations

TreeChange (mom.trd.opentheso.dragdrop.TreeChange)19 ArrayList (java.util.ArrayList)2 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)2 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)2 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)1 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)1 StructIdBroaderTerm (mom.trd.opentheso.dragdrop.StructIdBroaderTerm)1 DefaultTreeNode (org.primefaces.model.DefaultTreeNode)1 TreeNode (org.primefaces.model.TreeNode)1