Search in sources :

Example 26 with ExportFromBDD

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

the class Rest method conceptToSkos.

/**
 * Fonction qui permet de récupérer un concept skos par identifiant
 *
 * @param idConcept
 * @param idThesaurus
 * @return skos
 */
private StringBuffer conceptToSkos(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.setNodePreference(nodePreference);
    exportFromBDD.setServerArk(nodePreference.getServeurArk());
    exportFromBDD.setServerAdress(nodePreference.getCheminSite());
    StringBuffer skos = exportFromBDD.exportConcept(ds, idTheso, idConcept);
    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)

Example 27 with ExportFromBDD

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

the class Soap method multiConceptToSkos.

/**
 * Web service operation
 * @param value
 * @param idThesaurus
 * @param lang
 * @return
 */
@WebMethod(operationName = "multiConceptToSkos")
public String multiConceptToSkos(@WebParam(name = "value") String value, @WebParam(name = "idThesaurus") String idThesaurus, @WebParam(name = "lang") String lang) {
    if (ds == null)
        return null;
    if (prefs == null)
        return null;
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setServerArk(prefs.getProperty("serverArk"));
    exportFromBDD.setServerAdress(prefs.getProperty("cheminSite"));
    String skos = exportFromBDD.exportMultiConcept(ds, idThesaurus, value, lang).toString();
    return skos;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) WebMethod(javax.jws.WebMethod)

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