use of mom.trd.opentheso.core.exports.helper.ExportPrivatesDatas in project opentheso by miledrousset.
the class TestExportPrivatesDatas method testWriteUsersIntoXML1.
@Test
public void testWriteUsersIntoXML1() {
HikariDataSource conn = openConnexionPool();
ExportPrivatesDatas exportPrivatesDatas = new ExportPrivatesDatas();
ArrayList<Table> usersList = exportPrivatesDatas.getDatasOfTable(conn, "alignement_type");
// ArrayList <Proposition> listPropo = exportPrivatesDatas.getProposition(conn);
// ArrayList <Concept_Candidat> listConceptC = exportPrivatesDatas.getconceptCandidat(conn);
// ArrayList <Term_Candidat> listTermC = exportPrivatesDatas.getTermeCandidat(conn);
// ArrayList <Concept_orphan> list_userRol = exportPrivatesDatas.getConceptOrphelin(conn);
// ArrayList <Concept_Fusion> list_userRol = exportPrivatesDatas.getconceptFusion(conn);
// ArrayList <Images> list_userRol = exportPrivatesDatas.getImages(conn);
// ArrayList <Preferences> list_userRol = exportPrivatesDatas.getPreferences(conn);
// ArrayList <Concept_Group_Historique> list_userRol = exportPrivatesDatas.getConceptGroupHist(conn);
// ArrayList <Concept_Group_Label_Historique> list_userRol = exportPrivatesDatas.getconceptGroupLabelH(conn);
// ArrayList <Concept_Historique> list_userRol = exportPrivatesDatas.getConceptHistorique(conn);
// ArrayList <Hierarchical_Relationship_Historique> list_userRol = exportPrivatesDatas.getHierarchicalRelationshipH(conn);
// ArrayList <Non_Preferred_Term> list_userRol = exportPrivatesDatas.getNonPreferredTerm(conn);
// ArrayList <Note_Historique> list_userRol = exportPrivatesDatas.getNoteHistorique(conn);
// ArrayList <Term_Historique> list_userRol = exportPrivatesDatas.getTermHistorique(conn);
conn.close();
writeHead();
startTable("users");
for (Table user : usersList) {
startLine();
for (LineOfData lineOfData : user.getLineOfDatas()) {
writeLine(lineOfData.getColomne(), lineOfData.getValue());
}
endLine();
}
endTable("users");
System.out.println(xml);
}
use of mom.trd.opentheso.core.exports.helper.ExportPrivatesDatas in project opentheso by miledrousset.
the class BaseDeDonnesBean method backUpBaseDonnees.
/**
* Cette fonction permet de télécharger les tables et les données ce qui
* permet de sauvegarder toutes les données privées pour les mise à jour
*
* @param toutTables
* @return
*/
public StreamedContent backUpBaseDonnees(ArrayList<String> toutTables) {
ArrayList<Table> sortirXml;
ExportPrivatesDatas backUp = new ExportPrivatesDatas();
Iterator<String> it1 = toutTables.iterator();
WriteXml write = new WriteXml();
write.writeHead();
write.start();
String table = "";
// date du jour
java.util.Date datetoday = new java.util.Date();
while (it1.hasNext()) {
table = it1.next();
sortirXml = backUp.getDatasOfTable(connect.getPoolConnexion(), table);
write.WriteIntoXML(sortirXml, table);
}
write.end();
InputStream stream;
try {
stream = new ByteArrayInputStream(write.getXml().toString().getBytes("UTF-8"));
file = new DefaultStreamedContent(stream, "application/xml", "backupOpentheso_" + datetoday + ".xml");
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
}
return file;
}
use of mom.trd.opentheso.core.exports.helper.ExportPrivatesDatas in project opentheso by miledrousset.
the class SelectedThesaurus method getAllTables.
public void getAllTables() {
ExportPrivatesDatas exportData = new ExportPrivatesDatas();
tablesList = exportData.showAllTables(connect.getPoolConnexion());
tablesListPrivate = exportData.showPrivateTables(connect.getPoolConnexion());
}
use of mom.trd.opentheso.core.exports.helper.ExportPrivatesDatas in project opentheso by miledrousset.
the class TestExportPrivatesDatas method testGetUsers.
// TODO add test methods here.
// The methods must be annotated with annotation @Test. For example:
//
@Test
public void testGetUsers() {
HikariDataSource conn = openConnexionPool();
ExportPrivatesDatas exportPrivatesDatas = new ExportPrivatesDatas();
// ArrayList <Users> list_userRol = exportPrivatesDatas.getUSers(conn);
// ArrayList <Role> list_userRol = exportPrivatesDatas.getRoles(conn);
// ArrayList <User_Role> list_userRol = exportPrivatesDatas.getUser_Roles(conn);
// ArrayList <Concept_Term_Candidat> list_userRol = exportPrivatesDatas.getConceptTermCandidat(conn);
// ArrayList <Proposition> list_userRol = exportPrivatesDatas.getProposition(conn);
// ArrayList <Concept_Candidat> list_userRol = exportPrivatesDatas.getconceptCandidat(conn);
// ArrayList <Term_Candidat> list_userRol = exportPrivatesDatas.getTermeCandidat(conn);
// ArrayList <Concept_orphan> list_userRol = exportPrivatesDatas.getConceptOrphelin(conn);
// ArrayList <Concept_Fusion> list_userRol = exportPrivatesDatas.getconceptFusion(conn);
// ArrayList <Images> list_userRol = exportPrivatesDatas.getImages(conn);
// ArrayList <Preferences> list_userRol = exportPrivatesDatas.getPreferences(conn);
// ArrayList <Concept_Group_Historique> list_userRol = exportPrivatesDatas.getConceptGroupHist(conn);
// ArrayList <Concept_Group_Label_Historique> list_userRol = exportPrivatesDatas.getconceptGroupLabelH(conn);
// ArrayList <Concept_Historique> list_userRol = exportPrivatesDatas.getConceptHistorique(conn);
// ArrayList <Hierarchical_Relationship_Historique> list_userRol = exportPrivatesDatas.getHierarchicalRelationshipH(conn);
// ArrayList <Non_Preferred_Term> list_userRol = exportPrivatesDatas.getNonPreferredTerm(conn);
// ArrayList <Note_Historique> list_userRol = exportPrivatesDatas.getNoteHistorique(conn);
// ArrayList <Term_Historique> list_userRol = exportPrivatesDatas.getTermHistorique(conn);
conn.close();
}
Aggregations