use of mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport in project opentheso by miledrousset.
the class ExportFromBDD method exportConceptByLot.
/**
* Fonction permettant d'exporter un lot de concepts d'un tableau
* ceci permet de construire un export ascendant
*
* @param ds
* @param idThesaurus
* @param idConcepts
* @return Le Skos en String
*/
public StringBuffer exportConceptByLot(HikariDataSource ds, String idThesaurus, ArrayList<ArrayList<String>> idConcepts) {
if (idConcepts == null)
return null;
if (idConcepts.isEmpty())
return null;
WriteFileSKOS writeFileSKOS = new WriteFileSKOS();
// inititialisation des URI
writeFileSKOS.setServerArk(serverArk);
writeFileSKOS.setServerAdress(serverAdress);
writeFileSKOS.setNodePreference(nodePreference);
writeFileSKOS.writeHeader();
ConceptHelper conceptHelper = new ConceptHelper();
for (ArrayList<String> tabIdConcept : idConcepts) {
for (String idConcept : tabIdConcept) {
NodeConceptExport nodeConcept = conceptHelper.getConceptForExport(ds, idConcept, idThesaurus, isArkActive);
if (nodeConcept == null)
return null;
writeFileSKOS.writeDescriptor(nodeConcept, null);
}
}
writeFileSKOS.endSkos();
return writeFileSKOS.getSkosBuff();
}
use of mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport in project opentheso by miledrousset.
the class ExportFromBDD method exportAllConcepts.
/**
* Fonction permet d'exporter une branche complète d'un thésaurus
* en partant de n'importe quel identifiant ARK
* @param ds
* @param idConcept
* @param idThesaurus
* @param writeFileSKOS
* @param idArk
* @return
*/
/* public StringBuffer exportBranchOfConceptArk(HikariDataSource ds, String idThesaurus, String idArk) {
WriteFileSKOS writeFileSKOS = new WriteFileSKOS();
// inititialisation des URI
writeFileSKOS.setServerArk(serverArk);
writeFileSKOS.setServerAdress(serverAdress);
writeFileSKOS.writeHeader();
NodeUri nodeUri = new NodeUri();
nodeUri.setIdConcept(idArk);
exportAllConcepts(ds, nodeUri.getIdConcept(), idThesaurus, writeFileSKOS);
writeFileSKOS.endSkos();
return writeFileSKOS.getSkosBuff();
}
*/
/**
* @param ds
* @param idConcept
* @param idThesaurus
* @param writeFileSKOS
*/
private void exportAllConcepts(HikariDataSource ds, String idConcept, String idThesaurus, WriteFileSKOS writeFileSKOS) {
ConceptHelper conceptHelper = new ConceptHelper();
ArrayList<String> listIdsOfConceptChildren = conceptHelper.getListChildrenOfConcept(ds, idConcept, idThesaurus);
NodeConceptExport nodeConcept = conceptHelper.getConceptForExport(ds, idConcept, idThesaurus, isArkActive);
if (nodeConcept.getConcept() == null) {
int k = 0;
return;
}
writeFileSKOS.writeDescriptor(nodeConcept, null);
for (String listIdsOfConceptChildren1 : listIdsOfConceptChildren) {
nodeConcept = conceptHelper.getConceptForExport(ds, listIdsOfConceptChildren1, idThesaurus, isArkActive);
if (nodeConcept != null) {
writeFileSKOS.writeDescriptor(nodeConcept, null);
if (!nodeConcept.getNodeListOfNT().isEmpty()) {
for (int j = 0; j < nodeConcept.getNodeListOfNT().size(); j++) {
exportAllConcepts(ds, nodeConcept.getNodeListOfNT().get(j).getUri().getIdConcept(), idThesaurus, writeFileSKOS);
}
}
}
}
}
use of mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport in project opentheso by miledrousset.
the class ExportFromBDD_Frantiq method exportConcept.
/**
* Fonction permettant d'exporter Un concept
*
* @param ds
* @param idThesaurus
* @param idConcept
* @return Le Skos en String
*/
public StringBuffer exportConcept(HikariDataSource ds, String idThesaurus, String idConcept) {
WriteFileSKOS writeFileSKOS = new WriteFileSKOS();
// inititialisation des URI
writeFileSKOS.setServerArk(serverArk);
writeFileSKOS.setServerAdress(serverAdress);
writeFileSKOS.writeHeader();
ConceptHelper conceptHelper = new ConceptHelper();
NodeConceptExport nodeConcept = conceptHelper.getConceptForExport(ds, idConcept, idThesaurus, isArkActive);
writeFileSKOS.writeDescriptor(nodeConcept, null);
writeFileSKOS.endSkos();
return writeFileSKOS.getSkosBuff();
}
use of mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport in project opentheso by miledrousset.
the class ExportFromBDD_Frantiq method exportMultiConcept.
/**
* Fonction permettant d'exporter un concept ou plusieurs concepts
*
* @param ds
* @param idThesaurus
* @param value
* @param lang
* @return Le Skos en String
*/
public StringBuffer exportMultiConcept(HikariDataSource ds, String idThesaurus, String value, String lang) {
WriteFileSKOS writeFileSKOS = new WriteFileSKOS();
writeFileSKOS.writeHeader();
// inititialisation des URI
writeFileSKOS.setServerArk(serverArk);
writeFileSKOS.setServerAdress(serverAdress);
ConceptHelper conceptHelper = new ConceptHelper();
ArrayList<NodeConceptExport> listNodeConcept = conceptHelper.getMultiConceptForExport(ds, value, idThesaurus, lang, isArkActive);
for (NodeConceptExport nodeConcept : listNodeConcept) {
writeFileSKOS.writeDescriptor(nodeConcept, null);
}
writeFileSKOS.endSkos();
return writeFileSKOS.getSkosBuff();
}
use of mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport in project opentheso by miledrousset.
the class ExportFromBDD_Frantiq method exportAllConcepts.
public void exportAllConcepts(HikariDataSource ds, String idConcept, String idThesaurus, WriteFileSKOS_Frantiq writeFileSKOS) {
ConceptHelper conceptHelper = new ConceptHelper();
ArrayList<String> listIdsOfConceptChildren = conceptHelper.getListChildrenOfConcept(ds, idConcept, idThesaurus);
NodeConceptExport nodeConcept = conceptHelper.getConceptForExport(ds, idConcept, idThesaurus, isArkActive);
if (nodeConcept.getConcept() == null) {
int k = 0;
return;
}
writeFileSKOS.writeDescriptor(nodeConcept);
for (String listIdsOfConceptChildren1 : listIdsOfConceptChildren) {
nodeConcept = conceptHelper.getConceptForExport(ds, listIdsOfConceptChildren1, idThesaurus, isArkActive);
writeFileSKOS.writeDescriptor(nodeConcept);
if (!nodeConcept.getNodeListOfNT().isEmpty()) {
for (int j = 0; j < nodeConcept.getNodeListOfNT().size(); j++) {
exportAllConcepts(ds, nodeConcept.getNodeListOfNT().get(j).getUri().getIdConcept(), idThesaurus, writeFileSKOS);
}
}
}
}
Aggregations