[basex-talk] Make use of external Identity Management for BaseX

2021-04-29 Thread Rob
Hi,

I have a question.
Can BaseX make use of an Identity Management application like Keycloak for 
Users?

I can’t find anything about it :)

With kind regards,
Rob Tjalma

Re: [basex-talk] Reloading jars on a running http server.

2021-04-29 Thread Reece Dunn
Hi Christian,

Thanks for the response. Unfortunately, I've not been able to get the
reloading working.

Kind regards,
Reece

On Wed, 21 Apr 2021 at 18:49, Christian Grün 
wrote:

> Hi Reece,
>
> If you install your Java code as JAR file in the repository [1], the
> code will be loaded and unloaded every time when your query is
> executed. If you get an error message…
>
>   java.lang.reflect.InaccessibleObjectException: Unable to make field
> private final jdk.internal.loader.URLClassPath
> java.net.URLClassLoader.ucp accessible: module java.base does not
> "opens java.net" to unnamed module @79e2c065
>
> …unloading fails [2], as you’re probably using a more recent version
> of the JDK, which restricts reflective access to internal variables.
> You can get around this by adding Java flags at startup time:
>
>  --add-opens java.base/java.net=ALL-UNNAMED
>  --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
>
> Maybe there are better solutions to unload JAR files today.
> Suggestions are welcome!
>
> Hope this helps,
> Christian
>
> [1] https://docs.basex.org/wiki/Repository#Java
> [2]
> https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/JarLoader.java#L34
>
>
>
> On Tue, Apr 20, 2021 at 6:44 PM Reece Dunn  wrote:
> >
> > Hi all,
> >
> > I'm working on a Java class that I'm importing into an XQuery, so I can
> do additional processing on the data that isn't easily expressible in
> XQuery (or XSLT). In order to get BaseX to pick up a modified version of
> the jar file I'm building, I'm restarting the BaseX http server.
> >
> > This makes it slower to turn around testing the changes. Is there a
> better way of doing this?
> >
> > Kind regards,
> > Reece
>


[basex-talk] Getting profile information in server responses.

2021-04-29 Thread Reece Dunn
Hi all,

In BaseX, is there a way to get the profile timings (compile, run, print,
etc.) in the response of a HTTP request via the Server-Timing header (
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)?

Kind regards,
Reece


Re: [basex-talk] Make use of external Identity Management for BaseX

2021-04-29 Thread Christian Grün
Hi Rob,

There is no prepackaged module for Keycloak (at least I’m aware of
none), but you can write your own code with XQuery. See [1] for an
example how this might look like.

Are you using RESTXQ?

Best,
Christian

[1] 
https://code-repo.d4science.org/gCubeSystem/d4science-keycloak-themes/src/branch/master/src/utils/xquery



On Thu, Apr 29, 2021 at 3:54 PM Rob  wrote:
>
> Hi,
>
> I have a question.
> Can BaseX make use of an Identity Management application like Keycloak for 
> Users?
>
> I can’t find anything about it :)
>
> With kind regards,
> Rob Tjalma


Re: [basex-talk] Reloading jars on a running http server.

2021-04-29 Thread Christian Grün
Hi Reece,

I’m sorry to hear that. Did you build a custom JAR file, or do you
encounter problems with the JDK?

Cheers,
Christian



On Thu, Apr 29, 2021 at 9:48 PM Reece Dunn  wrote:
>
> Hi Christian,
>
> Thanks for the response. Unfortunately, I've not been able to get the 
> reloading working.
>
> Kind regards,
> Reece
>
> On Wed, 21 Apr 2021 at 18:49, Christian Grün  
> wrote:
>>
>> Hi Reece,
>>
>> If you install your Java code as JAR file in the repository [1], the
>> code will be loaded and unloaded every time when your query is
>> executed. If you get an error message…
>>
>>   java.lang.reflect.InaccessibleObjectException: Unable to make field
>> private final jdk.internal.loader.URLClassPath
>> java.net.URLClassLoader.ucp accessible: module java.base does not
>> "opens java.net" to unnamed module @79e2c065
>>
>> …unloading fails [2], as you’re probably using a more recent version
>> of the JDK, which restricts reflective access to internal variables.
>> You can get around this by adding Java flags at startup time:
>>
>>  --add-opens java.base/java.net=ALL-UNNAMED
>>  --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
>>
>> Maybe there are better solutions to unload JAR files today.
>> Suggestions are welcome!
>>
>> Hope this helps,
>> Christian
>>
>> [1] https://docs.basex.org/wiki/Repository#Java
>> [2] 
>> https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/JarLoader.java#L34
>>
>>
>>
>> On Tue, Apr 20, 2021 at 6:44 PM Reece Dunn  wrote:
>> >
>> > Hi all,
>> >
>> > I'm working on a Java class that I'm importing into an XQuery, so I can do 
>> > additional processing on the data that isn't easily expressible in XQuery 
>> > (or XSLT). In order to get BaseX to pick up a modified version of the jar 
>> > file I'm building, I'm restarting the BaseX http server.
>> >
>> > This makes it slower to turn around testing the changes. Is there a better 
>> > way of doing this?
>> >
>> > Kind regards,
>> > Reece


Re: [basex-talk] Getting profile information in server responses.

2021-04-29 Thread Christian Grün
A good idea; I’ll think of ways to get this included. One challenge
might be that the response is streamed to the client. This means that
when creating the HTTP request headers, it will not be known yet how
long the evaluation will take (and the time for evaluation may also
depend on the connection speed). The time for parsing and compiling
the query should be known at that time, though. – Maybe we could
suppress result streaming when timings are requested.


On Thu, Apr 29, 2021 at 9:50 PM Reece Dunn  wrote:
>
> Hi all,
>
> In BaseX, is there a way to get the profile timings (compile, run, print, 
> etc.) in the response of a HTTP request via the Server-Timing header 
> (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)?
>
> Kind regards,
> Reece