cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
630
Views
0
Helpful
8
Replies

Example webserver Gadget

ian.norfolk
Level 1
Level 1

Hi I am trying to request a xml permalink report data via the example Finesse 11 Web Service Example. I have simply edited the JS file and added my own URL however the script is appending a nocache=XXXXXX on the end of the report URL and this is not getting stripped off prior to CUIC trying to process the request so I am seeing the following error:

][product_name=CUICJava][subsystem_exception_info=][tid=http-bio-8444-exec-3648][version_number=CUICJava_11_5_1_0_0_0_98]: Information associated with the following logged exception

0000002318: 10.112.10.30: Jul 09 2018 10:44:50.590 +0100: %CCBU_CUIC_MODEL_OBJECTS-3-Permalink field validation error: %[ARGUMENT=nocache is not a valid report defintion field or field displayname]: Field validation failed

0000002319: 10.112.10.30: Jul 09 2018 10:44:50.590 +0100: %CCBU_CUIC_MODEL_OBJECTS-3-EXCEPTION: %[EXCEPTION=com.cisco.ccbu.cuic.CuicObjectNotFoundException: nocache]: There was an exception that occurred.

Anybody got ant suggestions?

1 Accepted Solution

Accepted Solutions

Hi Ian,

Are you talking about this gadget tick? https://developer.cisco.com/docs/finesse/#!finesse-container-timer/finesse-container-timer

If so, take a look at the WebexTeams sample gadget that uses it: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/WebexTeamsTeamAnnouncementsSampleGadget

Basically, the _timerTickHandler will be triggered every second. In this code, it is storing the last time (in epoch time) it updated the page and doing a calculation to call some set of code (requesting your stats) every _maxTimerCallbackThreshold. The _maxTimerCallbackThreshold is in milliseconds. So if you want it every 15 seconds, that would be 15000.

Thanx,

Denise

View solution in original post

8 Replies 8

dekwan
Cisco Employee
Cisco Employee

Hi Ian,

Are you trying to show the CUIC report? If so, I would suggest using the CUIC Sample Gadget instead : https://github.com/CiscoDevNet/finesse-sample-code/tree/master/CUICSampleGadget

In the code that you attached, I don't see anything that has nocache. I see it being commented out, so could it be that you are still loading a cached version when the nocache was not commented? I would suggest adding nocache to your desktop url (http://server/desktop?nocache) so that the latest is being loaded.


Also, I would suggest using the browser's developer tools to put a breakpoint and see what the gadget is sending for the url.


Thanx,

Denise

Hi Denise,

thanks for getting back to be. Ive used the example webservice as a starting point as I intent to parse the values in the response and update spans in the gadgets HTML. This will allow me to format the agent screen as the customer requires it.

I have commented out the nocache parameter as it was causing CUIC to throw the exception above and return the CUIC login page.

I have tried adding debugger; to my scripts is that what you meant.  Sorry Ive only done simple jQuery before as I mainly use c-sharp with visual studio. I cant even find the gadgets javascript and it seems to be within an iframe and then in some concatenated file. Im finding it fairly horrible experience working with this large javascript setup after visual studio to be honest :-(

Thanks,

Ian.

Hi Ian,

Ah, if you want to parse the values, then this is the right gadget.

When I say developer tools, I mean something like this: Chrome DevTools  |  Tools for Web Developers  |  Google Developers I personally find the chrome one to be the best because it is easier to find the gadget's javascript.

Thanx,

Denise

dekwan
Cisco Employee
Cisco Employee

Here is a screenshot of finding the js for the gadget.

Untitled 6.png

Using the chrome's developer's tool, go under Sources. You will see a bunch of finesse_gadget_* and hover over it. It will highlight which gadget it is (will be blue as seen in the screenshot). When it is the correct one, click into it to go to the gadgets folder. Then it is one of the three files that you see in there.

I hope that helps.

Thanx,

Denise

ian.norfolk
Level 1
Level 1

Hi Denise,

Thanks for the pointers, I've managed to get the Gadget 90% there. It makes the request now and parses the response and updated the field in the HTML after a button press so good progress. What Im now struggling with is how to insert the example  Boilerplate gadget tick code so I can schedule requesting the stat every 15 seconds.

Ive tried cut and pasting it in but it caused all sorts of errors. I think Im fundamentally not understanding the structure of the gadget code. I assumed it was a JavaScript class with variables, methods. Am I correct in that assumption? Is there an idiots guide you can point me at?

Many Thanks,

Ian.

Hi Ian,

Are you talking about this gadget tick? https://developer.cisco.com/docs/finesse/#!finesse-container-timer/finesse-container-timer

If so, take a look at the WebexTeams sample gadget that uses it: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/WebexTeamsTeamAnnouncementsSampleGadget

Basically, the _timerTickHandler will be triggered every second. In this code, it is storing the last time (in epoch time) it updated the page and doing a calculation to call some set of code (requesting your stats) every _maxTimerCallbackThreshold. The _maxTimerCallbackThreshold is in milliseconds. So if you want it every 15 seconds, that would be 15000.

Thanx,

Denise

Denise,

thanks for the assistance with my first Finesse Gadget job, I managed to get it working and deployed to the customers system. Bit of a learning curve going from small two page Javascripts projects supporting ASP.Net websites  to the sudo object orientate JavaScript project but once I learned how to debug my own code and the &nocache trick I was off!

Thanks,

Ian.

Hi Ian,

Glad that you got it working!

Thanx,

Denise