Author Message
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
I have a PDC that includes a server war file component that is deployed to the Tomcat webapps directory. The war file is selectable during the export process for the runtime support files, and is working fine when installed on the application server for testing. I would like to have this application deployed to the simulator tomcat instance in the same way the aesconnector.war file and the runtimeconfig.war files are deployed for the Application Simulator.

How do I accomplish this? My inclination would be to use the com.avaya.ade.common.core.simulatorService extension point, but I have no references to verify if this is the correct way.

Michael
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The simulator extension that some of our PDCs use is really for simulating the backend service without talking to the real service for the connector servlet. For example, for aesconnector, in reality its talks to AES, instead in simulation, the extension would launch a fake service just serving simple response to a command (like transfer) through a sock instead of talking to AES. Are you looking to do something like that?
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Hmmm... hadn't thought of that aspect (yet).

What I'm like is for the war file to be deployed to the tomcat instance associated with the workspace, much like the aesconnector.war file is automatically placed into the webapps directory in the workspace tomcat instance. When I try to test the application, it will fail at my PDC because the application doesn't exist. If I manually copy it into the tomcat webapps directory, then test the application again (via the simulator), it works just fine.

Hope that makes sense... if not, let me know. :)
Michael
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
If you haven't thought of that aspect, that's fine. That aspect is for simulating the back-end service, for your users who may not have access to the service in development.
Sounds like what you need is really copying the war file automatically in Tomcat. You can do something like what is showing in the plugin.xml of com.avaya.sce.cti.ui:
<extension
point="com.avaya.sce.core.pluggableConnector">
......
<item
destination="TOMCAT_WEBAPPS"
resourceName="data/aesconnector.war"
versionClass="com.avaya.sce.cticonnector.servlet.server.CTIConnectorVersion"
versionMethod="getVersion">
</item>
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Hi Wilson.

I added a new item as shown below, however it's still not being deployed to the workspace tomcat instance when the PDC is enabled (or any other time).

Michael
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
This only works when you first set or modify the Tomcat home in Eclipse Preference. It's not based on enabling/disabling the connector.
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Thanks Wilson. I've updated the document to note that the developer should open the Tomcat preferences in Eclipse and click the Ok button to enable the war file for simulation.

Would implementing a Simulator profile class alleviate this.. allowing the developer to test with "mock" data? If so, are there any examples of how to implement this?

Thanks again,
Michael
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
No. You still need to implement the Simulator Service to serve up the data when simulating the call. The simulator profile is a way for entering and storing the "mock" data.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Actually, you could add implementation to the your PluggableConnectorConfig class to copy or delete the war file based on enabling/disabling the PDC. Here is some sample code you can start with:

public void connectorEnabled(IProject project) {
String[] names = new String[] { "myconnector.war" };
TomcatUtil.getTomcatUtil().copyFileToTomcat(MyPDCPlugin.getDefault().getBundle(), names, true, SCERT.DATADIR, ItemDestination.TOMCAT_WEBAPPS);

/*
*remove the old directory from Tomcat
*/
TomcatUtil.removeInstalledWebAppDirectory("myconnector");
}


public void connectorDisabled(IProject project) {
   // if tomcat is running, we need to stop it first.
   if(TomcatUtil.tomcatReady() == true){
    TomcatUtil.stop(new SubProgressMonitor(monitor, 1));
   }
   TomcatUtil.getTomcatUtil().removeFileFromTomcat("myconnector.war", ItemDestination.TOMCAT_WEBAPPS);
               
   TomcatUtil.removeInstalledWebAppDirectory("myconnector");
}
Go to:   
Mobile view