#34 Feature: Detailed Device Exporting

Many additional device properties are available to export. The previous
export configuration is remembered.
This commit is contained in:
Gary Sharp
2014-05-22 01:22:57 +10:00
parent 53ca13c7f4
commit 3fdb4f1053
54 changed files with 1750 additions and 397 deletions
+6 -1
View File
@@ -46,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BI\Job\LocationModes.cs" />
<Compile Include="Repository\Device\DeviceDecommissionReasons.cs" />
<Compile Include="Services\Authorization\IAuthorizationToken.cs" />
<Compile Include="Services\Authorization\IClaimNavigatorItem.cs" />
<Compile Include="Services\Authorization\IRoleToken.cs" />
@@ -100,6 +101,9 @@
<Compile Include="Repository\User\UserAttachment.cs" />
<Compile Include="Repository\User\UserDetail.cs" />
<Compile Include="Repository\User\AuthorizationRole.cs" />
<Compile Include="Services\Devices\Exporting\DeviceExportRecord.cs" />
<Compile Include="Services\Devices\Exporting\DeviceExportTypes.cs" />
<Compile Include="Services\Devices\Exporting\DeviceExportOptions.cs" />
<Compile Include="Services\Jobs\JobLists\JobLocationReference.cs" />
<Compile Include="Services\Jobs\JobLists\JobTableItemModel.cs" />
<Compile Include="Services\Jobs\JobLists\JobTableModel.cs" />
@@ -145,6 +149,7 @@
<Compile Include="UI\Config\Logging\ConfigLoggingTaskStatusModel.cs" />
<Compile Include="UI\Config\Organisation\ConfigOrganisationIndexModel.cs" />
<Compile Include="UI\Device\DeviceAddOfflineModel.cs" />
<Compile Include="UI\Device\DeviceExportModel.cs" />
<Compile Include="UI\Device\DeviceImportModel.cs" />
<Compile Include="UI\Device\DeviceImportReviewModel.cs" />
<Compile Include="UI\Device\DeviceIndexModel.cs" />
@@ -164,7 +169,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
+1 -18
View File
@@ -26,17 +26,9 @@ namespace Disco.Models.Repository
public string DeviceDomainId { get; set; }
public string AssignedUserId { get; set; }
public DateTime? LastNetworkLogonDate { get; set; }
// 2012-06-21 - Removed
//[StringLength(24)]
//public string CertificateStoreReference { get; set; }
public bool AllowUnauthenticatedEnrol { get; set; }
// Removed 2013-02-21 G#: Redundant - See DecommissionedDate
//public bool Active { get; set; }
// End Removed 2013-02-21
public DateTime CreatedDate { get; set; }
public DateTime? EnrolledDate { get; set; }
public DateTime? LastEnrolDate { get; set; }
@@ -55,6 +47,7 @@ namespace Disco.Models.Repository
public virtual IList<DeviceUserAssignment> DeviceUserAssignments { get; set; }
public virtual IList<DeviceDetail> DeviceDetails { get; set; }
public virtual IList<DeviceAttachment> DeviceAttachments { get; set; }
public virtual IList<DeviceCertificate> DeviceCertificates { get; set; }
[InverseProperty("DeviceSerialNumber")]
public virtual IList<Job> Jobs { get; set; }
@@ -92,15 +85,5 @@ namespace Disco.Models.Repository
return index < 0 ? null : DeviceDomainId.Substring(0, index);
}
}
public enum DecommissionReasons
{
EndOfLife = 0,
Sold = 10,
Stolen = 20,
Lost = 30,
Damaged = 40,
Donated = 50
}
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.Repository
{
public enum DecommissionReasons
{
EndOfLife = 0,
Sold = 10,
Stolen = 20,
Lost = 30,
Damaged = 40,
Donated = 50
}
}
@@ -9,6 +9,12 @@ namespace Disco.Models.Repository
{
public class DeviceDetail
{
public const string ScopeHardware = "Hardware";
public const string HardwareKeyLanMacAddress = "LanMacAddress";
public const string HardwareKeyWLanMacAddress = "WLanMacAddress";
public const string HardwareKeyACAdapter = "ACAdapter";
[Column(Order = 0), Key]
public string DeviceSerialNumber { get; set; }
@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.Services.Devices.Exporting
{
public class DeviceExportOptions
{
public DeviceExportTypes ExportType { get; set; }
public int? ExportTypeTargetId { get; set; }
// Device
[Display(ShortName = "Device", Name = "Serial Number", Description = "The device serial number")]
public bool DeviceSerialNumber { get; set; }
[Display(ShortName = "Device", Name = "Asset Number", Description = "The device asset number")]
public bool DeviceAssetNumber { get; set; }
[Display(ShortName = "Device", Name = "Location", Description = "The device location")]
public bool DeviceLocation { get; set; }
[Display(ShortName = "Device", Name = "Computer Name", Description = "The device computer name")]
public bool DeviceComputerName { get; set; }
[Display(ShortName = "Device", Name = "Last Network Logon", Description = "The last recorded time the device access the network")]
public bool DeviceLastNetworkLogon { get; set; }
[Display(ShortName = "Device", Name = "Created Date", Description = "The date the device was created in Disco")]
public bool DeviceCreatedDate { get; set; }
[Display(ShortName = "Device", Name = "First Enrolled Date", Description = "The date the device was first enrolled in Disco")]
public bool DeviceFirstEnrolledDate { get; set; }
[Display(ShortName = "Device", Name = "Last Enrolled Date", Description = "The date the device was last enrolled in Disco")]
public bool DeviceLastEnrolledDate { get; set; }
[Display(ShortName = "Device", Name = "Decommissioned Date", Description = "The date the device was decommissioned in Disco")]
public bool DeviceDecommissionedDate { get; set; }
[Display(ShortName = "Device", Name = "Decommissioned Reason", Description = "The reason the device was decommissioned")]
public bool DeviceDecommissionedReason { get; set; }
// Details
[Display(ShortName = "Details", Name = "LAN MAC Address", Description = "The LAN MAC Address associated with the device")]
public bool DetailLanMacAddress { get; set; }
[Display(ShortName = "Details", Name = "Wireless LAN MAC Address", Description = "The Wireless LAN MAC Address associated with the device")]
public bool DetailWLanMacAddress { get; set; }
[Display(ShortName = "Details", Name = "AC Adapter", Description = "The AC Adapter associated with the device")]
public bool DetailACAdapter { get; set; }
// Model
[Display(ShortName = "Model", Name = "Identifier", Description = "The identifier of the device model associated with the device")]
public bool ModelId { get; set; }
[Display(ShortName = "Model", Name = "Description", Description = "The description of the device model associated with the device")]
public bool ModelDescription { get; set; }
[Display(ShortName = "Model", Name = "Manufacturer", Description = "The manufacturer of the device model associated with the device")]
public bool ModelManufacturer { get; set; }
[Display(ShortName = "Model", Name = "Model", Description = "The model of the device model associated with the device")]
public bool ModelModel { get; set; }
[Display(ShortName = "Model", Name = "Type", Description = "The type of device model associated with the device")]
public bool ModelType { get; set; }
// Batch
[Display(ShortName = "Batch", Name = "Identifier", Description = "The identifier of the device batch associated with the device")]
public bool BatchId { get; set; }
[Display(ShortName = "Batch", Name = "Name", Description = "The name of the device batch associated with the device")]
public bool BatchName { get; set; }
[Display(ShortName = "Batch", Name = "Purchase Date", Description = "The purchase date of the device batch associated with the device")]
public bool BatchPurchaseDate { get; set; }
[Display(ShortName = "Batch", Name = "Supplier", Description = "The supplier of the device batch associated with the device")]
public bool BatchSupplier { get; set; }
[Display(ShortName = "Batch", Name = "Unit Cost", Description = "The unit cost of the device batch associated with the device")]
public bool BatchUnitCost { get; set; }
[Display(ShortName = "Batch", Name = "Warranty Valid Until Date", Description = "The warranty valid until date of the device batch associated with the device")]
public bool BatchWarrantyValidUntilDate { get; set; }
[Display(ShortName = "Batch", Name = "Insured Date", Description = "The insured date of the device batch associated with the device")]
public bool BatchInsuredDate { get; set; }
[Display(ShortName = "Batch", Name = "Insurance Supplier", Description = "The insurance supplier of the device batch associated with the device")]
public bool BatchInsuranceSupplier { get; set; }
[Display(ShortName = "Batch", Name = "Insured Until Date", Description = "The insured until date of the device batch associated with the device")]
public bool BatchInsuredUntilDate { get; set; }
// Profile
[Display(ShortName = "Profile", Name = "Identifier", Description = "The identifier of the device profile associated with the device")]
public bool ProfileId { get; set; }
[Display(ShortName = "Profile", Name = "Name", Description = "The name of the device profile associated with the device")]
public bool ProfileName { get; set; }
[Display(ShortName = "Profile", Name = "Short Name", Description = "The short name of the device profile associated with the device")]
public bool ProfileShortName { get; set; }
// User
[Display(ShortName = "Assigned User", Name = "Identifier", Description = "The identifier of the user assigned with the device")]
public bool AssignedUserId { get; set; }
[Display(ShortName = "Assigned User", Name = "Assigned Date", Description = "The date the device was assigned to the user")]
public bool AssignedUserDate { get; set; }
[Display(ShortName = "Assigned User", Name = "Display Name", Description = "The display name of the user assigned with the device")]
public bool AssignedUserDisplayName { get; set; }
[Display(ShortName = "Assigned User", Name = "Surname", Description = "The surname of the user assigned with the device")]
public bool AssignedUserSurname { get; set; }
[Display(ShortName = "Assigned User", Name = "Given Name", Description = "The given name of the user assigned with the device")]
public bool AssignedUserGivenName { get; set; }
[Display(ShortName = "Assigned User", Name = "Phone Number", Description = "The phone number of the user assigned with the device")]
public bool AssignedUserPhoneNumber { get; set; }
[Display(ShortName = "Assigned User", Name = "Email Address", Description = "The email address of the user assigned with the device")]
public bool AssignedUserEmailAddress { get; set; }
// Jobs
[Display(ShortName = "Jobs", Name = "Count", Description = "The total number of jobs associated with the device")]
public bool JobsTotalCount { get; set; }
[Display(ShortName = "Jobs", Name = "Count Open", Description = "The total number of open jobs associated with the device")]
public bool JobsOpenCount { get; set; }
// Attachments
[Display(ShortName = "Attachments", Name = "Count", Description = "The number of attachments associated with the device")]
public bool AttachmentsCount { get; set; }
// Certificates
[Display(ShortName = "Certificates", Name = "Name", Description = "The name of the most recently assigned active certificate associated with the device")]
public bool CertificateName { get; set; }
[Display(ShortName = "Certificates", Name = "Allocated Date", Description = "The allocated date of the most recently assigned active certificate associated with the device")]
public bool CertificateAllocatedDate { get; set; }
[Display(ShortName = "Certificates", Name = "Expiration Date", Description = "The expiration date of the most recently assigned active certificate associated with the device")]
public bool CertificateExpirationDate { get; set; }
[Display(ShortName = "Certificates", Name = "Provider Id", Description = "The provider identifier of the most recently assigned active certificate associated with the device")]
public bool CertificateProviderId { get; set; }
public static DeviceExportOptions DefaultOptions()
{
return new DeviceExportOptions()
{
ExportType = DeviceExportTypes.All,
DeviceSerialNumber = true,
ModelId = true,
ProfileId = true,
BatchId = true,
AssignedUserId = true,
DeviceLocation = true,
DeviceAssetNumber = true
};
}
}
}
@@ -0,0 +1,51 @@
using Disco.Models.Repository;
using System;
using System.Collections.Generic;
namespace Disco.Models.Services.Devices.Exporting
{
public class DeviceExportRecord
{
public Device Device { get; set; }
// Details
public IEnumerable<DeviceDetail> DeviceDetails { get; set; }
// Model
public int? ModelId { get; set; }
public string ModelDescription { get; set; }
public string ModelManufacturer { get; set; }
public string ModelModel { get; set; }
public string ModelType { get; set; }
// Batch
public int? BatchId { get; set; }
public string BatchName { get; set; }
public DateTime? BatchPurchaseDate { get; set; }
public string BatchSupplier { get; set; }
public decimal? BatchUnitCost { get; set; }
public DateTime? BatchWarrantyValidUntilDate { get; set; }
public DateTime? BatchInsuredDate { get; set; }
public string BatchInsuranceSupplier { get; set; }
public DateTime? BatchInsuredUntilDate { get; set; }
// Profile
public int ProfileId { get; set; }
public string ProfileName { get; set; }
public string ProfileShortName { get; set; }
// User
public DeviceUserAssignment DeviceUserAssignment { get; set; }
public User AssignedUser { get; set; }
// Jobs
public int JobsTotalCount { get; set; }
public int JobsOpenCount { get; set; }
// Attachments
public int AttachmentsCount { get; set; }
// Certificates
public DeviceCertificate DeviceCertificate { get; set; }
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Models.Services.Devices.Exporting
{
public enum DeviceExportTypes
{
All,
Batch,
Model,
Profile
}
}
@@ -0,0 +1,16 @@
using Disco.Models.Services.Devices.Exporting;
using System.Collections.Generic;
namespace Disco.Models.UI.Device
{
public interface DeviceExportModel : BaseUIModel
{
DeviceExportOptions Options { get; set; }
string DownloadExportSessionId { get; set; }
IEnumerable<KeyValuePair<int, string>> DeviceBatches { get; set; }
IEnumerable<KeyValuePair<int, string>> DeviceModels { get; set; }
IEnumerable<KeyValuePair<int, string>> DeviceProfiles { get; set; }
}
}