cancel
Showing results for 
Search instead for 
Did you mean: 

working with .propterties files

Former Member
0 Kudos

Hi there,

at the moment im trying to get in touch with the use of properties files.

So far i, created a little application with a properties file: "mail.properties".

I already figured out how to read some data/information... isnt such a big deal.

IWDConfiguration config = WDConfiguration.getConfigurationByName( 
            wdComponentAPI.getDeployableObjectPart().getDeployableObject(), 
            "mail.properties");
wdContext.currentContextElement().setFrom( config.getStringEntry("from") );

But now i want to enable the user to make some value changes (via InputFields), which later should be stored back into the properties file.

So my question is, how to write back the new values to the properties file?

regards,

Mirko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hmmm, so properties may not be the right choice for this application.

At the moment im developing an WDJ application which in some cases has to send email to predefined email-addresses.

But in the future these email-addresses may change - some will be added, some will be removed.

Im searching for an easy way to r/w these addresses, because i want the endusers to be able to easily maintain them on their own.

regards

Former Member
0 Kudos

Ok, I get the point. You are right, if the End-users shall be able to edit the adresses themselves, the WDConfiguration won't help you.

I see 2 possible solutions:

1. use a database table and write a CRUD component that can create and update a list of mail addresses.

2. you store a custom java properties file in the KM Repository and use the java.util.Properties API to edit the content of the file. If you want to use the WDConfiguration API to access the addresses, use the adapter I wrote (Configuration adapter for WDConfiguration).

Mentioning KM: It should also be possible to store the emails with KM-properties instead of using a properties file.

Good Luck

Jan

Edited by: Jan Galinski on Mar 10, 2010 1:44 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

You can't. WDConfiguration is read only. You will have to use the Visual Administrator/Configuration Adapater to change the values during runtime.

Jan