public GalleryWebAppStatus DownloadGalleryApplication(string id) { try { Log.WriteStart("'{0}' DownloadGalleryApplication", ProviderSettings.ProviderName); GalleryWebAppStatus result = WebProvider.DownloadGalleryApplication(id); Log.WriteEnd("'{0}' DownloadGalleryApplication", ProviderSettings.ProviderName); return(result); } catch (Exception ex) { Log.WriteError(String.Format("'{0}' DownloadGalleryApplication", ProviderSettings.ProviderName), ex); throw; } }
public void DownloadGalleryWebApplication() { SecurityContext.SetThreadPrincipal(UserId); // TaskManager.StartTask(WebAppGalleryController.TASK_MANAGER_SOURCE, "DOWNLOAD_WEB_APP", GalleryApp.Title); TaskManager.WriteParameter("Version", GalleryApp.Version); TaskManager.WriteParameter("Download URL", GalleryApp.DownloadUrl); TaskManager.WriteParameter("Author", GalleryApp.AuthorName); TaskManager.WriteParameter("Last Updated", GalleryApp.LastUpdated); TaskManager.WriteParameter("Web App ID", WebAppId); // try { // WebServer webServer = WebAppGalleryController.GetAssociatedWebServer(PackageId); // TaskManager.Write("Application package download has been started"); // GalleryWebAppStatus appStatus = webServer.DownloadGalleryApplication(WebAppId); // if (appStatus == GalleryWebAppStatus.Failed) { TaskManager.WriteError("Could not download application package requested"); TaskManager.WriteError("Please check WebsitePanel Server log for further information on this issue"); TaskManager.WriteParameter("Status returned", appStatus); return; } // TaskManager.Write("Application package download has been started successfully"); } catch (Exception ex) { TaskManager.WriteError(ex); } finally { // TaskManager.CompleteTask(); } }
public static GalleryWebAppStatus GetGalleryApplicationStatus(int packageId, string webAppId) { try { WebServer webServer = GetAssociatedWebServer(packageId); // if (!webServer.IsMsDeployInstalled()) { throw new ApplicationException(WAG_MODULE_NOT_AVAILABLE <StringResultObject>().ErrorCodes[0]); } // GalleryWebAppStatus appStatus = webServer.GetGalleryApplicationStatus(webAppId); // if (appStatus == GalleryWebAppStatus.NotDownloaded) { GalleryApplicationResult appResult = webServer.GetGalleryApplication(webAppId); // Start app download in new thread WebAppGalleryAsyncWorker async = new WebAppGalleryAsyncWorker(); async.GalleryApp = appResult.Value; async.WebAppId = webAppId; async.PackageId = packageId; async.UserId = SecurityContext.User.UserId; async.DownloadGalleryWebApplicationAsync(); // return(GalleryWebAppStatus.Downloading); } // return(appStatus); } catch (Exception ex) { Trace.TraceError(ex.StackTrace); // return(GalleryWebAppStatus.Failed); } }