use of mom.trd.opentheso.bdd.helper.TermHelper in project opentheso by miledrousset.
the class SelectedTerme method delSyno.
/**
* *************************************** SUPPRESSION
* ****************************************
*/
/**
* Supprime le terme synonyme dont la valeur est passée en paramètre
*
* @param value
* @param status
*/
public void delSyno(String value, String status) {
new TermHelper().deleteNonPreferedTerm(connect.getPoolConnexion(), idT, idlangue, value, idTheso, status, user.getUser().getId());
majSyno();
vue.setAddTSyno(0);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", value + " " + langueBean.getMsg("sTerme.info6")));
}
use of mom.trd.opentheso.bdd.helper.TermHelper in project opentheso by miledrousset.
the class SelectedTerme method onNodeExpand.
/**
* Expension de l'abre sur un seul noeud (ouvert manuellement)
*
* @param event Le noeud ouvert
*/
public void onNodeExpand(NodeExpandEvent event) {
String theso = ((MyTreeNode) event.getTreeNode()).getIdTheso();
String lang = ((MyTreeNode) event.getTreeNode()).getLangue();
// Récupération des facettes
ArrayList<Integer> listIdFacet = new FacetHelper().getIdFacetUnderConcept(connect.getPoolConnexion(), ((MyTreeNode) event.getTreeNode()).getIdConcept(), theso);
ArrayList<NodeFacet> listFacet = new ArrayList<>();
for (Integer id : listIdFacet) {
NodeFacet nf = new FacetHelper().getThisFacet(connect.getPoolConnexion(), id, theso, lang);
listFacet.add(nf);
}
// <Retirer noeuds fictifs>
if (event.getTreeNode().getChildCount() == 1) {
event.getTreeNode().getChildren().remove(0);
}
// Récupération et insertion des facettes avec leurs concepts
for (NodeFacet nf : listFacet) {
String valeur = nf.getLexicalValue() + "(" + String.valueOf(nf.getIdFacet()) + ")";
new MyTreeNode(1, String.valueOf(nf.getIdFacet()), theso, lang, "", "", "", "facette", valeur, event.getTreeNode());
ArrayList<String> listIdC = new FacetHelper().getIdConceptsOfFacet(connect.getPoolConnexion(), nf.getIdFacet(), theso);
ArrayList<NodeConceptTree> liste = new ArrayList<>();
for (String id : listIdC) {
String value = new TermHelper().getThisTerm(connect.getPoolConnexion(), id, theso, lang).getLexical_value();
NodeConceptTree nct = new NodeConceptTree();
nct.setHaveChildren(false);
nct.setIdConcept(id);
nct.setIdLang(lang);
nct.setIdThesaurus(theso);
nct.setTitle(value);
liste.add(nct);
}
// Ajout dans l'arbre
for (NodeConceptTree nct : liste) {
new MyTreeNode(3, nct.getIdConcept(), theso, lang, "", "", "", "fichier", nct.getTitle() + "(" + nct.getIdConcept() + ")", event.getTreeNode());
}
}
}
use of mom.trd.opentheso.bdd.helper.TermHelper in project opentheso by miledrousset.
the class SelectedTerme method majNoticeZ3950.
private void majNoticeZ3950() {
// ResourceBundle bundlePref = getBundlePref();
if (user.getNodePreference().isZ3950actif()) {
try {
Properties p = new Properties();
p.put("CollectionDataSourceClassName", "com.k_int.util.Repository.XMLDataSource");
p.put("RepositoryDataSourceURL", "file:" + user.getNodePreference().getPathNotice1());
p.put("XSLConverterConfiguratorClassName", "com.k_int.IR.Syntaxes.Conversion.XMLConfigurator");
p.put("ConvertorConfigFile", user.getNodePreference().getPathNotice2());
Searchable federated_search_proxy = new HeterogeneousSetOfSearchable();
federated_search_proxy.init(p);
try {
IRQuery e = new IRQuery();
// e.collections = new Vector<String>();
e.collections.add(user.getNodePreference().getCollectionAdresse());
e.hints.put("default_element_set_name", "f");
e.hints.put("small_set_setname", "f");
e.hints.put("record_syntax", "unimarc");
e.query = new PrefixString((new StringBuilder("@attrset bib-1 @attr 1=Koha-Auth-Number \"")).append(AsciiUtils.convertNonAscii("" + idC)).append("\"").toString());
SearchTask st = federated_search_proxy.createTask(e, null);
st.evaluate(5000);
nbNotices = st.getTaskResultSet().getFragmentCount();
st.destroyTask();
federated_search_proxy.destroy();
for (NodeFusion nf : getFusions()) {
if (nf.getIdConcept1().equals(idC)) {
String idTe = new TermHelper().getIdTermOfConcept(connect.getPoolConnexion(), nf.getIdConcept2(), idTheso);
nbNotices += getNotice(idTe);
}
}
} catch (TimeoutExceededException | SearchException srch_e) {
// srch_e.printStackTrace();
}
urlNotice = user.getNodePreference().getNoticeUrl();
try {
// String url_notices = "http://catalogue.frantiq.fr/cgi-bin/koha/opac-search.pl?idx=su%2Cwrdl&q=terme&idx=kw&idx=kw&sort_by=relevance&do=OK";
urlNotice = urlNotice.replace("terme", URLEncoder.encode("" + idC, user.getNodePreference().getUrlEncode()));
} catch (UnsupportedEncodingException ex) {
// Logger.getLogger(SelectedTerme.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (Exception e) {
}
}
}
use of mom.trd.opentheso.bdd.helper.TermHelper in project opentheso by miledrousset.
the class SelectedTerme method modifierTraduction.
/**
* Cette fontion permet de modifier une Traduction
*/
public void modifierTraduction() {
int idUser = user.getUser().getId();
Term term = new Term();
term.setLexical_value(valueOfTraductionToModify);
term.setId_term(idT);
term.setId_thesaurus(idTheso);
term.setLang(langEnTraduction);
if (!new TermHelper().updateTermTraduction(connect.getPoolConnexion(), term, idUser)) {
// erreur
}
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.modifyLang")));
majLangueConcept();
}
use of mom.trd.opentheso.bdd.helper.TermHelper in project opentheso by miledrousset.
the class AutoCompletBean method completTerm.
public List<NodeAutoCompletion> completTerm(String value) {
selectedAtt = new NodeAutoCompletion();
List<NodeAutoCompletion> liste = new ArrayList<>();
if (theso.getThesaurus().getId_thesaurus() != null && theso.getThesaurus().getLanguage() != null) {
liste = new TermHelper().getAutoCompletionTerm(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage(), value);
}
return liste;
}
Aggregations