SysSingleton GetSystemUrl
No edit summary
No edit summary
Line 10: Line 10:
       '/Turnkey/AngularApp#/ToolInfo/'+self.Guid.asstring)
       '/Turnkey/AngularApp#/ToolInfo/'+self.Guid.asstring)


Please note that this is the URL of the TurnKeyserver. Thus is an action originating from TurnKey needed to set the URL, this if needed for server-side jobs or similar.
Please note that this is the URL of the TurnKeyserver. Thus is an action originating from TurnKey needed to set the URL, this action may be if needed to persist for server-side jobs or SysAsync tickets running on MDrivenServer.

Revision as of 10:58, 23 October 2020

This page was created by Hans.karlsen@mdriven.net on 2018-08-06. Last edited by Stephanie@mdriven.net on 2025-02-18.

By adding this method to your SysSingleton and marking it with Eco.ExternalLateBound=anyvalue you can get access to the running turnkey system's url address:

SysSingleton.GetSystemUrl():string
x

Making the method "IsQuery" makes it available in ocl (not only action language) - and you can write things like this:

SysSingleton.oclSingleton.GetSystemUrl()+ '/SiteAssets/ProjectReportTemplate.odt'

...this will fully qualify the address to a report template found in SiteAssets.

Or maybe you need an QRImage with a fully qualified url back to your system:

ZXing.QRImage(300,300,SysSingleton.oclSingleton.GetSystemUrl()+
     '/Turnkey/AngularApp#/ToolInfo/'+self.Guid.asstring)

Please note that this is the URL of the TurnKeyserver. Thus is an action originating from TurnKey needed to set the URL, this action may be if needed to persist for server-side jobs or SysAsync tickets running on MDrivenServer.