cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
758
Views
0
Helpful
3
Replies

Missing Get Operations in InstalledLanguages of CUPI.NET

stephan.steiner
Spotlight
Spotlight

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;

        }

3 Replies 3

lindborg
Cisco Employee
Cisco Employee

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.

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.

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.

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: