Search in sources :

Example 6 with ExportFromBDD

use of mom.trd.opentheso.core.exports.old.ExportFromBDD 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;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) PreferencesHelper(mom.trd.opentheso.bdd.helper.PreferencesHelper)

Example 7 with ExportFromBDD

use of mom.trd.opentheso.core.exports.old.ExportFromBDD 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;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) PreferencesHelper(mom.trd.opentheso.bdd.helper.PreferencesHelper)

Example 8 with ExportFromBDD

use of mom.trd.opentheso.core.exports.old.ExportFromBDD 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;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) PreferencesHelper(mom.trd.opentheso.bdd.helper.PreferencesHelper)

Example 9 with ExportFromBDD

use of mom.trd.opentheso.core.exports.old.ExportFromBDD 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;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) PreferencesHelper(mom.trd.opentheso.bdd.helper.PreferencesHelper)

Example 10 with ExportFromBDD

use of mom.trd.opentheso.core.exports.old.ExportFromBDD in project opentheso by miledrousset.

the class Rest method conceptToSkosFromArk.

/**
 * Fonction qui permet de récupérer un concept skos par identifiant ark
 *
 * @param idConcept
 * @param idThesaurus
 * @return skos
 */
private StringBuffer conceptToSkosFromArk(String arkId, String idTheso) {
    if (ds == null) {
        return null;
    }
    nodePreference = new PreferencesHelper().getThesaurusPreference(ds, idTheso);
    if (nodePreference == null) {
        return null;
    }
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setNodePreference(nodePreference);
    exportFromBDD.setServerArk(nodePreference.getServeurArk());
    exportFromBDD.setServerAdress(nodePreference.getCheminSite());
    StringBuffer skos = exportFromBDD.exportConcept(ds, arkId);
    if (skos == null) {
        return new StringBuffer("");
    }
    return skos;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) PreferencesHelper(mom.trd.opentheso.bdd.helper.PreferencesHelper)

Aggregations

ExportFromBDD (mom.trd.opentheso.core.exports.old.ExportFromBDD)27 ByteArrayInputStream (java.io.ByteArrayInputStream)11 InputStream (java.io.InputStream)11 UnsupportedEncodingException (java.io.UnsupportedEncodingException)11 DefaultStreamedContent (org.primefaces.model.DefaultStreamedContent)11 PreferencesHelper (mom.trd.opentheso.bdd.helper.PreferencesHelper)9 JsonHelper (mom.trd.opentheso.core.jsonld.helper.JsonHelper)6 SKOSXmlDocument (skos.SKOSXmlDocument)6 ArrayList (java.util.ArrayList)3 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)3 WebMethod (javax.jws.WebMethod)2 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 FacesMessage (javax.faces.application.FacesMessage)1