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");
}
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");
}
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);
}
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");
}
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<>();
}
Aggregations