Search in sources :

Example 1 with GpsQuery

use of mom.trd.opentheso.core.alignment.GpsQuery in project opentheso by miledrousset.

the class GpsBeans method creerAlignAuto.

public void creerAlignAuto(String idC, String idTheso, String nom, String idlangue) throws ParserConfigurationException, SAXException {
    GpsQuery gpsQuery = new GpsQuery();
    GpsHelper gpsHelper = new GpsHelper();
    if (selectedAlignement != null) {
        for (AlignementSource alignementSource : alignementSources) {
            if (alignementSource.getRequete() == null ? selectedAlignement == null : alignementSource.getRequete().equals(selectedAlignement)) {
                alignementPreferences = alignementSource;
            }
        }
        listAlignValues = new ArrayList<>();
        if ("REST".equalsIgnoreCase(alignementPreferences.getTypeRequete())) {
            if ("xml".equals(alignementPreferences.getAlignement_format())) {
                listAlignValues = gpsQuery.queryGps2(idC, idTheso, nom.trim(), idlangue, alignementPreferences.getRequete());
            }
        }
    }
}
Also used : GpsHelper(mom.trd.opentheso.bdd.helper.GpsHelper) GpsQuery(mom.trd.opentheso.core.alignment.GpsQuery) AlignementSource(mom.trd.opentheso.core.alignment.AlignementSource)

Example 2 with GpsQuery

use of mom.trd.opentheso.core.alignment.GpsQuery 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)

Aggregations

GpsHelper (mom.trd.opentheso.bdd.helper.GpsHelper)2 GpsQuery (mom.trd.opentheso.core.alignment.GpsQuery)2 FacesMessage (javax.faces.application.FacesMessage)1 AlignementSource (mom.trd.opentheso.core.alignment.AlignementSource)1