use of mom.trd.opentheso.bdd.helper.PreferencesHelper in project opentheso by miledrousset.
the class Rest method getJsonDatas.
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// //////// Fonctions Privées //////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
/**
* Temporaire à refaire (Miled)
*/
/**
* @param idConcept
* @param idTheso
* @return
*/
private String getJsonDatas(String value, String idLang, String idTheso) {
ArrayList<String> listId = getListId(value, idLang, idTheso);
NodePreference nodePreference1 = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
if (nodePreference != null) {
ExportRdf4jHelper exportRdf4jHelper = new ExportRdf4jHelper();
exportRdf4jHelper.setNodePreference(nodePreference1);
exportRdf4jHelper.setInfos(ds, "dd-mm-yyyy", false, idTheso, nodePreference1.getCheminSite());
exportRdf4jHelper.setNodePreference(nodePreference1);
for (String idConcept : listId) {
exportRdf4jHelper.addSignleConcept(idTheso, idConcept);
}
WriteRdf4j writeRdf4j = new WriteRdf4j(exportRdf4jHelper.getSkosXmlDocument());
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, RDFFormat.RDFJSON);
// System.out.println(out.toString());
return out.toString();
}
return messageEmptyJson();
}
use of mom.trd.opentheso.bdd.helper.PreferencesHelper in project opentheso by miledrousset.
the class Rest method groupToSkos.
/**
* Fonction qui permet de récupérer un concept skos par identifiant
*
* @param idGroup
* @param idThesaurus
* @return skos
*/
private StringBuffer groupToSkos(String idGroup, String idTheso) {
if (ds == null) {
return null;
}
nodePreference = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
if (nodePreference == null) {
return null;
}
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerArk(nodePreference.getServeurArk());
exportFromBDD.setServerAdress(nodePreference.getCheminSite());
StringBuffer skos = exportFromBDD.exportThisGroup(ds, idTheso, idGroup);
return skos;
}
use of mom.trd.opentheso.bdd.helper.PreferencesHelper in project opentheso by miledrousset.
the class Rest method brancheOfConceptsToSkos.
/**
* Fonction qui permet de récupérer une branche complète en partant d'un
* concept vers le bas
*
* @param idGroup
* @param idThesaurus
* @return skos
*/
private StringBuffer brancheOfConceptsToSkos(String idConcept, String idTheso) {
if (ds == null) {
return null;
}
nodePreference = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
if (nodePreference == null) {
return null;
}
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerArk(nodePreference.getServeurArk());
exportFromBDD.setServerAdress(nodePreference.getCheminSite());
exportFromBDD.setNodePreference(nodePreference);
StringBuffer skos = exportFromBDD.exportBranchOfConcept(ds, idTheso, idConcept);
return skos;
}
use of mom.trd.opentheso.bdd.helper.PreferencesHelper in project opentheso by miledrousset.
the class Rest method groupsOfThesaurusToSkos.
/**
* Fonction qui permet de récupérer les groupes d'un thésauurs
*
* @param idThesaurus
* @return skos
*/
private StringBuffer groupsOfThesaurusToSkos(String idTheso) {
if (ds == null) {
return null;
}
nodePreference = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
if (nodePreference == null) {
return null;
}
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerArk(nodePreference.getServeurArk());
exportFromBDD.setServerAdress(nodePreference.getCheminSite());
StringBuffer skos = exportFromBDD.exportGroupsOfThesaurus(ds, idTheso);
return skos;
}
use of mom.trd.opentheso.bdd.helper.PreferencesHelper in project opentheso by miledrousset.
the class Rest method ConceptByValueToSkos.
/**
* cette fonction permet de retourner tous les concetps qui contiennenet la
* valeur recherchée en filtrant par domaine ou groupe
*
* @param value
* @param lang
* @param idGroup
* @param idThesaurus
* @return
*/
private StringBuffer ConceptByValueToSkos(String value, String lang, String idGroup, String idTheso) {
if (ds == null) {
return null;
}
nodePreference = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
if (nodePreference == null) {
return null;
}
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerArk(nodePreference.getServeurArk());
exportFromBDD.setServerAdress(nodePreference.getCheminSite());
exportFromBDD.setNodePreference(nodePreference);
StringBuffer skos = exportFromBDD.exportMultiConcept(ds, value, lang, idGroup, idTheso);
return skos;
}
Aggregations