#1 2020-11-04 20:52:23

unsi_2
Member
Registered: 2020-06-24

script includes and reading cfg files

hi, is it possible from a script to read cfg files? mail.cfg for instance

also, is it possible to include other scripts code in a script?

Offline

#2 2020-11-05 09:48:14

eduardo
Administrator
Registered: 2016-11-01
Website

Re: script includes and reading cfg files

Hi unsi_2,

yes, you can read the lostpassword.email.text property of the security/notifications.cf file like this:

import net.datenwerke.rs.utils.config.ConfigService;
import org.apache.commons.configuration.Configuration;

ConfigService configService = GLOBALS.getRsService(ConfigService.class);
Configuration config = configService.getConfigFailsafe("security/notifications.cf");
String mailTemplate = config.getString("lostpassword.email.text", "default text");

For calling scripts from other scripts, pls take a look here: https://reportserver.net/en/guides/scri … m-Scripts/

Regards,
Eduardo

Offline

#3 2020-11-10 09:08:03

unsi_2
Member
Registered: 2020-06-24

Re: script includes and reading cfg files

many thanks! great help

Offline

Board footer

Powered by FluxBB