Skip to content
Permalink
Browse files

RDF4J export phase 2 (progress bar)

BDD 4.2.6 phase 1
  • Loading branch information...
Quincy Quincy
Quincy authored and Quincy committed May 10, 2017
1 parent fdeee92 commit eca4473d8932be5a64124f26bd2c2633c975435b

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -330,6 +330,8 @@ public void majTerme(MyTreeNode sN) {
majGroupTGen();
majLangueGroup();
majTSpeGroup();



} else {
Concept concept = new ConceptHelper().getThisConcept(connect.getPoolConnexion(), idC, idTheso);
@@ -456,7 +458,7 @@ private void majTAsso() {

private void majLangueGroup() {
langues = new ArrayList<>();
ArrayList<NodeGroupTraductions> tempNGT = new GroupHelper().getGroupTraduction(connect.getPoolConnexion(), idDomaine, idTheso, idlangue);
ArrayList<NodeGroupTraductions> tempNGT = new GroupHelper().getGroupTraduction(connect.getPoolConnexion(), idC, idTheso, idlangue);
HashMap<String, String> tempMapL = new HashMap<>();
for (NodeGroupTraductions ngt : tempNGT) {
tempMapL.put(ngt.getIdLang(), ngt.getTitle());
@@ -467,12 +469,21 @@ private void majLangueGroup() {
private void majTSpeGroup() {
termesSpecifique = new ArrayList<>();
ConceptHelper ch = new ConceptHelper();
GroupHelper gh = new GroupHelper();
ArrayList<NodeConceptTree> tempNT = ch.getListTopConcepts(connect.getPoolConnexion(), idC, idTheso, idlangue);
for (NodeConceptTree nct : tempNT) {
HashMap<String, String> tempMap1 = new HashMap<>();
tempMap1.put(nct.getIdConcept(), nct.getTitle());
termesSpecifique.addAll(tempMap1.entrySet());
}
for(String tGroup : ch.getListGroupChildIdOfGroup(connect.getPoolConnexion(), idC, idTheso)){

String value = gh.getLexicalValueOfGroup(connect.getPoolConnexion(), tGroup, idTheso, idlangue);
HashMap<String, String> tempMap1 = new HashMap<>();
tempMap1.put(tGroup, value);
termesSpecifique.addAll(tempMap1.entrySet());
}

}

private void majGroup() {
@@ -123,6 +123,17 @@

@ManagedProperty(value = "#{treeBean}")
private TreeBean tree;

@ManagedProperty(value = "#{newtreeBean}")
private NewTreeBean newTree;

public NewTreeBean getNewTree() {
return newTree;
}

public void setNewTree(NewTreeBean newTree) {
this.newTree = newTree;
}



@@ -165,6 +176,7 @@ private ResourceBundle getBundlePrefArk() {
FacesContext context = FacesContext.getCurrentInstance();
ResourceBundle bundlePref = context.getApplication().getResourceBundle(context, "ark");
return bundlePref;

}

/**
@@ -779,6 +791,11 @@ public void maj() {
uTree.initTree(thesaurus.getId_thesaurus(), thesaurus.getLanguage());
languesTheso = new LanguageHelper().getSelectItemLanguagesOneThesaurus(connect.getPoolConnexion(), thesaurus.getId_thesaurus(), thesaurus.getLanguage());
candidat.maj(thesaurus.getId_thesaurus(), thesaurus.getLanguage());



if(newTree!=null)
newTree.initTree(thesaurus.getId_thesaurus(), thesaurus.getLanguage());
vue.setCreat(false);
}

@@ -825,6 +842,9 @@ public void update() {
languesTheso = new LanguageHelper().getSelectItemLanguagesOneThesaurus(connect.getPoolConnexion(), thesaurus.getId_thesaurus(), thesaurus.getLanguage());
candidat.maj(thesaurus.getId_thesaurus(), thesaurus.getLanguage());
vue.setCreat(false);

if(newTree!=null)
newTree.initTree(thesaurus.getId_thesaurus(), thesaurus.getLanguage());
}

/***************************************** FACETTES *****************************************/
@@ -1447,6 +1467,7 @@ public void setStatBean(StatBean statBean) {

public ArrayList<Entry<String, String>> getArrayFacette() {
if(connect.getPoolConnexion() != null) {

ArrayList<NodeFacet> temp = new FacetHelper().getAllFacetsOfThesaurus(connect.getPoolConnexion(), thesaurus.getId_thesaurus(), thesaurus.getLanguage());
Map<String, String> mapTemp = new HashMap<>();
for(NodeFacet nf : temp) {
@@ -2434,6 +2434,8 @@ public void insertID_grouptoPermuted(HikariDataSource ds, String id_thesaurus, S
idGroup.add(resultSet.getString("id_group"));
}
}



} finally {
stmt.close();
@@ -2532,6 +2534,44 @@ public void insertID_grouptoPermuted(HikariDataSource ds, String id_thesaurus, S
return idGroupParentt;
}

public ArrayList<String> getListGroupChildIdOfGroup(HikariDataSource ds,
String idGRoup, String idThesaurus) {

Connection conn;
Statement stmt;
ResultSet resultSet;
ArrayList<String> idGroupParentt = new ArrayList<>();
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select id_group2 from relation_group where id_thesaurus = '"
+ idThesaurus + "'"
+ " and id_group1 = '" + idGRoup + "'"
+ " and relation='sub'";
stmt.executeQuery(query);
resultSet = stmt.getResultSet();
if (resultSet != null) {
while (resultSet.next()) {
idGroupParentt.add(resultSet.getString("id_group2"));
}
}

} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while getting Id of group of Concept : " + idGRoup, sqle);
}
return idGroupParentt;
}


/**
* Cette fonction permet de récupérer les identifiants des Group des parents
@@ -2645,6 +2685,7 @@ public void insertID_grouptoPermuted(HikariDataSource ds, String id_thesaurus, S
}
return listIdOfTopConcept;
}


/**
* Cette fonction permet de récupérer la liste des Ids of Topconcepts pour
@@ -2723,7 +2764,7 @@ public void insertID_grouptoPermuted(HikariDataSource ds, String id_thesaurus, S
try {
String query = "select id_concept, status from concept where id_thesaurus = '"
+ idThesaurus + "'"
+ " and id_group = '" + idGroup + "'"
+ " and concept.id_concept IN (SELECT idconcept FROM concept_group_concept WHERE idgroup = '"+idGroup+ "')"
+ " and top_concept = true";
stmt.executeQuery(query);
resultSet = stmt.getResultSet();
@@ -3674,7 +3715,18 @@ public boolean haveChildren(HikariDataSource ds,
}
}
if (resultat.isEmpty()) {
path.add(getGroupIdOfConcept(ds, idConcept, idThesaurus));

String group;

do{
group = getGroupIdOfConcept(ds, idConcept, idThesaurus);
if(group == null)
group = new GroupHelper().getIdFather(ds, idConcept, idThesaurus);
path.add(group);
idConcept = group;
}while(new GroupHelper().getIdFather(ds, group, idThesaurus) != null);


ArrayList<String> pathTemp = new ArrayList<>();
for (String path2 : firstPath) {
pathTemp.add(path2);
@@ -3694,6 +3746,7 @@ public boolean haveChildren(HikariDataSource ds,
}

return tabId;

}

public ArrayList<ArrayList<String>> getPathOfConcept(HikariDataSource ds,
@@ -108,6 +108,44 @@ public void addConceptGroupConcept(HikariDataSource ds,

}

public ArrayList<String> getListGroupChildIdOfGroup(HikariDataSource ds,
String idGRoup, String idThesaurus) {

Connection conn;
Statement stmt;
ResultSet resultSet;
ArrayList<String> idGroupParentt = new ArrayList<>();
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select id_group2 from relation_group where id_thesaurus = '"
+ idThesaurus + "'"
+ " and id_group1 = '" + idGRoup + "'"
+ " and relation='sub'";
stmt.executeQuery(query);
resultSet = stmt.getResultSet();
if (resultSet != null) {
while (resultSet.next()) {
idGroupParentt.add(resultSet.getString("id_group2"));
}
}

} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while getting Id of group of Concept : " + idGRoup, sqle);
}
return idGroupParentt;
}

/**
* Fonction qui permet de supprimer un domaine de la branche donnée avec un
* concept de tête un domaine et thesaurus
@@ -868,7 +906,8 @@ public boolean addGroupTraductionHistorique(HikariDataSource ds,
stmt = conn.createStatement();
try {
String query = "SELECT * FROM concept_group_label WHERE "
+ "lang = '" + idLang + "' and "
+ "lang = '" + idLang + "' and "
+ "idthesaurus = '" + idThesaurus + "' and "
+ "idgroup IN ("
+ "SELECT id_group2 FROM relation_group WHERE "
+ "relation = 'sub' and "
@@ -905,6 +944,42 @@ public boolean addGroupTraductionHistorique(HikariDataSource ds,
return nodeConceptTrees;
}

public String getIdFather(HikariDataSource ds,
String idGRoup, String idThesaurus) {
Connection conn;
Statement stmt;
ResultSet resultSet;
String idFather = null;
try {
// Get connection from pool
conn = ds.getConnection();
try {
stmt = conn.createStatement();
try {
String query = "select id_group1 from relation_group where id_thesaurus = '"
+ idThesaurus + "'"
+ " and id_group2 = '" + idGRoup + "'"
+ " and relation='sub'";

stmt.executeQuery(query);
resultSet = stmt.getResultSet();
resultSet.next();
idFather = resultSet.getString("id_group1");

} finally {
stmt.close();
}
} finally {
conn.close();
}
} catch (SQLException sqle) {
// Log exception
log.error("Error while getChildrenOf: " + idThesaurus, sqle);
}

return idFather;
}

/**
* Permet de retourner un NodeConceptGroup par identifiant, par thésaurus et
* par langue / ou null si rien cette fonction ne retourne pas les détails
@@ -1237,7 +1312,7 @@ public boolean deleteConceptGroup(HikariDataSource ds,

public ArrayList<NodeGroup> getListRootConceptGroup(HikariDataSource ds,
String idThesaurus, String idLang) {

ArrayList<NodeGroup> nodeConceptGroupList;
ArrayList tabIdConceptGroup = getListIdOfRootGroup(ds, idThesaurus);

@@ -1252,7 +1327,6 @@ public boolean deleteConceptGroup(HikariDataSource ds,
}

return nodeConceptGroupList;


}

@@ -1440,6 +1514,7 @@ public boolean deleteConceptGroup(HikariDataSource ds,
}
return tabIdConceptGroup;
}

public ArrayList<String> getListIdOfRootGroup(HikariDataSource ds,
String idThesaurus) {

0 comments on commit eca4473

Please sign in to comment.
You can’t perform that action at this time.