Search in sources :

Example 16 with NodeAutoCompletion

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;
    }
}
Also used : NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 17 with NodeAutoCompletion

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();
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) BufferedReader(java.io.BufferedReader) IOException(java.io.IOException) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion) IOException(java.io.IOException)

Example 18 with NodeAutoCompletion

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());
}
Also used : MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode) FacesMessage(javax.faces.application.FacesMessage) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 19 with 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<>();
}
Also used : NodeCandidatValue(mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidatValue) NodeCandidat(mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidat) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion) PostConstruct(javax.annotation.PostConstruct)

Example 20 with NodeAutoCompletion

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<>();
}
Also used : NodeCandidatValue(mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidatValue) NodeCandidat(mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidat) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Aggregations

NodeAutoCompletion (mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)41 FacesMessage (javax.faces.application.FacesMessage)17 ArrayList (java.util.ArrayList)16 Connection (java.sql.Connection)11 SQLException (java.sql.SQLException)11 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)8 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)7 ResultSet (java.sql.ResultSet)6 Statement (java.sql.Statement)6 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)6 StringPlus (mom.trd.opentheso.bdd.tools.StringPlus)6 PreparedStatement (java.sql.PreparedStatement)2 Term (mom.trd.opentheso.bdd.datas.Term)2 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)2 NodeCandidat (mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidat)2 NodeCandidatValue (mom.trd.opentheso.bdd.helper.nodes.candidat.NodeCandidatValue)2 BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1