Search in sources :

Example 11 with GpsHelper

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

the class SelectedTerme method updateGps.

public void updateGps() {
    GpsBeans gps = new GpsBeans();
    coordonnees = new NodeGps();
    GpsHelper gpsHelper = new GpsHelper();
    coordonnees = gpsHelper.getCoordinate(connect.getPoolConnexion(), idC, idTheso);
    if (coordonnees == null) {
        latitudLongitud = null;
        gps.latitud = 0.0;
        gps.longitud = 0.0;
        return;
    }
    gps.latitud = coordonnees.getLatitude();
    gps.longitud = coordonnees.getLongitude();
    gps.reinitBoolean();
    latitudLongitud = "" + coordonnees.getLatitude() + "," + coordonnees.getLongitude();
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) NodeGps(mom.trd.opentheso.bdd.helper.nodes.NodeGps)

Example 12 with GpsHelper

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

the class GpsBeans method getPreliereElement.

/**
 * Permet de savoir le premiere element que on besoin montrer
 *
 * @param id_Concept
 * @param idTheso
 * @param id_lang
 * @param id_user
 */
public void getPreliereElement(String id_Concept, String idTheso, String id_lang, int id_user) {
    GpsHelper gpsHelper = new GpsHelper();
    nodePreference = gpsHelper.getGpsPreferences(connect.getPoolConnexion(), idTheso, id_user, alignementPreferences.getId());
    alignementPreferences = gpsHelper.find_alignement_gps(connect.getPoolConnexion(), nodePreference.getId_alignement_source());
    getPreferenceAlignement(idTheso, id_user);
    if (optionOfAlignement != -1) {
        if (optionAllBranch == optionOfAlignement) {
            ismiseAJour(idTheso, id_lang);
        }
        if (optionOfAlignement == optionNonAligned) {
            isNonAligne(id_Concept, id_theso, id_lang);
        }
        if (optionWorkFlow == optionOfAlignement) {
            // reprise de la suite
            if (alignementPreferencesAlignement.getId_concept_tratees() == null) {
                ismiseAJour(idTheso, id_lang);
            } else {
                isSuite();
            }
        }
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper)

Example 13 with GpsHelper

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

the class GpsBeans method getCoordinatesGps.

/**
 * récupère les coordonées de la BDD
 *
 * @param idConcept
 * @param idTheso
 * @return
 */
public boolean getCoordinatesGps(String idConcept, String idTheso) {
    GpsHelper gpshelper = new GpsHelper();
    NodeGps nodeGps = gpshelper.getCoordinate(connect.getPoolConnexion(), idConcept, idTheso);
    if (nodeGps != null) {
        latitud = nodeGps.getLatitude();
        longitud = nodeGps.getLongitude();
    } else {
        initcoordonees();
    }
    return true;
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) NodeGps(mom.trd.opentheso.bdd.helper.nodes.NodeGps)

Example 14 with GpsHelper

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

the class GpsBeans method creerAlignAutoParLot.

/**
 * Crée les alignements Par Lot
 *
 * @param idC
 * @param idTheso
 * @param nom
 * @param idlangue
 * @throws ParserConfigurationException
 * @throws SAXException
 */
public void creerAlignAutoParLot(String idC, String idTheso, String nom, String idlangue) throws ParserConfigurationException, SAXException {
    GpsHelper gpsHelper = new GpsHelper();
    nodePreference = gpsHelper.getGpsPreferences(connect.getPoolConnexion(), id_theso, id_user1, alignementPreferences.getId());
    if (nodePreference != null) {
        GpsQuery gpsQuery = new GpsQuery();
        alignementPreferences = gpsHelper.find_alignement_gps(connect.getPoolConnexion(), nodePreference.getId_alignement_source());
        listAlignValues = new ArrayList<>();
        if ("REST".equalsIgnoreCase(alignementPreferences.getTypeRequete())) {
            if ("xml".equals(alignementPreferences.getAlignement_format())) {
                listAlignValues = gpsQuery.queryGps2(idC, idTheso, nom.trim(), idlangue, alignementPreferences.getRequete());
            }
        }
    } else {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", "Ne peux pas recuperer le preferences"));
    // message ne peux pas recuperer le preferences
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) GpsQuery(mom.trd.opentheso.core.alignment.GpsQuery) FacesMessage(javax.faces.application.FacesMessage)

Example 15 with GpsHelper

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

the class GpsBeans method onRowSelect.

public void onRowSelect(SelectEvent event) {
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    GpsHelper gpsHelper = new GpsHelper();
    GpsPreferences gpsPreferences;
    gpsPreferences = gpsHelper.getGpsPreferences(connect.getPoolConnexion(), id_theso, id_user1, ((AlignementSource) event.getObject()).getId());
    integrerTraduction = gpsPreferences.isGps_integrertraduction();
    alignementAutomatique = gpsPreferences.isGps_alignementautomatique();
    remplacerTraduction = gpsPreferences.isGps_reemplacertraduction();
    // alignement_source = "" + gpsPreferences.getId_alignement_source();
    for (AlignementSource alignementSource : alignementSources) {
        if (((AlignementSource) event.getObject()).getId() == alignementSource.getId()) {
            alignement_source = alignementSource;
        }
    }
    selectedAlignement = alignement_source.getRequete();
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) GpsPreferences(mom.trd.opentheso.core.alignment.GpsPreferences) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) 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