Get system properties in the webscript

cancel
Showing results for 
Search instead for 
Did you mean: 
fedorow
Senior Member II

Get system properties in the webscript

Jump to solution

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.

 

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: Get system properties in the webscript

Jump to solution

You may try using this approach:

https://github.com/aborroy/alfresco-script-root-object

Hyland Developer Evangelist

View solution in original post

1 Reply
angelborroy
Alfresco Employee

Re: Get system properties in the webscript

Jump to solution

You may try using this approach:

https://github.com/aborroy/alfresco-script-root-object

Hyland Developer Evangelist