08-06-2024 01:46 PM
How to get system properties like alfresco.host, share.host, share.port, e.t.c in the webscript?
This code works in the Javascript console, but does not for the webscript.
var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); var properties = ctxt.getBean('global-properties', java.util.Properties);
var protocol = properties["share.protocol"] || 'http';
var host = properties["share.host"] || 'localhost';
var port = properties["share.port"] || '8080'
Webscript returns: Packages not defined.
08-07-2024 03:07 AM
You may try using this approach:
https://github.com/aborroy/alfresco-script-root-object
08-07-2024 03:07 AM
You may try using this approach:
https://github.com/aborroy/alfresco-script-root-object
Explore our Alfresco products with the links below. Use labels to filter content by product module.