use of mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup in project opentheso by miledrousset.
the class GroupHelper method getListConceptGroup.
/**
* Permet de retourner une ArrayList de NodeConceptGroup par langue et par
* thésaurus / ou null si rien cette fonction ne retourne pas les détails et
* les traductions Si le Domaine n'est pas traduit dans la langue en cours,
* on récupère l'identifiant pour l'afficher à la place
*
* @param ds le pool de connexion
* @param idThesaurus
* @param idLang
* @return Objet Class ArrayList NodeConceptGroup
*/
public ArrayList<NodeGroup> getListConceptGroup(HikariDataSource ds, String idThesaurus, String idLang) {
ArrayList<NodeGroup> nodeConceptGroupList;
ArrayList tabIdConceptGroup = getListIdOfGroup(ds, idThesaurus);
nodeConceptGroupList = new ArrayList<>();
for (Object tabIdGroup1 : tabIdConceptGroup) {
NodeGroup nodeConceptGroup;
nodeConceptGroup = getThisConceptGroup(ds, tabIdGroup1.toString(), idThesaurus, idLang);
if (nodeConceptGroup == null) {
return null;
}
nodeConceptGroupList.add(nodeConceptGroup);
}
return nodeConceptGroupList;
}
use of mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup in project opentheso by miledrousset.
the class GroupHelper method getGroupTraductionsHistoriqueAll.
/**
* Cette fonction permet de récupérer l'historique des traductions d'un
* groupe
*
* @param ds
* @param idGroup
* @param idThesaurus
* @param lang
* @return
*/
public ArrayList<NodeGroup> getGroupTraductionsHistoriqueAll(HikariDataSource ds, String idGroup, String idThesaurus, String lang) {
Connection conn;
Statement stmt;
ArrayList<NodeGroup> nodeGroupList = null;
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select lexicalvalue, modified, idgroup, username from concept_group_label_historique, users " + "where id = '" + idGroup + "'" + " and lang = '" + lang + "'" + " and idthesaurus = '" + idThesaurus + "'" + " and concept_group_label_historique.id_user=users.id_user" + "' order by modified DESC";
ResultSet resultSet = stmt.executeQuery(query);
if (resultSet != null) {
nodeGroupList = new ArrayList<>();
while (resultSet.next()) {
NodeGroup nodeGroup = new NodeGroup();
nodeGroup.getConceptGroup().setIdgroup(idGroup);
nodeGroup.setIdUser(resultSet.getString("username"));
nodeGroup.setModified(resultSet.getDate("modified"));
nodeGroup.getConceptGroup().setId(resultSet.getInt("idgroup"));
nodeGroup.getConceptGroup().setIdthesaurus(idThesaurus);
nodeGroup.setLexicalValue(resultSet.getString("lexicalvalue"));
nodeGroup.setIdLang(lang);
nodeGroupList.add(nodeGroup);
}
}
} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while getting All traductions historique of group : " + idGroup, sqle);
}
return nodeGroupList;
}
use of mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup in project opentheso by miledrousset.
the class GroupHelper method getGroupTraductionsHistoriqueFromDate.
/**
* Cette fonction permet de récupérer l'historique des traductions d'un
* groupe à une date précise
*
* @param ds
* @param idGroup
* @param idThesaurus
* @param lang
* @param date
* @return
*/
public ArrayList<NodeGroup> getGroupTraductionsHistoriqueFromDate(HikariDataSource ds, String idGroup, String idThesaurus, String lang, Date date) {
Connection conn;
Statement stmt;
ArrayList<NodeGroup> nodeGroupList = null;
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select lexicalvalue, modified, idgroup, username from concept_group_label_historique, users " + "where id = '" + idGroup + "'" + " and lang = '" + lang + "'" + " and idthesaurus = '" + idThesaurus + "'" + " and concept_group_label_historique.id_user=users.id_user" + " and modified <= '" + date.toString() + "' order by modified DESC";
ResultSet resultSet = stmt.executeQuery(query);
if (resultSet != null) {
nodeGroupList = new ArrayList<>();
while (resultSet.next()) {
NodeGroup nodeGroup = new NodeGroup();
nodeGroup.getConceptGroup().setIdgroup(idGroup);
nodeGroup.setIdUser(resultSet.getString("username"));
nodeGroup.setModified(resultSet.getDate("modified"));
nodeGroup.getConceptGroup().setId(resultSet.getInt("idgroup"));
nodeGroup.getConceptGroup().setIdthesaurus(idThesaurus);
nodeGroup.setLexicalValue(resultSet.getString("lexicalvalue"));
nodeGroup.setIdLang(lang);
nodeGroupList.add(nodeGroup);
}
}
} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while getting date traductions historique of group : " + idGroup, sqle);
}
return nodeGroupList;
}
use of mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup in project opentheso by miledrousset.
the class SelectedCandidat method showGroup.
/**
* permet de récupérer les Groups du concept sur lequel il faut accrocher le candidat
* @param np
*/
private void showGroup(NodeProposition np) {
boolean first = true;
ArrayList<NodeGroup> nodeGroups = new GroupHelper().getListGroupOfConcept(connect.getPoolConnexion(), idTheso, np.getIdConceptParent(), langueTheso);
for (NodeGroup nodeGroup : nodeGroups) {
if (first) {
domaine = nodeGroup.getLexicalValue();
first = false;
} else {
domaine = domaine + "; " + nodeGroup.getLexicalValue();
}
}
}
use of mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup in project opentheso by miledrousset.
the class SelectedCandidat method setLevelInfos.
/**
* permet d'initialiser les Groupes pour le niveau de concept sélectionné dans le thésauurus
* @param idConcept
* @param idLang
* @return
*/
private boolean setLevelInfos(String idConcept, String idLang) {
GroupHelper groupHelper = new GroupHelper();
ArrayList<NodeGroup> nodeGroups = groupHelper.getListGroupOfConcept(connect.getPoolConnexion(), idTheso, idConcept, idLang);
if (nodeGroups == null)
return false;
String tmp = "";
boolean first = true;
for (NodeGroup nodeGroup : nodeGroups) {
if (!first)
tmp = tmp + "; ";
tmp = tmp + nodeGroup.getLexicalValue();
first = false;
}
selectedNvx.setGroupLexicalValue(tmp);
return true;
}
Aggregations