cancel
Showing results for 
Search instead for 
Did you mean: 

Access to Application properties

Former Member
0 Kudos

Hello,

within NWDS I set some user defined Application Properties like "CONFIG_ITEM". How can I access this in my WebDynpro application?

I tried the following

WDDeployableObjectPart currentAppPart = wdComponentAPI.getApplication().getDeployableObjectPart();
IWDConfiguration config = WDConfiguration.getConfiguration(currentAppPart);

String configured = config.getStringEntry("CONFIG_ITEM");

At the second line I get an WDConfigurationNotFoundException. So obviously that's not the correct way...

Thanx for any help,

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Frank,

Try this

IWDApplication application = wdComponentAPI.getApplication();

Properties properties = new Properties();

Collection wdProperties = application.getApplicationInfo().getApplicationProperties();

for (Iterator iter = wdProperties.iterator(); iter.hasNext();) {

IWDApplicationPropertyInfo wdProperty = (IWDApplicationPropertyInfo) iter.next();

if ("CONFIG_ITEM".equals(wdProperty.getName()){

String config_item = properties.getProperty(wdProperty.getName());

break;

}}

Let me know if you have any problems.

Regards,

Shubham

Former Member
0 Kudos

That was a good hint Modified your source code a little bit and it works now:

IWDApplicationInfo application = wdComponentAPI.getApplication().getApplicationInfo();
	
String config = application.findInApplicationProperties("CONFIG_ITEM").getValue();

Thank you very much.

I would like to close this as answered and reward you with points... But there are no controls at time showing up

Okay got your points

Message was edited by: Frank Schulten

jcvidaller
Participant
0 Kudos

Hello,

I've a question... Are these properties configurable without redeploying the Web Dynpro application?

We have some constant values defined in some Web Dynpro applications and we wanted the user could change it easily. So if these application properties could be maintainded easily by the user, we could use it for definig those constants.

Thanks in advance,

jc!