Search in sources :

Example 21 with NodeAutoCompletion

use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.

the class SelectedCandidat method initNewProposal.

private void initNewProposal() {
    selectedNvx = new NodeAutoCompletion();
    noteEdit = "";
    domaineEdit = "";
    niveauEdit = "";
    valueEdit = "";
}
Also used : NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 22 with NodeAutoCompletion

use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.

the class SelectedTerme method initConceptFusion.

/**
 * initialisation pour la fusion des concepts.
 *
 * @return
 */
public boolean initConceptFusion() {
    conceptFusionId = "";
    conceptFusionNodeRT = new ArrayList<>();
    conceptFusionAlign = new ArrayList<>();
    selectedTermComp = new NodeAutoCompletion();
    return true;
}
Also used : NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 23 with NodeAutoCompletion

use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.

the class AutoCompletBean method newSpecialTSpe.

public void newSpecialTSpe() {
    createValid = false;
    terme.setValueEdit(terme.getSelectedTermComp().getTermLexicalValue());
    if (terme.getValueEdit().trim().equals("")) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("tree.error1")));
        return;
    }
    String valueEdit = terme.getValueEdit().trim();
    // vérification si c'est le même nom, on fait rien
    if (valueEdit.equalsIgnoreCase(terme.getNom())) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.impossible")));
        return;
    }
    // vérification si le term à ajouter existe déjà
    if ((terme.isTermExist(valueEdit)) != null) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error6")));
        return;
    }
    String BTtag = null;
    switch(tree.getNTtag()) {
        case "NTG":
            BTtag = "BTG";
            break;
        case "NTP":
            BTtag = "BTP";
            break;
        case "NTI":
            BTtag = "BTI";
            break;
    }
    if (!terme.creerSpecialTermeSpe(((MyTreeNode) tree.getSelectedNode()), BTtag, tree.getNTtag())) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("error")));
        return;
    } else {
        tree.reInit();
        tree.reExpand();
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", valueEdit + " " + langueBean.getMsg("tree.info1")));
    }
    terme.setSelectedTermComp(new NodeAutoCompletion());
    createValid = true;
}
Also used : FacesMessage(javax.faces.application.FacesMessage) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)

Example 24 with NodeAutoCompletion

use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.

the class AutoCompletBean method completOtherGroup.

public List<NodeAutoCompletion> completOtherGroup(String query) {
    selectedAtt = new NodeAutoCompletion();
    List<NodeAutoCompletion> liste = new ArrayList<>();
    if (theso.getThesaurus().getId_thesaurus() != null && theso.getThesaurus().getLanguage() != null) {
        liste = new GroupHelper().getAutoCompletionOtherGroup(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), terme.getIdDomaine(), theso.getThesaurus().getLanguage(), query);
    }
    return liste;
}
Also used : ArrayList(java.util.ArrayList) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

Example 25 with NodeAutoCompletion

use of mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion in project opentheso by miledrousset.

the class AutoCompletBean method completGroup.

public List<NodeAutoCompletion> completGroup(String query) {
    selectedAtt = new NodeAutoCompletion();
    List<NodeAutoCompletion> liste = new ArrayList<>();
    if (theso.getThesaurus().getId_thesaurus() != null && theso.getThesaurus().getLanguage() != null) {
        liste = new GroupHelper().getAutoCompletionGroup(connect.getPoolConnexion(), theso.getThesaurus().getId_thesaurus(), theso.getThesaurus().getLanguage(), query);
    }
    return liste;
}
Also used : ArrayList(java.util.ArrayList) NodeAutoCompletion(mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper)

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