Skip to content

Commit

Permalink
feat: changed the id to a new guid
Browse files Browse the repository at this point in the history
  • Loading branch information
Airam Hernández Hernández committed Aug 2, 2023
1 parent 59d8b58 commit 49ee1b4
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 6 deletions.
3 changes: 3 additions & 0 deletions DNNPulse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<Reference Include="DotNetNuke, Version=9.12.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.Core.9.12.0\lib\net45\DotNetNuke.dll</HintPath>
</Reference>
<Reference Include="DotNetNuke.Abstractions, Version=9.12.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.Abstractions.9.12.0\lib\netstandard2.0\DotNetNuke.Abstractions.dll</HintPath>
</Reference>
<Reference Include="DotNetNuke.DependencyInjection, Version=9.12.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DotNetNuke.DependencyInjection.9.12.0\lib\netstandard2.0\DotNetNuke.DependencyInjection.dll</HintPath>
</Reference>
Expand Down
4 changes: 2 additions & 2 deletions DNNPulse.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DNNPulse" type="Module" version="01.04.00">
<package name="DNNPulse" type="Module" version="01.05.00">
<friendlyName>DNNPulse</friendlyName>
<description>intelequia.com DNNPulse module</description>
<iconFile>~/Images/icon_extensions_32px.png</iconFile>
Expand Down Expand Up @@ -51,7 +51,7 @@
<attributes>
<businessControllerClass>Intelequia.Modules.DNNPulse.Components.FeatureController, DNNPulse</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<upgradeVersionsList>01.04.00</upgradeVersionsList>
<upgradeVersionsList>01.05.00</upgradeVersionsList>
</attributes>
</eventMessage>
</component>
Expand Down
3 changes: 2 additions & 1 deletion Model/JsonBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class Properties
public string[] portalAliases { get; set; }
public string databaseSize { get; set; }
public string databaseType { get; set; }
public string id { get; set; }
public string dnnPulseGuid { get; set; }
public string firstAlias { get; set; }
}

public class Module
Expand Down
5 changes: 3 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
// Build Number
// Revision
//
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("01.04.00.00")]
[assembly: AssemblyFileVersion("01.04.00.00")]
[assembly: AssemblyVersion("01.05.00.00")]
[assembly: AssemblyFileVersion("01.05.00.00")]
6 changes: 6 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,11 @@
</p>
<p>Added new features:
- Azure Database information now works properly.
<br /><br /></p>
<p class="Owner">
<b>Version 1.5.0</b>
</p>
<p>Added new features:
- Now creates a GUID that can be used as the ID.
<br /><br /></p>
</div>
13 changes: 12 additions & 1 deletion Tasks/PulseTask.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Controllers;
using DotNetNuke.Services.Scheduling;
using DotNetNuke.Abstractions.Application;
using Intelequia.Modules.DNNPulse.Components;
using Intelequia.Modules.DNNPulse.Model;
using Newtonsoft.Json;
Expand All @@ -15,6 +17,7 @@ namespace Intelequia.Modules.DNNPulse.Tasks
{
public class PulseTask : SchedulerClient
{

public PulseTask(ScheduleHistoryItem item) : base()
{
this.ScheduleHistoryItem = item;
Expand Down Expand Up @@ -78,14 +81,22 @@ public static JsonBase GetMappedJsonBase(Model.DNNPulse dnnPulse)
string iKey = Config.GetSetting("DNNPulse.Ikey") ?? "779b1f91-d2d6-4f5c-850a-4fb3bd0f5382";
string name = Config.GetSetting("DNNPulse.Name") ?? "Microsoft.ApplicationInsights.779b1f91d2d64f5c850a4fb3bd0f5382.Event";
string time = DateTime.UtcNow.ToString("MM/dd/yyyy hh:mm:ss tt");
string dnnPulseGuid = HostController.Instance.GetString("DNNPulseGUID");
if (dnnPulseGuid == null || dnnPulseGuid == "")
{
HostController.Instance.Update("DNNPulseGUID", Guid.NewGuid().ToString(), true);
dnnPulseGuid = HostController.Instance.GetString("DNNPulseGUID");
}

List<Module> jsonModules = new List<Module>();
Properties jsonProperties = new Properties
{
DNNVersion = dnnPulse.DNNVersion,
databaseSize = dnnPulse.DatabaseSize,
databaseType = dnnPulse.DatabaseTier,
portalAliases = dnnPulse.PortalAlias.ToArray(),
id = dnnPulse.PortalAlias.FirstOrDefault()
dnnPulseGuid = dnnPulseGuid,
firstAlias = dnnPulse.PortalAlias.FirstOrDefault(),
};
for (int cont = 0; cont < dnnPulse.ModulesName.Count; cont++)
{
Expand Down
1 change: 1 addition & 0 deletions packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<packages>
<package id="Azure.Core" version="1.22.0" targetFramework="net472" />
<package id="Azure.Monitor.Query" version="1.1.0" targetFramework="net472" />
<package id="DotNetNuke.Abstractions" version="9.12.0" targetFramework="net472" />
<package id="DotNetNuke.Core" version="9.12.0" targetFramework="net472" />
<package id="DotNetNuke.DependencyInjection" version="9.12.0" targetFramework="net472" />
<package id="DotNetNuke.Instrumentation" version="9.12.0" targetFramework="net472" />
Expand Down
4 changes: 4 additions & 0 deletions web.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
Expand Down

0 comments on commit 49ee1b4

Please sign in to comment.