Hi Jakob,

There is of course xdmp:host and xdmp:host-name, but that won't return the 
host-in-the-url entered by the end-user. The host-name could even be very 
unusefull to the end-user, as it is the value entered in the admin interface, 
and doesn't need to have any reference to reality as far as I know. You can 
change it to anything you like at least..

If you just want to show the host name as known to the end user, you could 
alternatively use javascript within the html returned to the user.

Clustering might be involved indeed, but I expect xdmp:host to return the host 
ID of the evaluator node, e.g. the host that received the actual request, not 
all other hosts that might be involved in data retrieval. If you have load 
balancing, then different host names would be shown.. 

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: [email protected] 
[mailto:[email protected]] Namens Jakob Fix
Verzonden: vrijdag 4 maart 2011 15:30
Aan: General Mark Logic Developer Discussion
Onderwerp: [MarkLogic Dev General] how to retrieve the hostname, easily

Hi,

I'm looking for a not-so-complicated way to retrieve the host name
(i.e. the name that is displayed on top of each page in the MarkLogic
admin interface).
Why is there a xdmp:get-request-path, xdmp:get-request-protocol,
xdmp:get-request-url, but no xdmp:get-host-name?

Of course, I've ploughed through the Admin/ code, and finally found
the function get-session-host-node() in session.xqy, but it also
depends on an $hosts.xml variable which in turn uses yet another
library.  In the end it's very involved if all you want to do is to
display the hostname the current application is running on (I guess
the fact that it's not easy probably has its reasons in the fact that
more complicated scenarios involving clustering exist that need to be
accounted for).

cheers,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to