From 98f35213c836456ad9991e3c19b7f3b969281e32 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 3 Mar 2018 10:56:25 +0100 Subject: [PATCH] Aggiunta pagina UpdMan + script sql x update... --- CMS_SC/UpdMan.aspx | 31 +++++++++++ CMS_SC/UpdMan.aspx.cs | 74 ++++++++++++++++++++++++- CMS_SC/UpdMan.aspx.designer.cs | 45 +++++++++++---- CMS_SC/Web.CMS.config | 2 +- CMS_SC/Web.IIS01.config | 1 + CMS_SC/Web.IIS02.config | 1 + CMS_SC/Web.config | 3 + CMS_SC/WebUserControls/mod_testata.ascx | 3 + CMS_SC/bin/CMS_SC.dll.config | 5 +- CMS_SC/sql/Update_3.2.sql | 13 +++++ Jenkinsfile | 2 +- 11 files changed, 166 insertions(+), 14 deletions(-) create mode 100644 CMS_SC/sql/Update_3.2.sql diff --git a/CMS_SC/UpdMan.aspx b/CMS_SC/UpdMan.aspx index a3c9848..39acd75 100644 --- a/CMS_SC/UpdMan.aspx +++ b/CMS_SC/UpdMan.aspx @@ -1,7 +1,38 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Bootstrap.Master" AutoEventWireup="true" CodeBehind="UpdMan.aspx.cs" Inherits="CMS_SC.UpdMan" %> + + +
+
+
+
+

SteamWare's CMS-SC

+
+
+
+
+
+

Gestione Update pacchetti - Ultime release applicazioni.

+
+
+

ALL

+ LATEST VERS +
+
+

CMS-SC

