Page 1 of 1

(RDMLX) Get the LR Profile Server Name in OFFLINE Javascript

Posted: Wed Aug 24, 2016 8:23 pm
by MarcusLancaster
Hi all.

I'm building an offline form, which when operating with a network connection will attempt to display a file (could be a PDF, HTML, image, etc) in a WebView (the file is stored on the web server). It's the same web server that LongRange uses when we refresh, and sync up and down data. So... is there a way for me to grab the "Server Name" and "Use SSL" settings from the local LR profile from some offline javascript? I could then assemble the target URL without having to hardcode the domain, or explicitly download it...

I've had a look through the doco / forum posts and can't see anything obvious.

If there is a way, any info would be most welcome.

Cheers for now.

Marcus.

Re: (RDMLX) Get the LR Profile Server Name in OFFLINE Javascript

Posted: Thu Aug 25, 2016 8:46 am
by tsupartono
You can specify just the path portion of the URL, which will automatically resolve to the server defined in the server profile.

With your path, you can either specify an absolute path (starts with '/'), or a relative path (starts with './').
Note that when specifying relative path in this context (as a value to the 'Url' property of a Web View), you must prefix the path with './', otherwise LongRange will interpret it is a resource).
  • Absolute path
    When you specify an absolute path, the base URL will be the server root URL.
    For example, if the server specified in the profile is http://demo.lansa.com, and the absolute path is /PDF/brochure1.pdf, it will resolve to http://demo.lansa.com/PDF/brochure1.pdf
  • Relative path
    When you specify a relative path, the base URL will be the LongRange root URL.
    For LANSA backend, the LongRange root is /images/LongRange, and RPG backend it will be just /LongRange.
    For example, if the server specified in the profile is http://demo.lansa.com, and the relative path is ./PDF/brochure1.pdf, it will resolve to http://demo.lansa.com/images/LongRange/ ... chure1.pdf (LANSA back-end).