use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class DownloadBean method thesoToSkosAdvanced.
/**
* Cette fonction permet d'exporter un thésaurus en SKOS en précisant les
* langues et les domaines à exporter
*
* @param idTheso
* @param selectedLanguages
* @param selectedGroups
* @return
*/
public StreamedContent thesoToSkosAdvanced(String idTheso, List<NodeLang> selectedLanguages, List<NodeGroup> selectedGroups) {
progress_per_100 = 0;
progress_abs = 0;
ConceptHelper conceptHelper = new ConceptHelper();
sizeOfTheso = conceptHelper.getAllIdConceptOfThesaurus(connect.getPoolConnexion(), idTheso).size();
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerAdress(serverAdress);
exportFromBDD.setServerArk(serverArk);
exportFromBDD.setArkActive(arkActive);
StringBuffer skos_local = exportFromBDD.exportThesaurusAdvanced(connect.getPoolConnexion(), idTheso, selectedLanguages, selectedGroups, this);
InputStream stream;
try {
stream = new ByteArrayInputStream(skos_local.toString().getBytes("UTF-8"));
file = new DefaultStreamedContent(stream, "application/xml", idTheso + "_skos.rdf");
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(DownloadBean.class.getName()).log(Level.SEVERE, null, ex);
}
progress_per_100 = 0;
progress_abs = 0;
return file;
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class GpsBeans method prevPosition.
public void prevPosition() {
if (position <= 0) {
return;
}
erreur = "";
GpsHelper gpsHelper = new GpsHelper();
ConceptHelper conceptHelper = new ConceptHelper();
if (optionAllBranch == optionOfAlignement || optionOfAlignement == optionWorkFlow) {
position--;
id_concept = listOfChildrenInConcept.get(position);
comprobationFin();
if (fin) {
return;
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
if (optionNonAligned == optionOfAlignement) {
position--;
id_concept = listOfChildrenInConcept.get(position);
comprobationFin();
while (gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_concept, id_theso)) {
position++;
id_concept = listOfChildrenInConcept.get(position);
comprobationFin();
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
try {
creerAlignAutoParLot(id_concept, id_theso, nomduterm, id_langue);
} catch (ParserConfigurationException ex) {
Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
} catch (SAXException ex) {
Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
}
listConceptTraites.remove(id_concept);
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class GpsBeans method nextPosition.
public void nextPosition() {
if (fin) {
return;
}
listConceptTraites.add(id_concept);
erreur = "";
GpsHelper gpsHelper = new GpsHelper();
ConceptHelper conceptHelper = new ConceptHelper();
if (optionAllBranch == optionOfAlignement || optionOfAlignement == optionWorkFlow) {
position++;
if (position < listOfChildrenInConcept.size()) {
id_concept = listOfChildrenInConcept.get(position);
}
comprobationFin();
if (fin) {
return;
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
if (optionNonAligned == optionOfAlignement) {
position++;
if (position < listOfChildrenInConcept.size()) {
id_concept = listOfChildrenInConcept.get(position);
}
comprobationFin();
while (gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_concept, id_theso)) {
position++;
if (position < listOfChildrenInConcept.size()) {
id_concept = listOfChildrenInConcept.get(position);
}
comprobationFin();
if (fin)
return;
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
try {
creerAlignAutoParLot(id_concept, id_theso, nomduterm, id_langue);
} catch (ParserConfigurationException ex) {
Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
} catch (SAXException ex) {
Logger.getLogger(GpsBeans.class.getName()).log(Level.SEVERE, null, ex);
}
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class GpsBeans method isSuite.
public void isSuite() {
String[] dejaTratees;
boolean trouve = false;
boolean sort = false;
ConceptHelper conceptHelper = new ConceptHelper();
dejaTratees = (alignementPreferencesAlignement.getId_concept_tratees()).split("#");
ArrayList<String> conceptFait = new ArrayList<>();
conceptFait.addAll(Arrays.asList(dejaTratees));
listConceptTraites = conceptFait;
if (!conceptFait.isEmpty()) {
for (String traite : conceptFait) {
if (listOfChildrenInConcept.contains(traite)) {
listOfChildrenInConcept.remove(traite);
}
}
}
if (listOfChildrenInConcept.isEmpty()) {
last = true;
fin = true;
message = "toute la branche est traitée";
return;
}
comprobationFin();
id_concept = listOfChildrenInConcept.get(0);
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), listOfChildrenInConcept.get(0), selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
selectedTerme.creerAlignAuto(listOfChildrenInConcept.get(0), nomduterm);
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class GpsBeans method isNonAligne.
public void isNonAligne(String id_Concept, String id_theso, String id_lang) {
ConceptHelper conceptHelper = new ConceptHelper();
AlignmentHelper alignmentHelper = new AlignmentHelper();
GpsHelper gpsHelper = new GpsHelper();
if (!gpsHelper.isHaveCoordinate(connect.getPoolConnexion(), id_Concept, id_theso)) {
// si n'est pas aligne
id_concept = listOfChildrenInConcept.get(0);
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), listOfChildrenInConcept.get(0), selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
try {
creerAlignAutoParLot(listOfChildrenInConcept.get(0), id_theso, nomduterm, id_lang);
} catch (Exception e) {
}
} else {
// si il est déjà aligne
nextPosition();
}
}
Aggregations