Author Message
RichardMudway
Joined: Sep 18, 2008
Messages: 7
Offline
Hi Support,

I would like to know if it is possible to programmatically get the VDU fields in a Java Servlet?

I can see the Java code generated by the IC (GetVDU) GUI component, but i would like to dynamically get the VDU fields using some of this code. Meaning i would like to read the VDU names externally from a text file and load them into the VDU variables via the code before doing a fetch via the getVDUFields command.

It looks like it can be done, but i am also not sure if i have to create the VDU field names via the code too. So some direction would be great right now as i have not found anything that covers this.

Thanks!

Rich.
NeilGoldsmith
Joined: Nov 6, 2013
Messages: 902
Offline
It's not really meant to use dynamic field names. The field names should exist in the vdu variable which should match to what is in the vdu on the IC side.

You could try it in code:
//assign the vdu fields to the names variable
List<String> names = new ArrayList<String>();
com.avaya.sce.runtime.connectivity.ic.web.GetVDU getVDU= new com.avaya.sce.runtime.connectivity.ic.web.GetVDU(names);
getVDU.executeCommand(mySession);

However, you must programmatically create the fields in the vdu and vdu_cache variable or the response will not copy correctly as it expects to copy into the fields by name.

Another thing you can do is create all the possible fields you would need in the vdu variable and based on what dynamic fields you need, just pull those out. So if you have a total of 40 fields, add them all to the vdu variable, but on a given getVDU call, only pull in the 10 or so that you need based on your dynamic fields.
RichardMudway
Joined: Sep 18, 2008
Messages: 7
Offline
Hi Neil,

Thank you for this info. Yes the VDU fields must match *exactly* the names on the AIC I believe.

I think I have already done what you have suggested as I saw how the auto-generated code handled the VDU fetch/get, but how would I create the fields in the VDU variable/property? I have already written the Java code for Creating variables and executing the VDU Get command, but something is wrong with variable creation as this part causes an error.

I have seen the Java Class for creating the VDU fields and it has a factory component with a method to create a variable, but it is unclear if this creates only one variable at a time or all that I need from an array. My code that attempts to create these fields in the VDU variable is causing the app to crash, but unfortunately I have no idea if I am using the function correctly?? There is no docs that found to verify what I have done so far.

Finally, are you sure that I can create fields in the VDU variable. As I was poking around what code drives building these fields for the VDU parameter when it is auto generated via the GUI (IC Connector), and the VDU fields are "public static strings" in the startup side of app in OD. This leaves me to question if I can leave the VDU variable empty with no fields and use the factory to create my dynamic field names just before invoking the VDU get?

Thanks.
RichardMudway
Joined: Sep 18, 2008
Messages: 7
Offline
I have tried to get the EDU fields without dynamically creating those VDU names (just like the GUI does in the generated code). With a few tweaks to your code i am able to get my Java Servlet to be executing properly. But my code for assigning to a simple variable is not working. As i would like to assign and output the variables i fetch from the EDU Server.

Also I have previously tried the following for dynamically creating the VDU fields:

#1 - Startup code uses this. I doubt that this would have worked unless it added to the complex variable.
variable = com.avaya.sce.runtime.ComplexVariable.createComplexVariable(IProjectVariables.VDU, variableFields, "com.avaya.sce.runtime.connectivity.ic.pdc.VDUVariableFactory", mySession, false, true );

#2 - Trying to get the Complex Variable and then add into it more fields.
com.avaya.sce.runtimecommon.IVariable.setCollection(ICollection arg0)

#3 - Similar to Item #2.
com.avaya.sce.runtimecommon.ICollection.append(String arg0, IRuntimeSession arg1)

#4
variable = myVDUVariableFactory.createVariable(IProjectVariables.VDU, variableFields, variableFields, mySession);

Unfortunately, all the above has failed. Are you able to provide a doc or correct what i have to steer me in the correct direction?

Thanks!
NeilGoldsmith
Joined: Nov 6, 2013
Messages: 902
Offline
see message.
Go to:   
Mobile view