How can I define a list of properties externally, without having to change the source, as well as retrieve these properties in my code?
I have noticed in the bottom of the Servoy Admin Page two fields system.properites and user.properties, so I was wondering If I should use them. I tried and I couldn’t even add a value to those fields. Why they don’t have a info button like the others after all?
pbakker:
Serverside, in the servoy.properties, you can insert some default values for them. Those will show also on the admin pages in the area you saw.
Yes, I saw the area to enter system and user properties as the picture I sent before shows. However I couldn’t add any parameter there. In this case, I have A NEW PROBLEM, what’s going on with those fields that never accept new values?
patrick:
Our UserManager plugin allows you to read and write any property to either a client’s or the server’s property file. Is that what you want?
Thanks for the suggestion, but I’ve noticed it’s not free and actually it has much more than what I need. If Servoy could handle through the getProperty method would be great.
pbakker:
You can add them directly in the servoy.properties file, but you should also be able to edit them directly on the admin page.
That’s just weird, I’ve tried to do both ways and nothing. The property simply disappears as soon as I save the changes. My question is: Is there any configuration in the application server that could be avoiding me save the properties?
Beautiful. It works, but just for user properties. The same problem of disappearing found for system properties, even using the correct prefix. Any ideas? Are we not supposed to use that field?
Just for reference, I had to reference them in code using application.getUserProperty() passing the property name without the prefix. Hey, Servoy! Why not have a “info” button like all the other fields have with all this information.
One last and important question: Is there any way of saving properties in the client machine for remembering the user, like web cookies for example?
pbakker:
user properties ARE client specific properties, so each client can have it’s own value for a specific property.
In this case, I can assume that if I use application.setUserProperty(), it will somehow store the property in the client’s machine and the application will be able to get it further even after a shutdown?
If that’s the case, could you please explain where these properties are saved in the client’s machine? Which file?
I’m very grateful for the help given so far. Just need to know this little more. I couldn’t find any documentation about it.
The properties file is inside the .servoy folder that is in the user’s directory. I can’t recommend writing there by using the file plugin, however. I could imagine that your changes are overwritten in certain cases…
How do I read a system property, defined as mentioned above with the prefix system.property?
patrick:
I can’t recommend writing there by using the file plugin, however
Well, can I use the function application.getUserProperty() for reading the user properties stored in .servoy client folder? Where is this folder saved? Sorry, I couldn’t find it. And again, are those user properties recorded in the client’s machine by the function application.setUserProperty()?
Does anyone use this in your applications? How do you define specific application configuration properties?
Anyway, if Servoy could put a “info” button for these fields in the admin page would have helped me a lot.
Thank you for the link, but I still need help with this. The article is about reading properties from a database server. I want to be able to very simply read the system property from the file. I wish to access the server of one of our customer and simply edit a property with a notepad or through Servoy admin page.
There must be a way to do this in Servoy, otherwise what is the purpose of having that field system.properties on the bottom of Admin Page?
Also, the user properties are not clear in the way they actually work. If they can be stored in the client remote machine, etc.
I’m not sure what is not clear about the workings of the user properties. As said before, user properties set with the application.get/setUserProperty() are client specific.
The user.properties field on the admin pages allows you to set a default value serverside for these same properties. Once the client starts, it gets these default values.
Where they are stored shouldn’t really matter. What’s important is that they are client specific, can be edited/retrieved using the application.get/setUserProperty() functions and can get a default value when the client starts by adding them (with “user.” prefix) to the user properties field on the admin pages.
As for the system properties: These are “system” properties, as in Java stuff. We added the ability to add/edit system properties, because some customers had a need for it. If you need to read system properties clientside, you need some Java code, but in general you don’t need to access system properties in the client.
You need seems to be to edit the servoy.properties file of the server of your customer(s). There is no mechanism to do this from the client in servoy. On the admin pages, there is no direct way to do this, but most of the properties are linked to functionality you do find ont he admin pages, like the Database Servers page on the Admin Pages etc.