04-16-2019 01:51 PM
I am building Finesse Gadget and able to deploy and test the Gadget in Finesse. If anyone can answer this it will address one of my big challenges,
How can I validate the javascript File before porting it to the Finesse server? This will reduce me to stop the Tomcat service, login to finesse and verify the Gadget.
Solved! Go to Solution.
04-17-2019 11:44 AM - edited 04-17-2019 11:45 AM
Yes, I think this is what you're asking about. It does autocomplete based on your definitions.
For verification, I'd write some unit tests myself. It won't do that work for you!
04-23-2019 09:58 AM
It's plain javascript dev. As long as your files are in the right place then the IDE will pick them up. No projects to import or any extra setup steps needed.
Try it!
04-17-2019 09:25 AM
The best javascript IDE I've found is Visual Studio Code. It won't help validate any of the Finesse-specific issues you may see. But it is able to do test cases and deep syntax checking, with things like auto-complete and highlighting. What development environment have you been using?
In my experience you don't need to stop Tomcat just to deploy new gadget code. Just refresh the finesse page with the nocache parameter and it loads everything almost instantly.
04-17-2019 11:29 AM
Thanks for the response.
Using Visual Studio Code, were you able to add the Finesse Java Script API ? So that when you code the java script, you are get the auto-complete option ?
where you verify the Gadget java script file for any error before deploying in the Finesse.
04-17-2019 11:44 AM - edited 04-17-2019 11:45 AM
Yes, I think this is what you're asking about. It does autocomplete based on your definitions.
For verification, I'd write some unit tests myself. It won't do that work for you!
04-23-2019 09:16 AM
How did you added the Java Script API to the visual studio source code app for you to do auto populate ? I am not sure if Cisco have exposed any jar file or any files to add to any editor for auto fill / populate.
Curious to know. Always appreciate your response.
04-23-2019 09:58 AM
It's plain javascript dev. As long as your files are in the right place then the IDE will pick them up. No projects to import or any extra setup steps needed.
Try it!
10-03-2019 03:49 AM - edited 10-03-2019 03:56 AM
@Quigath wrote:It's plain javascript dev. As long as your files are in the right place then the IDE will pick them up. No projects to import or any extra setup steps needed.
Try it!
I'm just getting into this now and I can't get VSCode to see finesse.js or jquery.min.js.
Can you elaborate on the "right place" to have all the files for developing a gadget?
Well, after playing around a bit, I think I got it working in VSCode.
You need to add a file - jsconfig.json - to the root and add something like the following:
{ "compilerOptions": { "module": "commonjs", "target": "es6" }, "include": [ "desktop/assets/js/*" ] }
I mimicked the folder structure of the Finesse Desktop, but that can be ignored for this part.
I still think it's crap that there is no way to test or verify this live.
I also have no idea how you debug any of this while its running in a real environment. Would love an actual dev server or something from Cisco where you have access to the OS/App and can run VSCode directly on the box to test and develop.
10-03-2019 09:23 AM
I've been learning more about this process also. I didn't know about the json config file to point to another directory.
I had all my files in the same directory which let VSCode see them all as related and loads them up. See attached project screenshot.
As for live debugging, not having that has been a negative for me for a long time on all the cisco products.
10-03-2019 04:48 PM
There is a bunch of info here for JS in VSCode: https://code.visualstudio.com/docs/nodejs/working-with-javascript
I'm still new to JS development and so do not fully understand how it all is meant to hang together.
I was honestly hoping someone on here had a development workflow that I could learn from but the best I can tell its:
1) Write code locally. Hopefully with code completion. No way to execute it at all.
2) Use an SFTP app to push it to the Finesse server, maybe as a sync on save?
3) Run it with the no cache option on the finesse server.
4) When something doesn't work, write 1000 log statements and hope you catch what you need.
5) Repeat.
10-03-2019 04:57 PM
That's exactly what I do. It's a little painful but not too bad.
04-22-2019 02:11 PM
Hi,
@Quigath wrote:
In my experience you don't need to stop Tomcat just to deploy new gadget code. Just refresh the finesse page with the nocache parameter and it loads everything almost instantly.
I would like to confirm that thats correct where you can just use the nocache (https://developer.cisco.com/docs/finesse/#gadget-caching) option to avoid restarting tomcat. There isn't any other way to test out the gadget without loading it on the server.
Thanx,
Denise
04-22-2019 03:04 PM
Yes.
Not sure what the official/technical gadget deployment process should be, I'm just going with what works.
For reference, I have a dev lab for 11.6, with gadget files being hosted on an external Jetty server.
When I deploy a new gadget xml javascript or css file, I copy the files to my server, then If I wait for about a minute it usually picks up the new files but you can never be sure when. Then I discovered the nocache param and all my files load instantly on page refresh. I don't have to restart any services or even log my agent out. This works better on Chrome and unreliably on Firefox.
I saved the agent desktop link as a bookmark and hit it just after copying over the new code. https://[finesse]/desktop/container/?nocache
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide