Search in sources :

Example 1 with GpsHelper

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

the class GpsBeans method prevPosition.

public void prevPosition() {
    if (position <= 0) {
        return;
    }
    erreur = "";
    GpsHelper gpsHelper = new GpsHelper();
    ConceptHelper conceptHelper = new ConceptHelper();
    if (optionAllBranch == optionOfAlignement || optionOfAlignement == optionWorkFlow) {
        position--;
        id_concept = listOfChildrenInConcept.get(position);
        comprobationFin();
        if (fin) {
            return;
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    if (optionNonAligned == optionOfAlignement) {
        position--;
        id_concept = listOfChildrenInConcept.get(position);
        comprobationFin();
        while (gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_concept, id_theso)) {
            position++;
            id_concept = listOfChildrenInConcept.get(position);
            comprobationFin();
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    try {
        creerAlignAutoParLot(id_concept, id_theso, nomduterm, id_langue);
    } catch (ParserConfigurationException ex) {
        Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SAXException ex) {
        Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
    }
    listConceptTraites.remove(id_concept);
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException)

Example 2 with GpsHelper

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

the class GpsBeans method nextPosition.

public void nextPosition() {
    if (fin) {
        return;
    }
    listConceptTraites.add(id_concept);
    erreur = "";
    GpsHelper gpsHelper = new GpsHelper();
    ConceptHelper conceptHelper = new ConceptHelper();
    if (optionAllBranch == optionOfAlignement || optionOfAlignement == optionWorkFlow) {
        position++;
        if (position < listOfChildrenInConcept.size()) {
            id_concept = listOfChildrenInConcept.get(position);
        }
        comprobationFin();
        if (fin) {
            return;
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    if (optionNonAligned == optionOfAlignement) {
        position++;
        if (position < listOfChildrenInConcept.size()) {
            id_concept = listOfChildrenInConcept.get(position);
        }
        comprobationFin();
        while (gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_concept, id_theso)) {
            position++;
            if (position < listOfChildrenInConcept.size()) {
                id_concept = listOfChildrenInConcept.get(position);
            }
            comprobationFin();
            if (fin)
                return;
        }
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    }
    try {
        creerAlignAutoParLot(id_concept, id_theso, nomduterm, id_langue);
    } catch (ParserConfigurationException ex) {
        Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SAXException ex) {
        Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException)

Example 3 with GpsHelper

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

the class GpsBeans method addCoordinates.

/*
    public void onGeocode(GeocodeEvent event) {
        boolean premiere = true;
        List<GeocodeResult> results = event.getResults();
        geoModel = new DefaultMapModel();
        if (results != null && !results.isEmpty()) {
            LatLng center = results.get(0).getLatLng();
            centerGeoMap = center.getLat() + "," + center.getLng();

            for (int i = 0; i < results.size(); i++) {
                GeocodeResult result = results.get(i);
                geoModel.addOverlay(new Marker(result.getLatLng(), result.getAddress()));
                if (premiere) {
                    latitud = result.getLatLng().getLat();
                    longitud = result.getLatLng().getLng();
                    premiere = false;
                }
            }
        }
    }
     */
/**
 * Ajoute le coordonées a la BDD
 *
 * @param idConcept
 * @param idTheso
 * @return
 */
public boolean addCoordinates(String idConcept, String idTheso) {
    GpsHelper gpshelper = new GpsHelper();
    gpshelper.insertCoordonees(connect.getPoolConnexion(), idConcept, idTheso, latitud, longitud);
    return true;
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper)

Example 4 with GpsHelper

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

the class GpsBeans method isNonAligne.

public void isNonAligne(String id_Concept, String id_theso, String id_lang) {
    ConceptHelper conceptHelper = new ConceptHelper();
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    GpsHelper gpsHelper = new GpsHelper();
    if (!gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_Concept, id_theso)) {
        // si n'est pas aligne
        id_concept = listOfChildrenInConcept.get(0);
        nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), listOfChildrenInConcept.get(0), selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
        try {
            creerAlignAutoParLot(listOfChildrenInConcept.get(0), id_theso, nomduterm, id_lang);
        } catch (Exception e) {
        }
    } else {
        // si il est déjà aligne
        nextPosition();
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException)

Example 5 with GpsHelper

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

the class GpsBeans method recuperatePreferences.

public void recuperatePreferences() {
    if (!selectedAlignement.isEmpty()) {
        GpsHelper gpsHelper = new GpsHelper();
        GpsPreferences gpsPreferences;
        for (AlignementSource alignementSource : alignementSources) {
            if (alignementSource.getSource().equals(selectedAlignement)) {
                alignement_source = alignementSource;
            }
        }
        gpsPreferences = gpsHelper.getGpsPreferences(connect.getPoolConnexion(), id_theso, id_user1, alignement_source.getId());
        integrerTraduction = gpsPreferences.isGps_integrertraduction();
        alignementAutomatique = gpsPreferences.isGps_alignementautomatique();
        remplacerTraduction = gpsPreferences.isGps_reemplacertraduction();
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) GpsPreferences(mom.trd.opentheso.core.alignment.GpsPreferences) AlignementSource(mom.trd.opentheso.core.alignment.AlignementSource)

Aggregations

GpsHelper (mom.trd.opentheso.bdd.helper.GpsHelper)15 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)5 AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)4 AlignementSource (mom.trd.opentheso.core.alignment.AlignementSource)4 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3 NodeGps (mom.trd.opentheso.bdd.helper.nodes.NodeGps)3 SAXException (org.xml.sax.SAXException)3 SQLException (java.sql.SQLException)2 FacesMessage (javax.faces.application.FacesMessage)2 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)2 GpsPreferences (mom.trd.opentheso.core.alignment.GpsPreferences)2 GpsQuery (mom.trd.opentheso.core.alignment.GpsQuery)2 Connection (java.sql.Connection)1 ArrayList (java.util.ArrayList)1 Concept (mom.trd.opentheso.bdd.datas.Concept)1 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)1 Term (mom.trd.opentheso.bdd.datas.Term)1 ImagesHelper (mom.trd.opentheso.bdd.helper.ImagesHelper)1 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)1 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)1