cancel
Showing results for 
Search instead for 
Did you mean: 

WD Additional Resources

Former Member
0 Kudos

Hello,

my WD application requires additional configuration resources, how can I access them in the run-time?

I've got a solution for the problem, but it seems a bit strange for me, may be there is a better way?

So the resources are stored in the DC in

./src/mimes/Components/<WDApplication package+Name>/*.xml

String confPath = "<vendor>/<dc name with '~'-s>/Components/<WDApplication package+Name>/" + xxx.xml;

String url = WDURLGenerator.getResourcePath(confPath);

myMsgMgr.reportSuccess("Configuration url: " + url + ", path: " + confPath);

Document dom = null;

try {

dom = myXMLHelper.parseXML(url);

myMsgMgr.reportSuccess("Successfully parsed");

} catch (XMLException e) {

myMsgMgr.reportException("Unable to parse configuration file " + url, true);

return;

}

Thank you in advance!

Best regards,

Nick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have a look at <a href="https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/services/sal/config/api/IWDConfiguration.html">IWDConfiguration</a> and <a href="https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/services/sal/config/api/WDConfiguration.html">WDConfiguration</a>.

Armin

Former Member
0 Kudos

Hi Armin,

Thanks for the answer.

Can you give me a hint what is "deployableObject" - it's referenced in many interfaces, but I could not find example what could I use as the string for my WDpro DC?

It seems IWDConfiguration is based on properties data. Where the properties files has to be stored (the same "Components/<wdapp package+name>") in DC structure?

I've got XML files, where IWDConfiguration seems to be less of help (I need at minimum byte[] access to the content of the configuration to be able to parse it). Did I miss anything?

Best regards,

Nick

Former Member
0 Kudos

I don't like these notions of deployable object/part, they are not intuitive IMHO.

You can access them using the IWDComponent interface, see https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/progmodel/api/IWDCompone...

See also

https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/services/sal/config/api/...

Armin

Former Member
0 Kudos

The final solution for my problem is as following:

WDDeployableObjectPart part = wdComponentAPI.getDeployableObjectPart();
String url = WDURLGenerator.getResourcePath(part, "xxx.xml");
Document dom = myXMLHelper.parseXML(url);

The resources are stored in the DC in

./src/mimes/Components/<WDApplication package+Name>/*.xml

Former Member
0 Kudos

Excellent to see also the code that solved the problem. Thank you!

Armin

Answers (0)