+ <%: Version("CMS_SC") %> +
+
+
+
+ +
+
+
+
+
diff --git a/CMS_SC/UpdMan.aspx.cs b/CMS_SC/UpdMan.aspx.cs index 7480702..3e068e5 100644 --- a/CMS_SC/UpdMan.aspx.cs +++ b/CMS_SC/UpdMan.aspx.cs @@ -1,5 +1,7 @@ -using System; +using SteamWare; +using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Web; using System.Web.UI; @@ -13,5 +15,75 @@ namespace CMS_SC { } + /// + /// Eseguo download pacchetti secondo richeista + /// + /// + /// + protected void lbtDownload_Click(object sender, EventArgs e) + { + LinkButton lnk = (LinkButton)sender; + string caller = lnk.CommandArgument; + string resultsMsg = ""; + // in base al caller scarico il file installazione richiesto... + if (caller == null) + { + caller = "ALL"; + } + // ora verifico COSA devo scaricare... + if (updateUrl(caller) != "") + { + // se è ALL scarico tutti... + if (caller == "ALL") + { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + int done = 0; + // scarico TUTTI... + done += UpdateMan.obj.downloadLatest(updateUrl("CMS_SC"), localDownloadPath("CMS_SC"), "CMS_SC"); + stopWatch.Stop(); + // calcolo elapsed time come TimeSpan value. + TimeSpan ts = stopWatch.Elapsed; + resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds); + } + else + { + // scarico singolo target... + UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller); + resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller)); + } + } + // aggiorno messaggio + lblOut.Text = resultsMsg; + } + + public string Version(object package) + { + string answ = "a.b.c.d"; + UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs(); + // Recupero info ADM... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl(package.ToString())); + if (updArgs.IsUpdateAvailable) + { + answ = updArgs.CurrentVersion.ToString(); + } + return answ; + } + + /// + /// URLK stringa di UPDATE... + /// + protected string updateUrl(string package) + { + return string.Format("http://seriate.steamware.net:8083/SWS/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers")); + } + + /// + /// Path locale dove scaricare gli installer + /// + protected string localDownloadPath(string package) + { + return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers")); + } } } \ No newline at end of file diff --git a/CMS_SC/UpdMan.aspx.designer.cs b/CMS_SC/UpdMan.aspx.designer.cs index fb263a5..01b98c2 100644 --- a/CMS_SC/UpdMan.aspx.designer.cs +++ b/CMS_SC/UpdMan.aspx.designer.cs @@ -1,17 +1,42 @@ //------------------------------------------------------------------------------ -// +// // Codice generato da uno strumento. // // Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se -// il codice viene rigenerato. -// +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace CMS_SC -{ - - - public partial class UpdMan - { - } +namespace CMS_SC { + + + public partial class UpdMan { + + /// + /// Controllo lbtDownloadAll. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtDownloadAll; + + /// + /// Controllo lbtDownloadCMSSC. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtDownloadCMSSC; + + /// + /// Controllo lblOut. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblOut; + } } diff --git a/CMS_SC/Web.CMS.config b/CMS_SC/Web.CMS.config index 23e8841..51a6ade 100644 --- a/CMS_SC/Web.CMS.config +++ b/CMS_SC/Web.CMS.config @@ -18,7 +18,7 @@ - + diff --git a/CMS_SC/Web.IIS01.config b/CMS_SC/Web.IIS01.config index 817ae52..2894f4c 100644 --- a/CMS_SC/Web.IIS01.config +++ b/CMS_SC/Web.IIS01.config @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/CMS_SC/Web.IIS02.config b/CMS_SC/Web.IIS02.config index 817ae52..2894f4c 100644 --- a/CMS_SC/Web.IIS02.config +++ b/CMS_SC/Web.IIS02.config @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/CMS_SC/Web.config b/CMS_SC/Web.config index 49b5631..f822f32 100644 --- a/CMS_SC/Web.config +++ b/CMS_SC/Web.config @@ -32,6 +32,9 @@ + + + diff --git a/CMS_SC/WebUserControls/mod_testata.ascx b/CMS_SC/WebUserControls/mod_testata.ascx index 71652f8..b61362f 100644 --- a/CMS_SC/WebUserControls/mod_testata.ascx +++ b/CMS_SC/WebUserControls/mod_testata.ascx @@ -93,6 +93,9 @@ <%: traduci("UserAdmin") %> <%: traduci("UpdateVoc") %> + + <%: traduci("UpdMan") %> + <%: traduci("About") %> diff --git a/CMS_SC/bin/CMS_SC.dll.config b/CMS_SC/bin/CMS_SC.dll.config index 4eeac82..523ed8f 100644 --- a/CMS_SC/bin/CMS_SC.dll.config +++ b/CMS_SC/bin/CMS_SC.dll.config @@ -32,6 +32,9 @@ + + + @@ -59,7 +62,7 @@ - + diff --git a/CMS_SC/sql/Update_3.2.sql b/CMS_SC/sql/Update_3.2.sql new file mode 100644 index 0000000..53d9dd9 --- /dev/null +++ b/CMS_SC/sql/Update_3.2.sql @@ -0,0 +1,13 @@ +-- Update x nuovi permessi (pagine About e UpdMan) +INSERT INTO [dbo].[Permessi]([COD_PERMESSO],[URL],[GRUPPO],[NUMERO],[NOME],[DESCRIZIONE]) +VALUES ('Settings_UpdMan','UpdMan',4,5,'UpdMan','UpdManIcon') +INSERT INTO [dbo].[Permessi]([COD_PERMESSO],[URL],[GRUPPO],[NUMERO],[NOME],[DESCRIZIONE]) +VALUES ('Settings_About','About',4,6,'About','AboutIcon') + +INSERT INTO [dbo].[Permessi2Funzione] ([COD_PERMESSO],[COD_FUNZIONE],[READWRITE]) +VALUES ('Settings_UpdMan','SuperAdmin','S') +INSERT INTO [dbo].[Permessi2Funzione] ([COD_PERMESSO],[COD_FUNZIONE],[READWRITE]) +VALUES ('Settings_About','SuperAdmin','S') + + + diff --git a/Jenkinsfile b/Jenkinsfile index d2322af..63a350a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=4225']) { + withEnv(['NEXT_BUILD_NUMBER=4227']) { // env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'CMS-SC'