cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2119
Views
0
Helpful
11
Replies

Finesse Gadget Development - Startup

Mnagoorghani
Level 1
Level 1

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. 

 

2 Accepted Solutions

Accepted Solutions

Yes, I think this is what you're asking about. It does autocomplete based on your definitions.

autocomplete.png

 

 

 

 

 

For verification, I'd write some unit tests myself. It won't do that work for you!

View solution in original post

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!

View solution in original post

11 Replies 11

Quigath
Spotlight
Spotlight

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.

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.

Yes, I think this is what you're asking about. It does autocomplete based on your definitions.

autocomplete.png

 

 

 

 

 

For verification, I'd write some unit tests myself. It won't do that work for you!

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.

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!


@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.

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.

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.

That's exactly what I do. It's a little painful but not too bad.

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

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

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: