use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.
the class TermeConverterLexical method getAsObject.
@Override
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
if (value != null && value.trim().length() > 0) {
NodeAutoCompletion nac = new NodeAutoCompletion();
nac.setTermLexicalValue(value);
return nac;
} else {
return null;
}
}
use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.
the class NewTreeBean method addMultipleNT.
/*fonction pour importer de multiples NT ****/
public void addMultipleNT() {
InputStream is = null;
ArrayList<String> narrowerTerm = new ArrayList<>();
try {
BufferedReader buff = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(this.multipleNT)));
String tmp = null;
while ((tmp = buff.readLine()) != null) {
String[] lineNT = tmp.split("\t");
for (String nt : lineNT) {
if (!nt.trim().equals(""))
narrowerTerm.add(nt.trim());
}
}
} catch (Exception e) {
System.out.println("Error while reading uploaded file " + e);
} finally {
try {
if (is != null)
is.close();
} catch (IOException e) {
System.out.println("error closing inputSteeam in methodd addMultipleNT " + e);
}
}
for (String nt : narrowerTerm) {
NodeAutoCompletion nac = new NodeAutoCompletion();
nac.setTermLexicalValue(nt);
this.selectedTerme.setSelectedTermComp(nac);
// this.newTSpe();
}
}
use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.
the class NewTreeBean method renameWithoutControl.
/**
* Fonction qui permet de modifier le nom d'un concept avec un autre en
* doublon (action autorisée après validation de l'utilisateur)
*/
public void renameWithoutControl() {
if (selectedTerme.getIdT() != null && !selectedTerme.getIdT().equals("")) {
selectedTerme.editTerme(1);
} else {
// le terme n'existe pas encore
if (!selectedTerme.editTerme(2)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("error")));
selectedTerme.setNomEdit(selectedTerme.getNom());
return;
}
}
if (selectedNode != null) {
// ((MyTreeNode) selectedNode).setData(temp + " (Id_" + selectedTerme.getIdC() + ")");
((MyTreeNode) selectedNode).setData(selectedTerme.getNom());
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", selectedTerme.getNom() + " " + langueBean.getMsg("tree.info2")));
selectedTerme.setNomEdit(selectedTerme.getNom());
}
selectedTerme.setSelectedTermComp(new NodeAutoCompletion());
}
use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.
the class SelectedCandidat method initSelectedCandidat.
@PostConstruct
public void initSelectedCandidat() {
selected = new NodeCandidatValue();
selected.setEtat("");
selected.setIdConcept("");
selected.setValue("");
selected.setNbProp(0);
infoCdt = new NodeCandidat();
infoCdt.setNodesUser(new ArrayList<>());
infoCdt.setNodeTraductions(new ArrayList<>());
selectedNvx = new NodeAutoCompletion();
tradInsert = new ArrayList<>();
setPreferences();
nomsProp = new ArrayList<>();
}
use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.
the class SelectedCandidat method reInit.
/**
* Réinitialise le candidat (tout est vide)
*/
public void reInit() {
selected = new NodeCandidatValue();
selected.setEtat("");
selected.setIdConcept("");
selected.setValue("");
selected.setNbProp(0);
infoCdt = new NodeCandidat();
infoCdt.setNodesUser(new ArrayList<>());
infoCdt.setNodeTraductions(new ArrayList<>());
selectedNvx = new NodeAutoCompletion();
note = "";
niveau = "";
domaine = "";
nomsProp = new ArrayList<>();
}
Aggregations