Commit 0cb4cb15 authored by shubham's avatar shubham

Wrapping up modules. Now testing publishing

parent 400a0dbd
......@@ -75,7 +75,6 @@ namespace Personal_Insight.ComputeProduct
}
}
Console.WriteLine("sTOP HERE");
}
private void gather_AutoFills(String jsonText)
......
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Personal_Insight.ComputeProduct
{
class Classic_Sites
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<Site> siteList;
public Classic_Sites()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Classic Sites");
gatherData(googleProduct.ProductFolderPath);
}
private void gatherData(string productFolderPath)
{
siteList = new List<Site>();
string[] folders = Directory.GetDirectories(productFolderPath);
foreach(String folder in folders)
{
siteList.Add(new Site(getSiteName(folder)));
}
page.enterLog("Logged " + siteList.Count + " Classic Sites!");
}
public static String getSiteName(String pathName)
{
//TODO
// Add a try catch here
while (pathName.Contains("\\"))
{
int index = pathName.IndexOf("\\");
pathName = pathName.Substring(index + 1);
}
return pathName;
}
public class Site
{
public String siteName { get; set; }
public String siteURL { get; set; }
public Site(string siteName)
{
this.siteName = siteName;
this.siteURL = "https://sites.google.com/site/" + siteName;
}
}
}
}
using CsvHelper;
using CsvHelper.Configuration;
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Personal_Insight.ComputeProduct
{
class Cloud_Print
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<PrinterJobs> printerJobsList;
public List<Printer> printerList;
public Cloud_Print()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Cloud Print");
gatherData(googleProduct.ProductFolderPath);
}
private void gatherData(string productFolderPath)
{
String[] files = Directory.GetFiles(productFolderPath);
foreach(String file in files)
{
if(file.Contains("Jobs Metadata Takeout.csv"))
{
using (var reader = new StreamReader(file))
using (var csv = new CsvReader(reader))
{
csv.Configuration.RegisterClassMap<PrinterJobsClassMap>();
var records = csv.GetRecords<PrinterJobs>();
printerJobsList = records.ToList();
page.enterLog("Logged " + printerJobsList.Count + " print jobs!");
}
}
else if(file.Contains("Printers Metadata Takeout.csv"))
{
using (var reader = new StreamReader(file))
using (var csv = new CsvReader(reader))
{
csv.Configuration.RegisterClassMap<PrinterClassMap>();
var records = csv.GetRecords<Printer>();
printerList = records.ToList();
page.enterLog("Logged " + printerList.Count + " printers!");
}
}
}
}
public class Device
{
}
public class PrinterJobs
{
public string documenttitle { get; set; }
public string submissiondate { get; set; }
public string printername { get; set; }
public string printjobstatus { get; set; }
}
public class PrinterJobsClassMap : ClassMap<PrinterJobs>
{
public PrinterJobsClassMap()
{
Map(m => m.documenttitle).Name("document title");
Map(m => m.submissiondate).Name("submission date");
Map(m => m.printername).Name("printer name");
Map(m => m.printjobstatus).Name("print job status");
}
}
public class Printer
{
public string printername { get; set; }
public string ownername { get; set; }
public string owneremail { get; set; }
}
public class PrinterClassMap : ClassMap<Printer>
{
public PrinterClassMap()
{
Map(m => m.printername).Name("printer name");
Map(m => m.ownername).Name("owner name");
Map(m => m.owneremail).Name("owner email");
}
}
}
}
using CsvHelper;
using CsvHelper.Configuration;
using MixERP.Net.VCards;
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Personal_Insight.ComputeProduct
{
class Contacts
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<Contact> contactsList;
public Contacts()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Contacts");
gatherData(googleProduct.ProductFolderPath);
}
private void gatherData(string productFolderPath)
{
String[] dirs = Directory.GetDirectories(productFolderPath);
foreach(String dir in dirs)
{
if(dir.Contains("All Contacts"))
{
String[] files = Directory.GetFiles(dir);
foreach(String file in files)
{
if(file.Contains("All Contacts.csv"))
{
using (var reader = new StreamReader(file))
using (var csv = new CsvReader(reader))
{
csv.Configuration.RegisterClassMap<ContactClassMap>();
var records = csv.GetRecords<Contact>();
contactsList = records.ToList();
page.enterLog("Logged " + contactsList.Count + " Contacts!");
}
break;
}
}
}
}
}
public class Contact
{
public string Name { get; set; }
public string GivenName { get; set; }
public string AdditionalName { get; set; }
public string FamilyName { get; set; }
public string YomiName { get; set; }
public string GivenNameYomi { get; set; }
public string AdditionalNameYomi { get; set; }
public string FamilyNameYomi { get; set; }
public string NamePrefix { get; set; }
public string NameSuffix { get; set; }
public string Initials { get; set; }
public string Nickname { get; set; }
public string ShortName { get; set; }
public string MaidenName { get; set; }
public string Birthday { get; set; }
public string Gender { get; set; }
public string Location { get; set; }
public string BillingInformation { get; set; }
public string DirectoryServer { get; set; }
public string Mileage { get; set; }
public string Occupation { get; set; }
public string Hobby { get; set; }
public string Sensitivity { get; set; }
public string Priority { get; set; }
public string Subject { get; set; }
public string Notes { get; set; }
public string Language { get; set; }
public string Photo { get; set; }
public string GroupMembership { get; set; }
public string E_mail1_Type { get; set; }
public string E_mail1_Value { get; set; }
public string E_mail2_Type { get; set; }
public string E_mail2_Value { get; set; }
public string IM1_Type { get; set; }
public string IM1_Service { get; set; }
public string IM1_Value { get; set; }
public string Phone1_Type { get; set; }
public string Phone1_Value { get; set; }
public string Phone2_Type { get; set; }
public string Phone2_Value { get; set; }
public string Phone3_Type { get; set; }
public string Phone3_Value { get; set; }
public string Phone4_Type { get; set; }
public string Phone4_Value { get; set; }
public string Address1_Type { get; set; }
public string Address1_Formatted { get; set; }
public string Address1_Street { get; set; }
public string Address1_City { get; set; }
public string Address1_POBox { get; set; }
public string Address1_Region { get; set; }
public string Address1_PostalCode { get; set; }
public string Address1_Country { get; set; }
public string Address1_ExtendedAddress { get; set; }
public string Organization1_Type { get; set; }
public string Organization1_Name { get; set; }
public string Organization1_YomiName { get; set; }
public string Organization1_Title { get; set; }
public string Organization1_Department { get; set; }
public string Organization1_Symbol { get; set; }
public string Organization1_Location { get; set; }
public string Organization1_JobDescription { get; set; }
public string Website1_Type { get; set; }
public string Website1_Value { get; set; }
public string Event1_Type { get; set; }
public string Event1_Value { get; set; }
}
public class ContactClassMap : ClassMap<Contact>
{
public ContactClassMap()
{
Map(m => m.Name).Name("Name");
Map(m => m.GivenName).Name("Given Name");
Map(m => m.AdditionalName).Name("Additional Name");
Map(m => m.FamilyName).Name("Family Name");
Map(m => m.YomiName).Name("Yomi Name");
Map(m => m.GivenNameYomi).Name("Given Name Yomi");
Map(m => m.AdditionalNameYomi).Name("Additional Name Yomi");
Map(m => m.FamilyNameYomi).Name("Family Name Yomi");
Map(m => m.NamePrefix).Name("Name Prefix");
Map(m => m.NameSuffix).Name("Name Suffix");
Map(m => m.Initials).Name("Initials");
Map(m => m.Nickname).Name("Nickname");
Map(m => m.ShortName).Name("Short Name");
Map(m => m.MaidenName).Name("Maiden Name");
Map(m => m.Birthday).Name("Birthday");
Map(m => m.Gender).Name("Gender");
Map(m => m.Location).Name("Location");
Map(m => m.BillingInformation).Name("Billing Information");
Map(m => m.DirectoryServer).Name("Directory Server");
Map(m => m.Mileage).Name("Mileage");
Map(m => m.Occupation).Name("Occupation");
Map(m => m.Hobby).Name("Hobby");
Map(m => m.Sensitivity).Name("Sensitivity");
Map(m => m.Priority).Name("Priority");
Map(m => m.Subject).Name("Subject");
Map(m => m.Notes).Name("Notes");
Map(m => m.Language).Name("Language");
Map(m => m.Photo).Name("Photo");
Map(m => m.GroupMembership).Name("Group Membership");
Map(m => m.E_mail1_Type).Name("E-mail 1 - Type");
Map(m => m.E_mail1_Value).Name("E-mail 1 - Value");
Map(m => m.E_mail2_Type).Name("E-mail 2 - Type");
Map(m => m.E_mail2_Value).Name("E-mail 2 - Value");
Map(m => m.IM1_Type).Name("IM 1 - Type");
Map(m => m.IM1_Service).Name("IM 1 - Service");
Map(m => m.IM1_Value).Name("IM 1 - Value");
Map(m => m.Phone1_Type).Name("Phone 1 - Type");
Map(m => m.Phone1_Value).Name("Phone 1 - Value");
Map(m => m.Phone2_Type).Name("Phone 2 - Type");
Map(m => m.Phone2_Value).Name("Phone 2 - Value");
Map(m => m.Phone3_Type).Name("Phone 3 - Type");
Map(m => m.Phone3_Value).Name("Phone 3 - Value");
Map(m => m.Phone4_Type).Name("Phone 4 - Type");
Map(m => m.Phone4_Value).Name("Phone 4 - Value");
Map(m => m.Address1_Type).Name("Address 1 - Type");
Map(m => m.Address1_Formatted).Name("Address 1 - Formatted");
Map(m => m.Address1_Street).Name("Address 1 - Street");
Map(m => m.Address1_City).Name("Address 1 - City");
Map(m => m.Address1_POBox).Name("Address 1 - PO Box");
Map(m => m.Address1_Region).Name("Address 1 - Region");
Map(m => m.Address1_PostalCode).Name("Address 1 - Postal Code");
Map(m => m.Address1_Country).Name("Address 1 - Country");
Map(m => m.Address1_ExtendedAddress).Name("Address 1 - Extended Address");
Map(m => m.Organization1_Type).Name("Organization 1 - Type");
Map(m => m.Organization1_Name).Name("Organization 1 - Name");
Map(m => m.Organization1_YomiName).Name("Organization 1 - Yomi Name");
Map(m => m.Organization1_Title).Name("Organization 1 - Title");
Map(m => m.Organization1_Department).Name("Organization 1 - Department");
Map(m => m.Organization1_Symbol).Name("Organization 1 - Symbol");
Map(m => m.Organization1_Location).Name("Organization 1 - Location");
Map(m => m.Organization1_JobDescription).Name("Organization 1 - Job Description");
Map(m => m.Website1_Type).Name("Website 1 - Type");
Map(m => m.Website1_Value).Name("Website 1 - Value");
Map(m => m.Event1_Type).Name("Event 1 - Type");
Map(m => m.Event1_Value).Name("Event 1 - Value");
}
}
}
}
using Personal_Insight.Models;
using Personal_Insight.Pages;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Personal_Insight.ComputeProduct
{
class Drive
{
private GoogleProductModel googleProduct;
private IntroPage_5 page;
public GoogleProductModel GoogleProduct { get => googleProduct; set => googleProduct = value; }
public List<FileInfo> fileInfoList;
public Drive()
{
}
public void startWork(IntroPage_5 page)
{
this.page = page;
page.enterLog("Starting work on Drive");
gatherData(googleProduct.ProductFolderPath);
page.enterLog("Logged " + fileInfoList.Count + " files in Google Drive");
}
private void gatherData(string productFolderPath)
{
fileInfoList = new List<FileInfo>();
setUpList(new DirectoryInfo(productFolderPath));
}
public void setUpList(DirectoryInfo d)
{
try
{
// Add file sizes.
FileInfo[] fis = d.GetFiles();
foreach (FileInfo fi in fis)
{
if (!fileInfoList.Contains(fi))
{
fileInfoList.Add(fi);
}
}
// Add subdirectory sizes.
DirectoryInfo[] dis = d.GetDirectories();
foreach (DirectoryInfo di in dis)
{
setUpList(di);
}
}
catch (Exception e)
{
//Console.WriteLine("ERROR: {0} Exception caught.", e);
}
}
}
}
......@@ -24,6 +24,12 @@ namespace Personal_Insight.ComputeProduct
this.page = page;
page.enterLog("Starting work on YouTube");
gatherData(googleProduct.ProductFolderPath);
}
private void gatherData(string productFolderPath)
{
}
public class Device
......
......@@ -289,19 +289,27 @@ namespace Personal_Insight.Models
break;
case Contacts:
productObject = new Android_Device_Configuration_Service();
productObject = new Contacts();
((Contacts)productObject).GoogleProduct = googleProductModel;
((Contacts)productObject).startWork(page);
break;
case CP:
productObject = new Android_Device_Configuration_Service();
productObject = new Cloud_Print();
((Cloud_Print)productObject).GoogleProduct = googleProductModel;
((Cloud_Print)productObject).startWork(page);
break;
case CS:
productObject = new Android_Device_Configuration_Service();
productObject = new Classic_Sites();
((Classic_Sites)productObject).GoogleProduct = googleProductModel;
((Classic_Sites)productObject).startWork(page);
break;
case Drive:
productObject = new Android_Device_Configuration_Service();
productObject = new Drive();
((Drive)productObject).GoogleProduct = googleProductModel;
((Drive)productObject).startWork(page);
break;
case Fit:
......
<Page x:Class="Personal_Insight.Pages.Dashboard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Personal_Insight.Pages"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Dashboard">
<Grid>
</Grid>
</Page>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Personal_Insight.Pages
{
/// <summary>
/// Interaction logic for Dashboard.xaml
/// </summary>
public partial class Dashboard : Page
{
public Dashboard()
{
InitializeComponent();
}
}
}
......@@ -90,7 +90,6 @@ namespace Personal_Insight
if (takeoutCheck.Equals("Takeout"))
{
populateArrayList(path);
populateListBox(path);
}
else
{
......@@ -122,11 +121,6 @@ namespace Personal_Insight
isPopulated = true;
}
private void populateListBox(String path)
{
}
/*
* This method converts the path to a product name
*/
......
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ControlzEx" version="3.0.2.4" targetFramework="net472" />
<package id="CsvHelper" version="12.1.2" targetFramework="net472" />
<package id="DDay.iCal" version="1.0.2.575" targetFramework="net472" />
<package id="Galactic.Calendar" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.Calendar.iCalendar" version="1.3.0.499" targetFramework="net472" />
......@@ -8,15 +9,62 @@
<package id="Galactic.Cryptography" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.EventLog" version="1.3.0.499" targetFramework="net472" />
<package id="Galactic.FileSystem" version="1.3.0.499" targetFramework="net472" />
<package id="Hali4831.MixERP.Net.VCards" version="1.0.1" targetFramework="net472" />
<package id="Ical.Net" version="4.1.11" targetFramework="net472" />
<package id="MahApps.Metro" version="1.6.5" targetFramework="net472" />
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net472" />
<package id="MaterialDesignThemes" version="2.5.1" targetFramework="net472" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net472" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net472" />
<package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net472" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="NodaTime" version="2.0.2" targetFramework="net472" />
<package id="System.Reflection" version="4.1.0" targetFramework="net472" />
<package id="System.AppContext" version="4.3.0" targetFramework="net472" />
<package id="System.Collections" version="4.3.0" targetFramework="net472" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net472" />
<package id="System.Console" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net472" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net472" />
<package id="System.Globalization" version="4.3.0" targetFramework="net472" />
<package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net472" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net472" />
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Linq" version="4.3.0" targetFramework="net472" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Reflection.TypeExtensions" version="4.1.0" targetFramework="net472" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net472" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net472" />
<package id="System.Threading" version="4.3.0" targetFramework="net472" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net472" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net472" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net472" />
</packages>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment