Subject: Re: New Message from shane shifflett in Customer Voice Portal (CVP) - Gener Replied by: Janine Graves on 27-04-2009 02:55:42 PM It would be easier to debug your problem if you could copy/paste the java into the developer forum. Basically, you must extend the ActionElementBase and implement the ElementInterface.
Here's a sample that should work (it doesn't have any run time code yet) if you compile it and then do the steps you mentioned above. Then the element will show up under Elements > Local Folders in Studio Element Pane.
The most common reason an element doesn't show up in Studio is in the getSettings() method. You have to dimension the SettingsArray and then fill in each of those settings! So for example, settingsArray[3], then you must configure settingsArray[0], [1],] and [2] correctly.
public class TestActionElement extends ActionElementBase implements ElementInterface { // This method returns the name of the action element that appears in Studio's Element view public String getElementName() { return "Test"; } // This method returns the name of a folder that will contain the action element // in Studio's Element view. Use return null if you don't want it in a folder. public String getDisplayFolderName() { return "TestFolder"; } // This method returns a description of the element that will display in Studio // when the cursor hovers over the element in the Element view public String getDescription() { return "This element just displays one setting and has no runtime code yet." } //This method returns the settings to display in the element's configuration view public Setting[] getSettings() throws ElementException { //You must define the number of settings here Setting[] settingArray = new Setting[1]; //each setting must specify: real name, display name, description, //is it required?, can it only appear once?, does it allow substitution?, //and the type of entry allowed //Note that the settingArray starts indexing at 0 settingArray[0] = new Setting("input", "Entry 1", "This setting allows any string or variable entry", true, // It is required true, // It appears only once true, // It allows substitution Setting.STRING);
return settingArray; }
/** * This is the run time code, executed by CVP VXML Server when it reaches the element * in the call flow. */ public void doAction(String name, ActionElementData actionData) throws AudiumException { //do something here } }
Cisco Developer Community Forums wrote: > shane shifflett has created a new message in the forum "General > Discussion - All Versions": > > -------------------------------------------------------------- > Hello, >  > I've been trying to implement a Configurable Action Element, however, > I cannot get it to show up in the element pane. My understanding was > that I need a java class that implements the ElementInterface and > extends whatever ElementsBase class I'm trying to create (Action in my > case). Then override the common methods to allow the class to be > configured. After that, copy the compiled class file to my > applications deploy/java/application/classes folder and open/close the > project. After that it should be availabe in whatever folder I > specified in the getDisplayFolderName() method. Are there any steps > I am missing? > -- > To respond to this post, please click the following link: > > <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1319758> > > or simply reply to this email. This document was generated from CDN thread
Created by: shane shifflett on 27-04-2009 02:40:00 PM Hello, I've been trying to implement a Configurable Action Element, however, I cannot get it to show up in the element pane. My understanding was that I need a java class that implements the ElementInterface and extends whatever ElementsBase class I'm trying to create (Action in my case). Then override the common methods to allow the class to be configured. After that, copy the compiled class file to my applications deploy/java/application/classes folder and open/close the project. After that it should be availabe in whatever folder I specified in the getDisplayFolderName() method. Are there any steps I am missing?
Subject: RE: Re: New Message from shane shifflett in Customer Voice Portal (CVP Replied by: shane shifflett on 27-04-2009 03:26:58 PM Your test class shows up fine in the element pane. I can't figure out what the differenc is between them. public class EAuthenticationServiceAction extends ActionElementBase implements ElementInterface{ @Override public String getElementName(){ return "EAuthenticationServiceAction"; } @Override public String getDescription() { return "test service element"; } @Override /** * returning null here should make the element appear in the * ELEMENTS folder */ public String getDisplayFolderName() { return "Services"; } /** * This method is not used for anything in the current version * of Builder */ @Override public ElementData[] getElementData() throws ElementException { ElementData[] elementDataArray = new ElementData[1]; elementDataArray[0] = new ElementData("myData", " test data "); return elementDataArray; } @Override public Setting[] getSettings() throws ElementException { Setting[] settingsArr = new Setting[4]; settingsArr[0] = new Setting("userid", "User ID", "User ID for Auth", true, true, true, Setting.STRING); settingsArr[1] = new Setting("passwd", "Password", "Password for Auth", true, true, true, Setting.STRING); settingsArr[2] = new Setting("vendorid", "Vendor ID", "Vendor ID for Auth", true, true, true, Setting.STRING); settingsArr[3] = new Setting("vendorpw", "Vendor Pass", "Vendor Pass for Auth", true, true, true, Setting.STRING); return settingsArr; }
Subject: RE: Re: New Message from shane shifflett in Customer Voice Portal (CVP Replied by: shane shifflett on 27-04-2009 04:44:17 PM Thanks for your help. Still not sure exactly what it was but started cutting code out of my doAction method and everything worked. For whatever reason changing this code: public void doAction(String arg0, ActionElementData actionData) throws AudiumException { ActionElementConfig config = actionData.getActionElementConfig(); String userid=config.getSettingValue("userid", actionData); String passwd=config.getSettingValue("passwd", actionData); String vendorid=config.getSettingValue("vendorid", actionData); String vendorpw=config.getSettingValue("vendorpw", actionData); AuthenticateAcbOfxRequest req = new AuthenticateAcbOfxRequest(userid, passwd,vendorid,vendorpw); String endpoint = // commented out AuthenticateAcbOfxServiceLocator locator = new AuthenticateAcbOfxServiceLocator(); AuthenticateAcbOfxSoapBindingStub binding = null; try {
//Create binding using the URL specified in the properties file binding = (AuthenticateAcbOfxSoapBindingStub)locator.getAuthenticateAcbOfx( new URL(endpoint)); //Set the session with query options specified above //binding.setHeader(locator.getServiceName().getNamespaceURI()); AuthenticateAcbOfxResponse ret = binding.authenticate(req); System.out.println("Sent "+userid+" "+passwd+ " "+vendorid +" "+vendorpw+", got '" + ret.getErrorCode() +" " + ret.getErrorMessage() + " " + ret.getSubscriberId()+ "'"); return ret.getSubscriberId(); } catch(MalformedURLException e) { System.err.println(e.toString()); } catch (ServiceException ex1) { System.err.println(ex1.toString()); } catch(RemoteException e) { System.err.println(e.toString()); } return ""; } too /* just encapsulating my client code */ public void doAction(String arg0, ActionElementData actionData) throws AudiumException { ActionElementConfig config = actionData.getActionElementConfig(); String userid=config.getSettingValue("userid", actionData); String passwd=config.getSettingValue("passwd", actionData); String vendorid=config.getSettingValue("vendorid", actionData); String vendorpw=config.getSettingValue("vendorpw", actionData); String retVal = ""; String decision = "didntWork"; AsyncAuthenticationService svc = new AsyncAuthenticationService();// put code in this class try{ retVal = svc.authenticate(userid,passwd,vendorid,vendorpw); decision = "goodToGo"; } catch(MalformedURLException e) { decision = e.toString(); } catch (ServiceException ex1) { decision = ex1.toString(); } catch(RemoteException e) { decision = e.toString(); } catch(Exception e) { decision = e.toString(); } System.out.println("returned value: " + retVal); System.out.println("decision : " + decision);
svc = null; actionData.setSessionData("subscriberid",retVal); } fixed my issue.
Subject: Re: New Message from shane shifflett in Customer Voice Portal (CVP) - Gener Replied by: Janine Graves on 27-04-2009 03:41:42 PM Your code looks fine to me. I don't use the @Override in my code, you could try removing that. Also, each time you recompile your code, be SURE to copy the new class file into your Studio app's deploy/java/application/classes/ folder, then close and reopen the app in the workspace.
The only thing that I can think is that perhaps it doesn't like your folder name "Services"
If that isn't the problem, I would start commenting things out until it displays. Start by commenting out the content of your getSettings() method - that's the most common problem. Let it just return null. Then try commenting out the content of the getElementData() method can also return null.
By the way, in Studio>Windows menu, there's an option for ShowView - and you can look at the Studio Problems view and the Studio Error Log view (or something like that). In the newer versions of Studio (CVP 7.0), it actually shows what the error is! Now that's progress!
You could also start pasting your code into the methods that I sent you. One at a time, until it no longer shows up in Studio!
Cisco Developer Community Forums wrote: > shane shifflett has created a new message in the forum "General > Discussion - All Versions": > > -------------------------------------------------------------- > Your test class shows up fine in the element pane. I can't figure > out what the differenc is between them. >  >  > public class EAuthenticationServiceAction extends ActionElementBase > implements ElementInterface{ >    @Override >    public String getElementName(){ >       return "EAuthenticationServiceAction"; >    } >    @Override >    public String getDescription() >    { >       return "test service element"; >    } >    @Override >    /** >     * returning null here should make the element appear in the >     * ELEMENTS folder >     */ >    public String getDisplayFolderName() { >       return "Services"; >    } >    /** >     * This method is not used for anything in the current version >     * of Builder >     */ >    @Override >    public ElementData[] getElementData() throws ElementException { >       ElementData[] elementDataArray = new ElementData[1]; >       elementDataArray[0] = new ElementData("myData", " test > data "); >       return elementDataArray; >    } >    @Override >    public Setting[] getSettings() throws ElementException { >       Setting[] settingsArr = new Setting[4]; >       settingsArr[0] = new Setting("userid", "User ID", "User > ID for Auth", true, true, true, Setting.STRING); >       settingsArr[1] = new Setting("passwd", "Password", > "Password for Auth", true, true, true, Setting.STRING); >       settingsArr[2] = new Setting("vendorid", "Vendor ID", > "Vendor ID for Auth", true, true, true, Setting.STRING); >       settingsArr[3] = new Setting("vendorpw", "Vendor Pass", > "Vendor Pass for Auth", true, true, true, Setting.STRING); >       return settingsArr; >    } > >    public void doAction(String arg0, ActionElementData actionData) > throws AudiumException >    { >       ActionElementConfig config = > actionData.getActionElementConfig(); >       >       String userid=config.getSettingValue("userid", actionData); >       String passwd=config.getSettingValue("passwd", actionData); >       String vendorid=config.getSettingValue("vendorid", > actionData); >       String vendorpw=config.getSettingValue("vendorpw", > actionData); >       >       //custom code >        > actionData.setSessionData("subscriberid",ret.getSubscriberId()); >    } > } > -- > To respond to this post, please click the following link: > > <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1319813> > > or simply reply to this email.
Subject: Re: New Message from shane shifflett in Customer Voice Portal (CVP) - Gener Replied by: Janine Graves on 27-04-2009 04:52:42 PM oh, I hadn't notice before, but the Action Element doesn't return anything. So, removing your 'return' statement from the doAction probably fixed the problem.
Cisco Developer Community Forums wrote: > shane shifflett has created a new message in the forum "General > Discussion - All Versions": > > -------------------------------------------------------------- > Thanks for your help. >  > Still not sure exactly what it was but started cutting code out of my > doAction method and everything worked. >  > For whatever reason changing this code: >  > public void doAction(String arg0, ActionElementData actionData) throws > AudiumException >    { >       ActionElementConfig config = > actionData.getActionElementConfig(); >       >       String userid=config.getSettingValue("userid", actionData); >       String passwd=config.getSettingValue("passwd", actionData); >       String vendorid=config.getSettingValue("vendorid", > actionData); >       String vendorpw=config.getSettingValue("vendorpw", > actionData); >       AuthenticateAcbOfxRequest req = new > AuthenticateAcbOfxRequest(userid, >             passwd,vendorid,vendorpw); >          >       String endpoint = // commented out >       >       AuthenticateAcbOfxServiceLocator locator = new > AuthenticateAcbOfxServiceLocator(); >       AuthenticateAcbOfxSoapBindingStub binding = null; >       try { > >          //Create binding using the URL specified in the > properties file >           binding = > (AuthenticateAcbOfxSoapBindingStub)locator.getAuthenticateAcbOfx( >                 new URL(endpoint)); >           //Set the session with query options specified above >           > //binding.setHeader(locator.getServiceName().getNamespaceURI()); >           AuthenticateAcbOfxResponse ret = > binding.authenticate(req); >           >           System.out.println("Sent "+userid+" "+passwd+ " > "+vendorid >                 +" "+vendorpw+", got '" + > ret.getErrorCode() >                 +" " + ret.getErrorMessage() + " " > + ret.getSubscriberId()+ "'"); >           return ret.getSubscriberId(); >       } >       catch(MalformedURLException e) >       { >          System.err.println(e.toString()); >       } >    >       catch (ServiceException ex1) >       { >          System.err.println(ex1.toString()); >       } >       catch(RemoteException e) >       { >          System.err.println(e.toString()); >       } >       return ""; >    } >  > too >  > /* just encapsulating my client code */ >  > public void doAction(String arg0, ActionElementData actionData) throws > AudiumException >    { >       ActionElementConfig config = > actionData.getActionElementConfig(); >       >       String userid=config.getSettingValue("userid", actionData); >       String passwd=config.getSettingValue("passwd", actionData); >       String vendorid=config.getSettingValue("vendorid", > actionData); >       String vendorpw=config.getSettingValue("vendorpw", > actionData); >       >       String retVal = ""; >       String decision = "didntWork"; >       AsyncAuthenticationService svc = new > AsyncAuthenticationService();// put code in this class >       try{ >          retVal = > svc.authenticate(userid,passwd,vendorid,vendorpw); >          decision = "goodToGo"; >       } >       catch(MalformedURLException e) >       { >          decision = e.toString(); >       } >    >       catch (ServiceException ex1) >       { >          decision = ex1.toString(); >       } >       catch(RemoteException e) >       { >          decision = e.toString(); >       } >       catch(Exception e) >       { >          decision = e.toString(); >       } >       System.out.println("returned value: " + retVal); >       System.out.println("decision : " + decision); > >       svc = null; >       >       actionData.setSessionData("subscriberid",retVal); >    } >  > fixed my issue. > -- > To respond to this post, please click the following link: > > <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1319880> > > or simply reply to this email.
Subject: RE: Re: New Message from shane shifflett in Customer Voice Portal (CVP Replied by: Ranjana Narayan on 29-04-2009 09:45:42 AM Hi,
If the custom element( that implements ElementInterface) fails to load, it does not appear on the element pane. To identify the error make use of the Windows->Show View -> Call Studio Error logs pane which lists the runtime errors thrown while trying to load the custom element, the error message and the associated stacktrace should be helpful to figure out the problem.
Cheers! Ranjana.
Subject: RE: Re: New Message from shane shifflett in Customer Voice Portal (CVP Replied by: shane shifflett on 29-04-2009 09:01:52 PM Thanks for the suggestion. I did try this but it didn't reveal anything that would have helped me.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: