use of mom.trd.opentheso.ws.handle.HandleHelper in project opentheso by miledrousset.
the class NewTreeBean method delSubGroup.
/**
* Supprime le groupe sélectionné
*/
public void delSubGroup() {
Connection conn;
try {
conn = connect.getPoolConnexion().getConnection();
conn.setAutoCommit(false);
if (!new GroupHelper().deleteConceptGroupRollBack(conn, selectedTerme.getIdC(), selectedTerme.getIdTheso(), selectedTerme.getUser().getUser().getIdUser())) {
conn.rollback();
conn.close();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("error") + " :", langueBean.getMsg("group.errorDelete")));
return;
}
// pour supprimer le Handle si c'est activé
if (roleOnTheso.getNodePreference() != null) {
if (roleOnTheso.getNodePreference().isUseHandle()) {
HandleHelper handleHelper = new HandleHelper(roleOnTheso.getNodePreference());
if (!handleHelper.deleteIdHandle(selectedTerme.getIdHandle(), selectedTerme.getIdTheso())) {
conn.rollback();
conn.close();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("error") + " :", langueBean.getMsg("group.errorDelete")));
return;
}
}
}
conn.commit();
conn.close();
} catch (Exception e) {
System.err.println(e.toString());
}
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("tree.info7")));
reInit();
initTree(selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
selectedTerme.reInitTerme();
}
use of mom.trd.opentheso.ws.handle.HandleHelper in project opentheso by miledrousset.
the class NewTreeBean method delGroup.
/**
* ************************** ACTIONS SELECTEDTERME
* ***************************
*/
/**
* Supprime le groupe sélectionné
* @param idGroup
* @param idTheso
* @param idHandle
* @param idUser
*/
public void delGroup(String idGroup, String idTheso, String idHandle, int idUser) {
Connection conn;
try {
conn = connect.getPoolConnexion().getConnection();
conn.setAutoCommit(false);
if (!new GroupHelper().deleteConceptGroupRollBack(conn, idGroup, idTheso, idUser)) {
conn.rollback();
conn.close();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("error") + " :", langueBean.getMsg("group.errorDelete")));
return;
}
// pour supprimer le Handle si c'est activé
if (roleOnTheso.getNodePreference() != null) {
if (roleOnTheso.getNodePreference().isUseHandle()) {
HandleHelper handleHelper = new HandleHelper(roleOnTheso.getNodePreference());
if (!handleHelper.deleteIdHandle(idHandle, selectedTerme.getIdTheso())) {
conn.rollback();
conn.close();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("error") + " :", langueBean.getMsg("group.errorDelete")));
return;
}
}
}
conn.commit();
conn.close();
} catch (Exception e) {
System.err.println(e.toString());
}
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("tree.info7")));
reInit();
initTree(selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
selectedTerme.reInitTerme();
}
use of mom.trd.opentheso.ws.handle.HandleHelper in project opentheso by miledrousset.
the class ConceptHelper method updateIdHandle.
/**
* Permet de mettre à jour l'identifiant Handle
*
* @param ds
* @param idConcept
* @param idThesaurus
* @return
*/
public boolean updateIdHandle(HikariDataSource ds, String idConcept, String idThesaurus) {
if (nodePreference == null) {
return false;
}
if (!nodePreference.isUseHandle()) {
return false;
}
ConceptHelper conceptHelper = new ConceptHelper();
String idHandle = conceptHelper.getIdHandleOfConcept(ds, idConcept, idThesaurus);
String privateUri = "?idc=" + idConcept + "&idt=" + idThesaurus;
HandleHelper handleHelper = new HandleHelper(nodePreference);
idHandle = handleHelper.updateIdHandle(idHandle, privateUri);
if (idHandle == null) {
message = handleHelper.getMessage();
return false;
}
return updateHandleIdOfConcept(ds, idConcept, idThesaurus, idHandle);
}
use of mom.trd.opentheso.ws.handle.HandleHelper in project opentheso by miledrousset.
the class GroupHelper method addIdHandle.
/**
* @param conn
* @param idConcept
* @param idThesaurus
* @param urlSite
* @return
*/
private boolean addIdHandle(Connection conn, String idGroup, String idThesaurus) {
if (nodePreference == null) {
return false;
}
if (!nodePreference.isUseHandle()) {
return false;
}
String privateUri = "?idg=" + idGroup + "&idt=" + idThesaurus;
HandleHelper handleHelper = new HandleHelper(nodePreference);
String idHandle = handleHelper.addIdHandle(privateUri);
if (idHandle == null) {
message = handleHelper.getMessage();
return false;
}
return updateHandleIdOfGroup(conn, idGroup, idThesaurus, idHandle);
}
use of mom.trd.opentheso.ws.handle.HandleHelper in project opentheso by miledrousset.
the class ConceptHelper method addIdHandle.
/**
* @param conn
* @param idConcept
* @param idThesaurus
* @param urlSite
* @return
*/
private boolean addIdHandle(Connection conn, String idConcept, String idThesaurus) {
if (nodePreference == null) {
return false;
}
if (!nodePreference.isUseHandle()) {
return false;
}
String privateUri = "?idc=" + idConcept + "&idt=" + idThesaurus;
HandleHelper handleHelper = new HandleHelper(nodePreference);
String idHandle = handleHelper.addIdHandle(privateUri);
if (idHandle == null) {
message = handleHelper.getMessage();
return false;
}
return updateHandleIdOfConcept(conn, idConcept, idThesaurus, idHandle);
}
Aggregations