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