use of mom.trd.opentheso.core.alignment.GpsPreferences 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();
}
}
use of mom.trd.opentheso.core.alignment.GpsPreferences 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();
}
use of mom.trd.opentheso.core.alignment.GpsPreferences in project opentheso by miledrousset.
the class GpsHelper method getGpsPreferences.
public GpsPreferences getGpsPreferences(HikariDataSource ds, String id_theso, int iduser, int id_source) {
GpsPreferences gpsPreferences = new GpsPreferences();
Connection conn;
Statement stmt;
ResultSet resultSet;
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select * from gps_preferences" + " where id_thesaurus = '" + id_theso + "' and id_user =" + iduser + " and id_alignement_source =" + id_source;
resultSet = stmt.executeQuery(query);
if (resultSet.next()) {
gpsPreferences.setGps_alignementautomatique(resultSet.getBoolean("gps_alignementautomatique"));
gpsPreferences.setGps_integrertraduction(resultSet.getBoolean("gps_integrertraduction"));
gpsPreferences.setGps_reemplacertraduction(resultSet.getBoolean("gps_reemplacertraduction"));
gpsPreferences.setId_user(resultSet.getInt("id_user"));
gpsPreferences.setId_alignement_source(resultSet.getInt("id_alignement_source"));
}
} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while Add coordonnes : ", sqle);
}
return gpsPreferences;
}
Aggregations