And it works :))))
Thanks a lot for the trick and the instant answer !
Now we will be able to distribute SynopsX as an autonom module :)

« Ne travaillez jamais »

Maud Ingarao
IHPC (UMR 5037)
Institut d’histoire de la pensée classique, de l’Humanisme aux Lumières
Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322
15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07
+33 4 37 37 65 79 - maud.ingarao@ens-lyon.fr

Je suis absente le jeudi | Out of office on Thursdays

http://pensee-classique.ens-lyon.fr
http://institutdesanti.ens-lyon.fr
http://ahn.ens-lyon.fr
http://www.mutec-shs.fr
http://cahier.hypotheses.org

On 19/02/2015 11:08, Christian Grün wrote:
Hi Maud,

We are glad to hear that the DBA code serves as a good inspiration!
After all, I think this should be its primary purpose. The way how we
integrate user components like buttons or tables is a bit unorthodox;
this may be simplified in a future version.

we want to distribute our static files
inside our module, in a synopsx/files/ directory, [...]
In the DBA code, we solved this by creating a custom <rest:response>
element for all files starting with the path "dba/files". I have
slightly simplified the current code; please see here [1] how it's
done! The web:mime-type($path) function calls an internal BaseX
function to retrieve the content type of the response [2]; there may
be a new XQuery function for that in future as well. We could even
think about providing an XQuery function for everything that's
happening in [1].

More feedback is welcome,
Christian

[1] https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/dba/util.xqm#L23-L46
[2] https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/dba/modules/web.xqm#L38-L47



and of course we don't
want to ask people to modify the static path declaration in their
WEB-INF/web.xml file to use our module.
It works perfectly in your dba module : for exemple in dba/modules/tmpl.xqm,
the created html element calls files/js.js or files/style.css and it simply
works... But not in ours : we get this "No function matches the request"
error because these files pathes are interpreted as restxq pathes (which
sounds reasonable, but why not in yours ?)
We are know trying more and more complicated things that don't work neither,
like in
https://github.com/mingarao/synopsx/blob/dev/webapp/synopsx/_restxq/files.xqm
line 37...
So I think we should better stop there and ask you : what's the trick in dba
?
All the best !
Maud and the AHN/SynopsX people

--

« Ne travaillez jamais »

Maud Ingarao
IHPC (UMR 5037)
Institut d’histoire de la pensée classique, de l’Humanisme aux Lumières
Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322
15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07
+33 4 37 37 65 79 - maud.ingarao@ens-lyon.fr

Je suis absente le jeudi | Out of office on Thursdays

http://pensee-classique.ens-lyon.fr
http://institutdesanti.ens-lyon.fr
http://ahn.ens-lyon.fr
http://www.mutec-shs.fr
http://cahier.hypotheses.org