Search in sources :

Example 31 with AlignmentHelper

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

the class GpsBeans method alignementautomatique.

/**
 * Ajoute de manière automatique un alignement
 *
 * @param idTerm
 * @return
 */
private boolean alignementautomatique(String idTerm) {
    boolean status = false;
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    if (alignmentHelper.addNewAlignment(connect.getPoolConnexion(), theUser.getUser().getId(), alignment_choisi.getName(), alignementPreferences.getSource(), alignment_choisi.getIdUrl(), 1, id_concept, id_theso, alignementPreferences.getId())) {
    }
    return status;
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper)

Example 32 with AlignmentHelper

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

the class SelectedTerme method setAlignementSources.

/*   public void setAlignementSources(ArrayList<AlignementSource> alignementSources) {
        this.alignementSources = alignementSources;
    }
     */
public void setAlignementSources() {
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    alignementSources = alignmentHelper.getAlignementSource(connect.getPoolConnexion(), idTheso);
// return alignementSources;
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper)

Example 33 with AlignmentHelper

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

the class SelectedTerme method majTerme.

/**
 * *************************************** MISE A JOUR
 * ****************************************
 */
/**
 * Met à jour le terme à la sélection d'un node de l'arbre (traitement
 * différent si Domaine/TopConcept/Concept)
 *
 * @param sN
 */
public void majTerme(MyTreeNode sN) {
    // contrôler si la connexion est toujour valide
    // connect.
    selectedNode = sN;
    reInitTerme();
    majPref();
    idC = sN.getIdConcept();
    idTheso = sN.getIdTheso();
    idlangue = sN.getLangue();
    idDomaine = sN.getIdCurrentGroup();
    idTopConcept = sN.getIdTopConcept();
    type = sN.getTypeConcept();
    status = "";
    notation = "";
    latitudLongitud = null;
    totalConceptOfBranch = "";
    totalNoticesOfBranch = "";
    majTAsso();
    GroupHelper groupHelper = new GroupHelper();
    ConceptHelper conceptHelper = new ConceptHelper();
    if (groupHelper.isIdOfGroup(connect.getPoolConnexion(), idC, idTheso)) {
        microTheso = new GroupHelper().getLexicalValueOfGroup(connect.getPoolConnexion(), idDomaine, idTheso, idlangue);
        NodeGroup ncg = new GroupHelper().getThisConceptGroup(connect.getPoolConnexion(), idC, idTheso, idlangue);
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        nom = ncg.getLexicalValue();
        idArk = ncg.getConceptGroup().getIdARk();
        nomEdit = nom;
        idT = "";
        if (ncg.getCreated() != null && ncg.getModified() != null) {
            dateC = dateFormat.format(ncg.getCreated());
            dateM = dateFormat.format(ncg.getModified());
        }
        majGroupTGen();
        majLangueGroup();
        majTSpeGroup();
        majNotes();
    } else {
        Concept concept = conceptHelper.getThisConcept(connect.getPoolConnexion(), idC, idTheso);
        if (concept == null) {
            return;
        }
        status = concept.getStatus();
        notation = concept.getNotation();
        if (!idDomaine.equals("Orphan")) {
            majGroup();
            majTGen();
        } else {
            microTheso = idDomaine;
        }
        Term t = new TermHelper().getThisTerm(connect.getPoolConnexion(), idC, idTheso, idlangue);
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        nom = t.getLexical_value();
        nomEdit = nom;
        idT = t.getId_term();
        dateC = dateFormat.format(t.getCreated());
        dateM = dateFormat.format(t.getModified());
        creator = t.getCreator();
        contributor = t.getContributor();
        images = new ImagesHelper().getImage(connect.getPoolConnexion(), idC, idTheso, user.getUser().getId());
        majNotes();
        majLangueConcept();
        majSyno();
        updateGps();
        majTSpeConcept();
        align = new AlignmentHelper().getAllAlignmentOfConcept(connect.getPoolConnexion(), idC, idTheso);
        // ResourceBundle bundlePref = getBundlePref();
        if (user.getNodePreference().isZ3950actif()) {
            majNoticeZ3950();
        }
        if (user.getNodePreference().isBddActive()) {
            majNoticeBdd();
        }
        idArk = conceptHelper.getIdArkOfConcept(connect.getPoolConnexion(), idC, idTheso);
        idHandle = conceptHelper.getIdHandleOfConcept(connect.getPoolConnexion(), idC, idTheso);
        reInitFacette();
        initTree();
    }
}
Also used : Concept(mom.trd.opentheso.bdd.datas.Concept) ImagesHelper(mom.trd.opentheso.bdd.helper.ImagesHelper) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) Term(mom.trd.opentheso.bdd.datas.Term) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) SimpleDateFormat(java.text.SimpleDateFormat) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Example 34 with AlignmentHelper

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

the class SelectedTerme method creerAlign.

public void creerAlign() {
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    if (valueEdit == null || valueEdit2 == null || linkEdit == null || /*valueEdit.equals("") || valueEdit2.equals("") ||*/
    linkEdit.equals("")) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error5")));
    } else {
        alignmentHelper.addNewAlignment(connect.getPoolConnexion(), user.getUser().getId(), valueEdit2.trim(), valueEdit.trim(), linkEdit.trim(), Integer.parseInt(statutEdit), idC, idTheso, 0);
        valueEdit = "";
        valueEdit2 = "";
        linkEdit = "";
        statutEdit = "";
        align = alignmentHelper.getAllAlignmentOfConcept(connect.getPoolConnexion(), idC, idTheso);
        vue.setAddAlign(0);
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info9")));
    }
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) FacesMessage(javax.faces.application.FacesMessage)

Example 35 with AlignmentHelper

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

the class SelectedTerme method addOtherThesoAlign.

public void addOtherThesoAlign(NodeAutoCompletion term, String idOtherTheso, int alignType) {
    if (term == null) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error :", "No term selected"));
        return;
    }
    String termUri = "test/" + term.getIdConcept();
    new AlignmentHelper().addNewAlignment(connect.getPoolConnexion(), user.getUser().getId(), term.getIdConcept(), idOtherTheso, termUri, alignType, idC, idTheso, -1);
    align = new AlignmentHelper().getAllAlignmentOfConcept(connect.getPoolConnexion(), idC, idTheso);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("sTerme.info11")));
    vue.setAddAlign(0);
}
Also used : AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) PrefixString(com.k_int.IR.QueryModels.PrefixString) FacesMessage(javax.faces.application.FacesMessage)

Aggregations

AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)42 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)16 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)11 Concept (mom.trd.opentheso.bdd.datas.Concept)10 Term (mom.trd.opentheso.bdd.datas.Term)10 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)10 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)9 NodeTerm (mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm)9 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)8 ArrayList (java.util.ArrayList)7 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)7 FacesMessage (javax.faces.application.FacesMessage)6 AlignementSource (mom.trd.opentheso.core.alignment.AlignementSource)6 SQLException (java.sql.SQLException)5 SKOSMapping (skos.SKOSMapping)5 SKOSTopConcept (skos.SKOSTopConcept)5 PrefixString (com.k_int.IR.QueryModels.PrefixString)4 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)4 GpsHelper (mom.trd.opentheso.bdd.helper.GpsHelper)4 NodeTermTraduction (mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction)4