cancel
Showing results for 
Search instead for 
Did you mean: 

How to access to IWDComponent from Java class using the application name

Former Member
0 Kudos

Hi

I need an access to IWDComponent from java class that has only the application name and dc name.

<b>Is there a way to get access to the web dynpro application or controller using the given parameters (application name and dc name)</b>

<u>

The scenario in more details:</u>

I implement an external interface ("IViewListProvider") that allow me to define properties grouped in categoires and accessable to end-user.

I want to use the web dynpro MessagePool to define the properties description.

The problem is that I can't get access to the IWDTextAccessor of my IWDComponent withing my java class that implements that interface (("IViewListProvider")

I do have the following parameters in the method declaration:


public Collection getIViewProperties(String dcName, String applicationName,
			String variantName, String iViewID, Locale locale,
			Map applicationProperties) throws ObjectAccessException {
}

can I get access to the IWDComponent given the above paramaters

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Nili,

Just don't do this.

Seriously, WebDynpro is a vendor(SAP)-specific variant of J2EE container (like EJB or WebApplications). WebDynpro classes rely heavily on this container behavior (lifecycle phase handling, control flow, class loading and references, thread-local variables etc etc). Providing such functionality outside of WD container is nearly impossible. And, in fact, you have to emulate such functionaliy to make your code work.

VS

Former Member
0 Kudos

Hi Valerie,

I guess we still have a question here, the problem starts since we are using pure java interface within WD application.

we want to use the translation mechanism for some strings. so if we don't have access to the Text Accessor how can we translate our strings in runtime?

can you please elaborate how you see the solution?

Regards

Yoel

Former Member
0 Kudos

Hi VS,

I have similar kind of requirement. I need to access methods in webdynpro DC - interface controller in java project DC.

I could not find any clues on this.

I created a webdynpro DC, created a public part of the wdComponent. Also created one java project DC and added the public part craeted as an used DC in this.

Is it possible to access WD classes in this java project?

Please let me know how to achieve this if possible.

Thanks.

Former Member
0 Kudos

Try this code pls, you can translate your strings in runtime:

String resourceDir="com.companyName.sss.inventory.coms.wdp.ResourceInventory";

IWDResourceHandler resourceHandler = null;
resourceHandler = WDResourceHandler.createResourceHandlerForCurrentUser();
resourceHandler.loadResourceBundle(resourceDir, getClass().getClassLoader());

String lableCompany=resourceHandler.getString("message.message_pool_key");

Edited by: Ree Fish on Feb 20, 2009 11:25 AM

Former Member
0 Kudos

Hi Ree,

Thanks for the reply.

Here I am looking at is to access methods in webdynpro interface controller.

Also I need to pass and retrieve the values in context node/attributes.

Can you please explain your code in bit detail?