Setting configurations without setters programmatically

Hi,
I am currently working on a screen in which users would be able to modify certain app/web-app.properties without having to access the Application Properties screen (appproperties-browse.xml), as we wish to provide customers a virtual version of a document they would have to physically fill with configurations.
Some of the property groups are bruteForceProtection and passwordPolicy, with which we are struggling with, as their respective config interface does not provide a setter for them. We are trying to solve this by getting all appPropertyEntities, almost like the AppPropertyDatasource does on the original app.properties screen and setting their new value as well.
The problem is these appPropertyEntities do not save their respective app property when modified.
Is there any possible solution to this?
Best regards,
T.

Hi,
To change value for properties stored in database you can use method:
com.haulmont.cuba.core.app.ConfigStorageAPI#setDbProperty
It’s a bean in the core module.

For APP-stored properties you can use com.haulmont.cuba.core.sys.AppContext#setProperty method (but changes will not be persisted after server restart, of course).

1 Like

Thank you so much, it worked perfectly!