cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Please note that Remote Expert Mobile announced end-of-life and support will end on February 28, 2022.
469
Views
0
Helpful
3
Replies
Highlighted
Rising star

Missing Get Operations in InstalledLanguages of CUPI.NET

Hi

I've had to extract installed languages from a  CUCN server.. and found that the InstalledLanguage object did not have a method to get all languages. So I've added this which extracts all languages using the same style as other object extractions. Any chance this could be added to the standard lib?

Thanks

public static WebCallResult GetInstalledLanguages(out List<InstalledLanguage> languages, ConnectionServerRest pConnectionServer)

        {

            WebCallResult res = new WebCallResult();

            res.Success = false;

            languages = null;

            if (pConnectionServer == null)

            {

                res.ErrorText = "Null Connection server object passed to GetInstalledLanguages";

                return res;

            }

            InstalledLanguage lang = null;

            try

            {

                lang = new InstalledLanguage(pConnectionServer);

                languages = lang.InstalledLanguages;

                res.Success = true;

            }

            catch (UnityConnectionRestException ex)

            {

                return ex.WebCallResult;

            }

            catch (Exception ex)

            {

                res.ErrorText = "Failed to fetch languages in GetInstalledLanguages:" + ex.Message;

                return res;

            }

            return res;

        }

Everyone's tags (2)
3 REPLIES 3
Highlighted
Cisco Employee

Re: Missing Get Operations in InstalledLanguages of CUPI.NET

sure, I can add this - several projects in the works right now for a couple teams but this is pretty light, I should be able to fit this in this week.

Highlighted
Cisco Employee

Re: Missing Get Operations in InstalledLanguages of CUPI.NET

actually, there is InstalledLanguages list as a public property off the InstalledLanguage class - when the class is built that list is populated out with all the languages found on the target server.  This is what's used for checking if a specific language is installed or not on that server for instance.

Highlighted
Rising star

Re: Missing Get Operations in InstalledLanguages of CUPI.NET

I noticed. However, since my code is redundant, the redundancy bit requires WebResult to return to determine whether to try sending the command to the secondary server. All objects I'm using so far other than InstalledLanguages have a way to extract that returns a WebResult so my redundancy code was built on that.