cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1658
Views
1
Helpful
18
Replies

Custom "math" CVP CallStudio element.

e.gailiss
Enthusiast
Enthusiast

I'm trying to create custom element for CallStudio. Something along the lines of built-in math element. It has to have some parameters and a button to open simple editor where I can enter multiple lines of text.

Dealing with parameters is easy, but I couldn't find any examples how to do this "button to open additional editor window". Can anyone point me to any samples?

Thank you!

Ervins

18 Replies 18

Janine, Hemal,

I think I'm not clear enough in explaining the problem.

If I leave orignal textfield in CallStudio containing {} then I get exception when my application is run. Even in debugger. It validates fine, loads fine, just is not able to start.

For example. I have "matrix" setting like this:  { some, text, in, curly, crackets }

When I try to run my app, I get this exception in the global error log:

04/08/2015 17:00:42.542, SERVER ERROR: An error occurred while loading application 'VMXLTest'.

com.audium.server.xml.ElementConfigException: There was an error evaluating substitution for the setting named 'JavaScript'.

...

...

Caused by: com.audium.server.xml.SubstitutionException: The substitute index specified does not match any subtitute elements in the XML file.  The index specified was  some, text, in, curly, crackets .

  at com.audium.server.xml.SubstitutionConfig.parseSubstitution(SubstitutionConfig.java:126)

  at com.audium.server.xml.ElementConfig.addSettingValue(ElementConfig.java:277)

So, the solution would be to replace {} with some other text like <<< and >>>, for example.

OK. In my doAction I can just do replacement of <<< >>> to { } like:

String matrixString = (String) conf.getSettingValue(MX_STRING, data);

matrixString = matrixString.replaceAll("<<<", "{");

matrixString = matrixString.replaceAll(">>>", "}");

This far is fine, but where do i do replacement from {} to <<<>>> ?

I would like this replacement to be dome automatically. Like, user enters text with {} in textfield in CallStudio interface, but it is saved as text containing <<<>>>. Then I can just do my doAction stuff and all is fine.

Hopefully I got the situation explained clear enough. Sorry for long post.

Ervins

No, the idea is that the user doesn't enter { } - that they learn to use

a different key for that (maybe square brackets instead).

Then in the doAction you convert square brackets into braces.

All of this can built in the logic in the action class using java regex, string replacement etc. What exactly is the application business wise that you are trying to build ?

Hemal

Hemal,

The element I'm trying to build is for self-service application.

Customer will generate a martix of data using their in-house application and copy/paste it into CallStudio. Add some more parameters and using this matrix some menu options and voice prompts will be generated.

I doubt that they will change in-house app for me as the output is used elsewhere as well. The output actually is several hundred lines, so I would prefer not adding extra manipulations (like replacing {} before copy/pasting. That's why I'm trying to do input preparation in CallStudio, in input dialog.

To be honest, my plan is to actually not replace {} with something in CallStudio, but do some kind of encoding of the whole input string - URLencode, uuencode or something. And in doAction do decode. This will guarantee, that if in future additional data crops up input, I don't get surprises from substtitution.

Ervins

Getting Started

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:

Recognize Your Peers