public static PublishedApplication[] GetPublishedApplications(System.Security.Principal.WindowsIdentity user) { //Todo get published application from web service WebServiceAPI service = new WebServiceAPI(); WindowsIdentity usr = service.GetUser(user); // orig source // PublishedApplication[] apps = service.GetApplicationsByCredentials(usr, usr.UserName, "", new string[] { "defaults" }, new string[] { "all" }, new string[] { "all" }); PublishedApplication[] apps = null; try { apps = service.GetApplicationsByCredentials(usr, usr.UserName, "", new string[] { "defaults" }, new string[] { "all" }, new string[] { "all" }); } catch (Exception ex) { SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Extentrix", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, ex.Message, ex.StackTrace); Logger.Default.Error("An error occured during getting published applications", ex); } /*XmlDocument xmlDoc = new XmlDocument(); * xmlDoc.Load(SPContext.Current.Web.Url + "/_layouts/Images/ExtentrixWebIntrface/Applications.xml"); * string xml = xmlDoc.InnerXml; * List<PublishedApplication> appsList = Util.GetPublishedApplications(); * PublishedApplication[] apps = appsList.ToArray();*/ return(apps); }
public PublishedApplication[] getApplication(Credentials user) { PublishedApplication[] apps = null; string clientName = ""; if (ApplyDefaultClientName) { clientName = user.UserName; clientName = PrefixClientName + "_" + clientName.Replace('\\', '_'); } apps = service.GetApplicationsByCredentials(user, clientName, "", new string[] { "defaults" }, new string[] { "all" }, new string[] { "all" }); for (int i = 0; i < apps.Length; i++) { if (IconsManager.CheckLargeIcon(apps[i].IconFileName, IconsExpirationPeriod)) { apps[i].LargeIcon = apps[i].IconFileName; } if (IconsManager.CheckSmallIcon(apps[i].IconFileName, IconsExpirationPeriod)) { apps[i].SmallIcon = apps[i].IconFileName; } } return(apps); }