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.
Solved! Go to Solution.
You may try using this approach:
https://github.com/aborroy/alfresco-script-root-object
You may try using this approach:
https://github.com/aborroy/alfresco-script-root-object
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.