diff --git a/.gitignore b/.gitignore index d4c9afcf..a6479df5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,44 @@ tree/master/cloud/src/solution/*/bin tree/master/cloud/src/solution/*/obj tree/master/cloud/src/solution/*/pkg/ tree/master/cloud/src/solution/*/pkgobj/ +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/node_modules +/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/Properties/PublishProfiles +/tree/master/cloud/src/solution/UpgradeLog2.htm +/tree/master/cloud/src/solution/packages +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/artifacts/bin/Microsoft.Legal.MatterCenter.Models/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/artifacts/bin/Microsoft.Legal.MatterCenter.Repository/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/artifacts/bin/Microsoft.Legal.MatterCenter.Utility/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/obj/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/bin/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/obj/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/bin/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/bin/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/obj/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/.vs/config +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/bin/Release/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Release/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/bin/Release/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/obj/Release/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/wwwroot/css +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/bin/Debug/net451 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/obj/Debug/net451 +/tree/master/cloud/src/solution/TestResults +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/npm-debug.log +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/bin/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/bin/Debug/net46/win7-x64 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/bin/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/bin/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/obj/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/obj/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/bin/Release/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Release/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/bin/Release/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/obj/Release/net46 +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/wwwroot/app/config.js +/tree/master/cloud/src/solution/UpgradeLog4.htm +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/lib +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/wwwroot/lib +/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/wwwroot/js/site.min.js diff --git a/tree/master/cloud/docs/Matter Center Build and Deployment Guide.docx b/tree/master/cloud/docs/Matter Center Build and Deployment Guide.docx index 491fdfee..11696450 100644 Binary files a/tree/master/cloud/docs/Matter Center Build and Deployment Guide.docx and b/tree/master/cloud/docs/Matter Center Build and Deployment Guide.docx differ diff --git a/tree/master/cloud/docs/Matter Center Technical Specification.docx b/tree/master/cloud/docs/Matter Center Technical Specification.docx deleted file mode 100644 index 2d835d6e..00000000 Binary files a/tree/master/cloud/docs/Matter Center Technical Specification.docx and /dev/null differ diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/.vs/Microsoft.Legal.MatterCenter.HelperUtilities/v14/.suo b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/.vs/Microsoft.Legal.MatterCenter.HelperUtilities/v14/.suo index 319f4afa..0ad7a839 100644 Binary files a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/.vs/Microsoft.Legal.MatterCenter.HelperUtilities/v14/.suo and b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/.vs/Microsoft.Legal.MatterCenter.HelperUtilities/v14/.suo differ diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.CreateSampleData/App.config b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.CreateSampleData/App.config index 74ee21e1..74612a47 100644 --- a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.CreateSampleData/App.config +++ b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.CreateSampleData/App.config @@ -20,6 +20,7 @@ + diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.HelperUtilities.sln b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.HelperUtilities.sln deleted file mode 100644 index c7fe95fb..00000000 --- a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.HelperUtilities.sln +++ /dev/null @@ -1,157 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.Common", "Microsoft.Legal.MatterCenter.Common\Microsoft.Legal.MatterCenter.Common.csproj", "{2E35130D-BE31-4368-AC4D-1E3216ADF13F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.ConfigureLists", "Microsoft.Legal.MatterCenter.ConfigureLists\Microsoft.Legal.MatterCenter.ConfigureLists.csproj", "{5F89E8C3-C780-40A3-8A33-E0990107E61B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateContentTypes", "Microsoft.Legal.MatterCenter.CreateContentTypes\Microsoft.Legal.MatterCenter.CreateContentTypes.csproj", "{A14E9EC0-BFEF-4183-A4E6-3666C5018F05}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateGroups", "Microsoft.Legal.MatterCenter.CreateGroups\Microsoft.Legal.MatterCenter.CreateGroups.csproj", "{E7766CAC-CC79-4823-8BB4-01FEB3E5313E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateSampleData", "Microsoft.Legal.MatterCenter.CreateSampleData\Microsoft.Legal.MatterCenter.CreateSampleData.csproj", "{D421CE3D-8156-466D-8A68-2E5AB0BB81ED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateSiteCollection", "Microsoft.Legal.MatterCenter.CreateSiteCollection\Microsoft.Legal.MatterCenter.CreateSiteCollection.csproj", "{369E3583-8614-49CE-AF69-C055BA1DCD3A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateTerm", "Microsoft.Legal.MatterCenter.CreateTerm\Microsoft.Legal.MatterCenter.CreateTerm.csproj", "{047ACCD4-35C6-4E6E-9AD1-B7C7EE87E122}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.CreateSiteColumns", "Microsoft.Legal.MatterCenter.CreateSiteColumns\Microsoft.Legal.MatterCenter.CreateSiteColumns.csproj", "{741CE89E-37CD-4245-AC52-B1D0E16FF53E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.ProvisionWebDashboard", "Microsoft.Legal.MatterCenter.ProvisionWebDashboard\Microsoft.Legal.MatterCenter.ProvisionWebDashboard.csproj", "{BFA9FB3A-D256-4ECA-BC07-1009F19DEAD6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UpdateAppConfig", "Microsoft.Legal.MatterCenter.UpdateAppConfig\Microsoft.Legal.MatterCenter.UpdateAppConfig.csproj", "{862522F4-9838-41C2-827D-CFAB8676C74A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UpdateListPermissions", "Microsoft.Legal.MatterCenter.UpdateListPermissions\Microsoft.Legal.MatterCenter.UpdateListPermissions.csproj", "{35E35662-0A3D-48C8-B5A9-DAFEE5021179}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UpdateLists", "Microsoft.Legal.MatterCenter.UpdateLists\Microsoft.Legal.MatterCenter.UpdateLists.csproj", "{0A9458F7-FFDF-4A50-ABAC-85267ECD0D37}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UpdateTaxonomyFields", "Microsoft.Legal.MatterCenter.UpdateTaxonomyFields\Microsoft.Legal.MatterCenter.UpdateTaxonomyFields.csproj", "{BF3DD4EC-137C-4494-BED9-F19F592237C8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UpdateView", "Microsoft.Legal.MatterCenter.UpdateView\Microsoft.Legal.MatterCenter.UpdateView.csproj", "{4A74259B-DC46-4D9B-842B-ECC337717E19}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Legal.MatterCenter.UploadFile", "Microsoft.Legal.MatterCenter.UploadFile\Microsoft.Legal.MatterCenter.UploadFile.csproj", "{50CEB765-B476-45CE-9447-50526EEABBDA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2E35130D-BE31-4368-AC4D-1E3216ADF13F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E35130D-BE31-4368-AC4D-1E3216ADF13F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E35130D-BE31-4368-AC4D-1E3216ADF13F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E35130D-BE31-4368-AC4D-1E3216ADF13F}.Release|Any CPU.Build.0 = Release|Any CPU - {5F89E8C3-C780-40A3-8A33-E0990107E61B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F89E8C3-C780-40A3-8A33-E0990107E61B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F89E8C3-C780-40A3-8A33-E0990107E61B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F89E8C3-C780-40A3-8A33-E0990107E61B}.Release|Any CPU.Build.0 = Release|Any CPU - {A14E9EC0-BFEF-4183-A4E6-3666C5018F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A14E9EC0-BFEF-4183-A4E6-3666C5018F05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A14E9EC0-BFEF-4183-A4E6-3666C5018F05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A14E9EC0-BFEF-4183-A4E6-3666C5018F05}.Release|Any CPU.Build.0 = Release|Any CPU - {E7766CAC-CC79-4823-8BB4-01FEB3E5313E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7766CAC-CC79-4823-8BB4-01FEB3E5313E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7766CAC-CC79-4823-8BB4-01FEB3E5313E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7766CAC-CC79-4823-8BB4-01FEB3E5313E}.Release|Any CPU.Build.0 = Release|Any CPU - {D421CE3D-8156-466D-8A68-2E5AB0BB81ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D421CE3D-8156-466D-8A68-2E5AB0BB81ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D421CE3D-8156-466D-8A68-2E5AB0BB81ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D421CE3D-8156-466D-8A68-2E5AB0BB81ED}.Release|Any CPU.Build.0 = Release|Any CPU - {369E3583-8614-49CE-AF69-C055BA1DCD3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {369E3583-8614-49CE-AF69-C055BA1DCD3A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {369E3583-8614-49CE-AF69-C055BA1DCD3A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {369E3583-8614-49CE-AF69-C055BA1DCD3A}.Release|Any CPU.Build.0 = Release|Any CPU - {047ACCD4-35C6-4E6E-9AD1-B7C7EE87E122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {047ACCD4-35C6-4E6E-9AD1-B7C7EE87E122}.Debug|Any CPU.Build.0 = Debug|Any CPU - {047ACCD4-35C6-4E6E-9AD1-B7C7EE87E122}.Release|Any CPU.ActiveCfg = Release|Any CPU - {047ACCD4-35C6-4E6E-9AD1-B7C7EE87E122}.Release|Any CPU.Build.0 = Release|Any CPU - {741CE89E-37CD-4245-AC52-B1D0E16FF53E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {741CE89E-37CD-4245-AC52-B1D0E16FF53E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {741CE89E-37CD-4245-AC52-B1D0E16FF53E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {741CE89E-37CD-4245-AC52-B1D0E16FF53E}.Release|Any CPU.Build.0 = Release|Any CPU - {BFA9FB3A-D256-4ECA-BC07-1009F19DEAD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BFA9FB3A-D256-4ECA-BC07-1009F19DEAD6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BFA9FB3A-D256-4ECA-BC07-1009F19DEAD6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BFA9FB3A-D256-4ECA-BC07-1009F19DEAD6}.Release|Any CPU.Build.0 = Release|Any CPU - {862522F4-9838-41C2-827D-CFAB8676C74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {862522F4-9838-41C2-827D-CFAB8676C74A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {862522F4-9838-41C2-827D-CFAB8676C74A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {862522F4-9838-41C2-827D-CFAB8676C74A}.Release|Any CPU.Build.0 = Release|Any CPU - {35E35662-0A3D-48C8-B5A9-DAFEE5021179}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35E35662-0A3D-48C8-B5A9-DAFEE5021179}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35E35662-0A3D-48C8-B5A9-DAFEE5021179}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35E35662-0A3D-48C8-B5A9-DAFEE5021179}.Release|Any CPU.Build.0 = Release|Any CPU - {0A9458F7-FFDF-4A50-ABAC-85267ECD0D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A9458F7-FFDF-4A50-ABAC-85267ECD0D37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A9458F7-FFDF-4A50-ABAC-85267ECD0D37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A9458F7-FFDF-4A50-ABAC-85267ECD0D37}.Release|Any CPU.Build.0 = Release|Any CPU - {BF3DD4EC-137C-4494-BED9-F19F592237C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF3DD4EC-137C-4494-BED9-F19F592237C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF3DD4EC-137C-4494-BED9-F19F592237C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF3DD4EC-137C-4494-BED9-F19F592237C8}.Release|Any CPU.Build.0 = Release|Any CPU - {4A74259B-DC46-4D9B-842B-ECC337717E19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A74259B-DC46-4D9B-842B-ECC337717E19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A74259B-DC46-4D9B-842B-ECC337717E19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A74259B-DC46-4D9B-842B-ECC337717E19}.Release|Any CPU.Build.0 = Release|Any CPU - {50CEB765-B476-45CE-9447-50526EEABBDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {50CEB765-B476-45CE-9447-50526EEABBDA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {50CEB765-B476-45CE-9447-50526EEABBDA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {50CEB765-B476-45CE-9447-50526EEABBDA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(TeamFoundationVersionControl) = preSolution - SccNumberOfProjects = 16 - SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} - SccTeamFoundationServer = https://mattercenter.visualstudio.com/defaultcollection - SccLocalPath0 = . - SccProjectUniqueName1 = Microsoft.Legal.MatterCenter.Common\\Microsoft.Legal.MatterCenter.Common.csproj - SccProjectName1 = Microsoft.Legal.MatterCenter.Common - SccLocalPath1 = Microsoft.Legal.MatterCenter.Common - SccProjectUniqueName2 = Microsoft.Legal.MatterCenter.ConfigureLists\\Microsoft.Legal.MatterCenter.ConfigureLists.csproj - SccProjectName2 = Microsoft.Legal.MatterCenter.ConfigureLists - SccLocalPath2 = Microsoft.Legal.MatterCenter.ConfigureLists - SccProjectUniqueName3 = Microsoft.Legal.MatterCenter.CreateContentTypes\\Microsoft.Legal.MatterCenter.CreateContentTypes.csproj - SccProjectName3 = Microsoft.Legal.MatterCenter.CreateContentTypes - SccLocalPath3 = Microsoft.Legal.MatterCenter.CreateContentTypes - SccProjectUniqueName4 = Microsoft.Legal.MatterCenter.CreateGroups\\Microsoft.Legal.MatterCenter.CreateGroups.csproj - SccProjectName4 = Microsoft.Legal.MatterCenter.CreateGroups - SccLocalPath4 = Microsoft.Legal.MatterCenter.CreateGroups - SccProjectUniqueName5 = Microsoft.Legal.MatterCenter.CreateSampleData\\Microsoft.Legal.MatterCenter.CreateSampleData.csproj - SccProjectName5 = Microsoft.Legal.MatterCenter.CreateSampleData - SccLocalPath5 = Microsoft.Legal.MatterCenter.CreateSampleData - SccProjectUniqueName6 = Microsoft.Legal.MatterCenter.CreateSiteCollection\\Microsoft.Legal.MatterCenter.CreateSiteCollection.csproj - SccProjectName6 = Microsoft.Legal.MatterCenter.CreateSiteCollection - SccLocalPath6 = Microsoft.Legal.MatterCenter.CreateSiteCollection - SccProjectUniqueName7 = Microsoft.Legal.MatterCenter.CreateTerm\\Microsoft.Legal.MatterCenter.CreateTerm.csproj - SccProjectName7 = Microsoft.Legal.MatterCenter.CreateTerm - SccLocalPath7 = Microsoft.Legal.MatterCenter.CreateTerm - SccProjectUniqueName8 = Microsoft.Legal.MatterCenter.CreateSiteColumns\\Microsoft.Legal.MatterCenter.CreateSiteColumns.csproj - SccProjectName8 = Microsoft.Legal.MatterCenter.CreateSiteColumns - SccLocalPath8 = Microsoft.Legal.MatterCenter.CreateSiteColumns - SccProjectUniqueName9 = Microsoft.Legal.MatterCenter.ProvisionWebDashboard\\Microsoft.Legal.MatterCenter.ProvisionWebDashboard.csproj - SccProjectName9 = Microsoft.Legal.MatterCenter.ProvisionWebDashboard - SccLocalPath9 = Microsoft.Legal.MatterCenter.ProvisionWebDashboard - SccProjectUniqueName10 = Microsoft.Legal.MatterCenter.UpdateAppConfig\\Microsoft.Legal.MatterCenter.UpdateAppConfig.csproj - SccProjectName10 = Microsoft.Legal.MatterCenter.UpdateAppConfig - SccLocalPath10 = Microsoft.Legal.MatterCenter.UpdateAppConfig - SccProjectUniqueName11 = Microsoft.Legal.MatterCenter.UpdateListPermissions\\Microsoft.Legal.MatterCenter.UpdateListPermissions.csproj - SccProjectName11 = Microsoft.Legal.MatterCenter.UpdateListPermissions - SccLocalPath11 = Microsoft.Legal.MatterCenter.UpdateListPermissions - SccProjectUniqueName12 = Microsoft.Legal.MatterCenter.UpdateLists\\Microsoft.Legal.MatterCenter.UpdateLists.csproj - SccProjectName12 = Microsoft.Legal.MatterCenter.UpdateLists - SccLocalPath12 = Microsoft.Legal.MatterCenter.UpdateLists - SccProjectUniqueName13 = Microsoft.Legal.MatterCenter.UpdateTaxonomyFields\\Microsoft.Legal.MatterCenter.UpdateTaxonomyFields.csproj - SccProjectName13 = Microsoft.Legal.MatterCenter.UpdateTaxonomyFields - SccLocalPath13 = Microsoft.Legal.MatterCenter.UpdateTaxonomyFields - SccProjectUniqueName14 = Microsoft.Legal.MatterCenter.UpdateView\\Microsoft.Legal.MatterCenter.UpdateView.csproj - SccProjectName14 = Microsoft.Legal.MatterCenter.UpdateView - SccLocalPath14 = Microsoft.Legal.MatterCenter.UpdateView - SccProjectUniqueName15 = Microsoft.Legal.MatterCenter.UploadFile\\Microsoft.Legal.MatterCenter.UploadFile.csproj - SccProjectName15 = Microsoft.Legal.MatterCenter.UploadFile - SccLocalPath15 = Microsoft.Legal.MatterCenter.UploadFile - EndGlobalSection -EndGlobal diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.ProvisionWebDashboard/Program.cs b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.ProvisionWebDashboard/Program.cs index 0ea11bd5..95c0c90e 100644 --- a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.ProvisionWebDashboard/Program.cs +++ b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.ProvisionWebDashboard/Program.cs @@ -249,7 +249,7 @@ internal static void CreateProvisionPages(Dictionary configVal, string pageUrlConstant = urlConstantName; string sourceFileTemplatePath = string.Concat(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName, Constants.Backslash, ConfigurationManager.AppSettings["staticContentFolder"], Constants.Backslash, ConfigurationManager.AppSettings["htmlFolder"], Constants.Backslash, sourceFileTemplate); - string pageUrl = string.Concat(configVal["UISiteURL"], pageUrlName); + string pageUrl = configVal["UISiteURL"]; // Read the content of helper file pageContent = System.IO.File.ReadAllText(sourceFileTemplatePath); // Set the Catalog site collection URL in the content of webdashboard helper page diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UpdateAppConfig/App.config b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UpdateAppConfig/App.config index 16673ae9..9c023ac4 100644 --- a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UpdateAppConfig/App.config +++ b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UpdateAppConfig/App.config @@ -87,6 +87,7 @@ + diff --git a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UploadFile/App.config b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UploadFile/App.config index aec875cf..12563e46 100644 --- a/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UploadFile/App.config +++ b/tree/master/cloud/src/Helper Utilities/Microsoft.Legal.MatterCenter.HelperUtilities/Microsoft.Legal.MatterCenter.UploadFile/App.config @@ -19,7 +19,7 @@ - + diff --git a/tree/master/cloud/src/deployments/Scripts/Deploy.ps1 b/tree/master/cloud/src/deployments/Scripts/Deploy.ps1 index f2ba9ec3..dfd550f8 100644 --- a/tree/master/cloud/src/deployments/Scripts/Deploy.ps1 +++ b/tree/master/cloud/src/deployments/Scripts/Deploy.ps1 @@ -8,17 +8,15 @@ # Step 4: Update Office, Outlook and SharePoint App schema files # Step 5: Update search configuration file and upload to SharePoint # Step 6: Update resource and config files in build -# Step 7: Activate SharePoint Server Publishing infrastructure feature on catalog site collection -# Step 8: Update App files for SharePoint and OneDrive Ribbon Apps -# Step 9: Encrypting the config files -# Step 10: Publishing files to Azure -# Step 11: Add and install apps to SharePoint and Office -# Step 12: Add apps to Exchange -# Step 13: Upload files to SharePoint Library -# Step 14: Creating Site Collection(s) -# Step 15: Provisioning Web dashboard -# Step 16: Update site collection view with field(s) -# Step 17: Creating source in event viewer +# Step 7: Activate SharePoint Server Publishing infrastructure feature on catalog site collection +# Step 8: Encrypting the config files +# Step 9: Add and install apps to SharePoint and Office +# Step 10: Add apps to Exchange +# Step 11: Upload files to SharePoint Library +# Step 12: Creating Site Collection(s) +# Step 13: Provisioning Web dashboard +# Step 14: Update site collection view with field(s) +# Step 15: Creating source in event viewer # # Any changes in these steps, kindly update this list. Also update the checkpoint in Revert script #---------------------------------------------- @@ -397,57 +395,36 @@ if($IsValid -eq $true) #---------------------------------------------- # Update App files for SharePoint and OneDrive Ribbon Apps #---------------------------------------------- - Show-Message -Message "Step 8: Update App files for SharePoint and OneDrive Ribbon Apps" - . "$ScriptDirectory\UpdateAppPackage.ps1" -IsDeployedOnAzure $IsDeployedOnAzure -Credentials $SPCredential - - If ((Get-Content $ErrorLogFile) -ne $Null) { - Show-Message -Message "Updating App files for SharePoint and OneDrive Ribbon Apps failed" -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 3 #Revert from step 3 to 1 - return - } - else { - Show-Message -Message "Completed updating App files for SharePoint and OneDrive Ribbon Apps" -Type ([MessageType]::Success) - } + # Show-Message -Message "Step 8: Update App files for SharePoint and OneDrive Ribbon Apps" + # . "$ScriptDirectory\UpdateAppPackage.ps1" -IsDeployedOnAzure $IsDeployedOnAzure -Credentials $SPCredential + # + # If ((Get-Content $ErrorLogFile) -ne $Null) { + # Show-Message -Message "Updating App files for SharePoint and OneDrive Ribbon Apps failed" -Type ([MessageType]::Failure) + # RevertAll $ScriptDirectory 3 #Revert from step 3 to 1 + # return + # } + # else { + # Show-Message -Message "Completed updating App files for SharePoint and OneDrive Ribbon Apps" -Type ([MessageType]::Success) + # } #---------------------------------------------- # Encrypt the appSettings section in web.config #---------------------------------------------- - Show-Message -Message "Step 9: Encrypting the config files" + Show-Message -Message "Step 8: Encrypting the config files" . "$ScriptDirectory\EncryptDecrypt.ps1" -ToEncrypt: $true -ErrorLogPath: $ErrorLogFile If ((Get-Content $ErrorLogFile) -ne $Null) { Show-Message -Message "Encryption failed..." -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 9 + RevertAll $ScriptDirectory 8 return } else { Show-Message -Message "Config files encrypted successfully..." -Type ([MessageType]::Success) } - #---------------------------------------------- - # Publish websites - #---------------------------------------------- - Show-Message -Message "Step 10: Publishing files to Azure/IIS" - $IsOnAzure = (Read-FromExcel $ExcelFilePath "Config" ("IsDeployedOnAzure") $ErrorLogFile) - if($IsOnAzure[0]) - { - . "$ScriptDirectory\PublishOnAzure.ps1" - If ((Get-Content $ErrorLogFile) -ne $Null) { - Show-Message -Message "Publishing files to Azure or creating Azure Redis cache failed" -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 9 - return - } - } - else { - . "$ScriptDirectory\PublishInIIS.ps1" - If ((Get-Content $ErrorLogFile) -ne $Null) { - Show-Message -Message "Publishing files to IIS failed" -Type ([MessageType]::Failure) - } - } - #---------------------------------------------- # Add Apps to SharePoint and Office #---------------------------------------------- - Show-Message -Message "Step 11: Add and install apps to SharePoint and Office" + Show-Message -Message "Step 9: Add and install apps to SharePoint and Office" . "$ScriptDirectory\AppInstall.ps1" -IsDeploy: $false . "$ScriptDirectory\DeployOfficeApp.ps1" -IsDeploy: $true -IsOfficeApp: $false . "$ScriptDirectory\DeployOfficeApp.ps1" -IsDeploy: $true -IsOfficeApp: $true @@ -455,7 +432,7 @@ if($IsValid -eq $true) If ((Get-Content $ErrorLogFile) -ne $Null) { Show-Message -Message "Adding and installing apps to SharePoint and Office failed" -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 11 + RevertAll $ScriptDirectory 9 return } else { @@ -466,12 +443,12 @@ if($IsValid -eq $true) #---------------------------------------------- # Add Apps to Exchange #---------------------------------------------- - Show-Message -Message "Step 12: Add apps to Exchange" + Show-Message -Message "Step 10: Add apps to Exchange" . "$ScriptDirectory\DeployOutlookApp.ps1" -IsDeploy: $true If ((Get-Content $ErrorLogFile) -ne $Null) { Show-Message -Message "Adding apps to Exchange failed" -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 12 + RevertAll $ScriptDirectory 10 return } else { @@ -481,13 +458,13 @@ if($IsValid -eq $true) #--------------------------------------------------------------------- # Upload files required for Matter landing page to SharePoint library #--------------------------------------------------------------------- - Show-Message -Message "Step 13: Upload files to SharePoint Library" + Show-Message -Message "Step 11: Upload files to SharePoint Library" [Environment]::CurrentDirectory = Get-Location & "$HelperPath\Microsoft.Legal.MatterCenter.UploadFile.exe" "true" $Username $Password If ((Get-Content $ErrorLogFile) -ne $Null) { Show-Message -Message "Uploading files to SharePoint Library failed" -Type ([MessageType]::Failure) - RevertAll $ScriptDirectory 13 + RevertAll $ScriptDirectory 11 return } else { @@ -508,7 +485,7 @@ if($IsValid -eq $true) } } - Show-Message -Message "Step 14: Creating Site Collection(s)" + Show-Message -Message "Step 12: Creating Site Collection(s)" . "$ScriptDirectory\CreateSiteCollection.ps1" -IsDeployedOnAzure: $IsDeployedOnAzure -Username: $Username -Password $Password If ((Get-Content $ErrorLogFile) -ne $Null) { Show-Message -Message "Creating site collection failed" -Type ([MessageType]::Failure) @@ -520,7 +497,7 @@ if($IsValid -eq $true) #--------------------------------------------------------------------- # Provisioning Web Dashboard page(s) on SharePoint library #--------------------------------------------------------------------- - Show-Message -Message "Step 15: Provisioning Web dashboard" + Show-Message -Message "Step 13: Provisioning Web dashboard" & "$HelperPath\Microsoft.Legal.MatterCenter.ProvisionWebDashboard.exe" "true" $Username $Password If ((Get-Content $ErrorLogFile) -ne $Null) { @@ -533,13 +510,13 @@ if($IsValid -eq $true) #--------------------------------------------------------------------- # Update site pages view with fields #--------------------------------------------------------------------- - Show-Message -Message "Step 16: Update site collection view with fields" + Show-Message -Message "Step 14: Update site collection view with fields" & "$HelperPath\Microsoft.Legal.MatterCenter.UpdateView.exe" $Username $Password #--------------------------------------------------------------------- # Creating source in event viewer #--------------------------------------------------------------------- - Show-Message -Message "Step 17: Creating source in event viewer" + Show-Message -Message "Step 15: Creating source in event viewer" if(-not $IsDeployedOnAzure) { $logFileExists = Get-EventLog -list | Where-Object {$_.logdisplayname -eq $Log} diff --git a/tree/master/cloud/src/deployments/Scripts/PublishInIIS.ps1 b/tree/master/cloud/src/deployments/Scripts/PublishInIIS.ps1 deleted file mode 100644 index 4002a61a..00000000 --- a/tree/master/cloud/src/deployments/Scripts/PublishInIIS.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -# This script is used to publish UI and Service to IIS - -# Get the current directory of the script -Function ScriptRoot {Split-Path $MyInvocation.ScriptName} -$ScriptDirectory = (ScriptRoot) - -# Get the parent directory of the script -Function Get-ParentDirectory {Split-Path -Parent(Split-Path $MyInvocation.ScriptName)} -$ParentDirectory = (Get-ParentDirectory) - -# Function is used to publish files to IIS -Function Publish-Files() -{ - param( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [string] $SourcePath - - ,[parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [string] $DestinationPath - ) - - Show-Message -Message "Copying all files from $SourcePath to $DestinationPath" - - # Copy files after checking whether source and destination folders exist - if((Check-Existance -Path $SourcePath) -and (Check-Existance -Path $DestinationPath)) - { - Get-Childitem "$SourcePath" | % { - copy-item $_.FullName -Destination "$DestinationPath\$_" -Recurse -Force - } - - return $true; - } - else - { - Write-Log ($ErrorLogFile) "Either the Source Path or the Destination Path is invalid" - return $false; - } - -} - -# Function is used to check whether provided path exists or not -Function Check-Existance() -{ - param( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [string] $Path - ) - - return Test-Path $path -} - -#Set Excel file path, uncomment below line if you want to use this script separately -#$ExcelFilePath = "$ParentDirectory\MCDeploymentConfig.xlsx" - -# Set log file path, uncomment below line if you want to use this script separately -#$ErrorLogFile = "$ScriptDirectory\Logs\ErrorLog.txt" - -Show-Message -Message "Reading parameters from Excel file..." -$ExcelValues = (Read-FromExcel $ExcelFilePath "Config" ("UIPublishLocation", "ServicePublishLocation", "IsDeployedOnAzure") ($ErrorLogFile)) -$ExcelValues = $ExcelValues.Split(";") -if($ExcelValues.length -le 0) -{ - Write-Log $ErrorLogFile "Error reading values from Excel file. Aborting!" - return $false -} -$UIPublishLocation = $ExcelValues[0] -$ServicePublishLocation = $ExcelValues[1] -$IsValid = $false - -# If IsDeployedOnAzure parameter is false then proceed with publish activity else do nothing - -if ("false" -eq $ExcelValues[2].ToLowerInvariant()) -{ - Show-Message -Message "Publishing files to IIS" - $IsValid = Publish-Files -SourcePath ($ParentDirectory + "\Service Publish") -DestinationPath $ServicePublishLocation - if(!($IsValid)) - { - Write-Log ($ErrorLogFile) "Publish to $ServicePublishLocation failed" - return - } - $IsValid = Publish-Files -SourcePath ($ParentDirectory + "\Web Publish") -DestinationPath $UIPublishLocation - if(!($IsValid)) - { - Write-Log ($ErrorLogFile) "Publish to $UIPublishLocation failed" - return - } -} -else -{ - Show-Message -Message "Skipping publish step as the script is ran for Azure" -Type ([MessageType]::Warning) -} - - diff --git a/tree/master/cloud/src/deployments/Scripts/PublishOnAzure.ps1 b/tree/master/cloud/src/deployments/Scripts/PublishOnAzure.ps1 deleted file mode 100644 index 222410c2..00000000 --- a/tree/master/cloud/src/deployments/Scripts/PublishOnAzure.ps1 +++ /dev/null @@ -1,211 +0,0 @@ -# Get the current directory of the script -Function ScriptRoot {Split-Path $MyInvocation.ScriptName} -$ScriptDirectory = (ScriptRoot) - -# Get the parent directory of the script -Function Get-ParentDirectory {Split-Path -Parent(Split-Path $MyInvocation.ScriptName)} -$ParentDirectory = (Get-ParentDirectory) - -#Set Excel file path, uncomment below line if you want to use this script separately -$ExcelFilePath = "$ParentDirectory\MCDeploymentConfig.xlsx" - -# Set log file path, uncomment below line if you want to use this script separately -$ErrorLogFile = "$ScriptDirectory\Logs\ErrorLog.txt" - -# Set revert log file path -$RevertLogFile = "$ScriptDirectory\Logs\RevertLog.txt" - -# Set helper utilities folder path -$HelperPath = "$ScriptDirectory\Helper Utilities" - -$Path = (get-item $ScriptDirectory ).parent -$ServicePackagePath = "$ParentDirectory\Service Publish" -$WebsitePackagePath = "$ParentDirectory\Web Publish" -$ExcelValues = (Read-FromExcel $ExcelFilePath "Config" ("AzureWebsiteName", "AzureWebServiceName", "TenantURL")($ErrorLogFile)) -$ExcelValues = $ExcelValues.Split(";") -# Create GUID to be used for Encryption Key -$Guid = [guid]::NewGuid().ToString().ToUpperInvariant() - - -# Variable for Azure properties -$AzureProperties = $null - -#Variable for Azure cache properties -$MatterCenterCache = $null - -# Global variables with default values -[string]$CacheName = "MatterCenterCache" -[string]$CacheLocation = "West US" -[string]$ResourceGroupName = "Default-Web-WestUS" - -# Publish site on Azure and update the configurations -Function Publish-SiteOnAzure -{ - Show-Message -Message "Publishing web service on Azure" - Publish-AzureWebsiteProject -Name $ExcelValues[1] -Package $ServicePackagePath - Show-Message -Message "Publishing web site on Azure" - Publish-AzureWebsiteProject -Name $ExcelValues[0] -Package $WebsitePackagePath - - Show-Message -Message "Updating App settings for website" - $Website = Get-AzureWebsite -Name $ExcelValues[0] - $Website.AppSettings["Old_Encryption_Key"]= $Guid - $Website.AppSettings["Encryption_Key"]= $Guid - Set-AzureWebsite -Name $ExcelValues[0] -AppSettings $Website.AppSettings - - Show-Message -Message "Updating App settings for web service" - $WebService = Get-AzureWebsite -Name $ExcelValues[1] - - # Accept MailCart username and Password - - if($null -eq $ExchangeCredential) { - $ExchangeCredential = Get-Credential -Message "Enter credentials to connect with Exchange server." - } - $WebService.AppSettings["Mail_Cart_Mail_User_Name"]= $ExchangeCredential.UserName - $WebService.AppSettings["Mail_Cart_Mail_Password"]= $ExchangeCredential.GetNetworkCredential().Password - $WebService.AppSettings["Old_Encryption_Key"]= $Guid - $WebService.AppSettings["Encryption_Key"]= $Guid - Set-AzureWebsite -Name $ExcelValues[1] -AppSettings $WebService.AppSettings -} - -# Get the azure properties of the website -Function Get-AzureWebsiteProperties -{ - $AzureProperties = Get-AzureRmResource | - Where-Object { $_.ResourceType -like '*site*' -and $_.Name -like $ExcelValues[1] } | ` - Select-Object ResourceGroupName, Location - - - # Return the azure properties - return $AzureProperties -} - -# Create redis cache -Function Create-RedisCache -{ -param ( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [String] $CacheLocation, - - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [String] $ResourceGroupName, - - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [String] $CacheName -) - #Check if redis cache group already exists - $IsCacheExist = $null - $CacheInfo = $null - try - { - $ResourceGroups = Get-AzureRmResourceGroup - Foreach ($ResourceGroup IN $ResourceGroups) - { - # Check redis cache is already exists - $IsCacheExist = Find-AzureRmResource -ResourceGroupNameContains $ResourceGroup.ResourceGroupName -ResourceNameContains $CacheName -Top 1 -ErrorAction SilentlyContinue - if($null -ne $IsCacheExist) - { - $CacheInfo = Get-AzureRmRedisCache -ResourceGroupName $ResourceGroup.ResourceGroupName -Name $CacheName -ErrorAction SilentlyContinue - $CacheExist = $true - } - } - - if(!$CacheExist) - { - Show-Message -Message "Matter Center Redis cache doesn't exist, creating redis cache for Matter Center" - # Create a new cache. - $CacheInfo = New-AzureRmRedisCache -Location $CacheLocation -Name $CacheName -ResourceGroupName $ResourceGroupName -Size 250MB -Sku Basic - - Show-Message -Message "Redis cache is in process of creation, it will take sometime to complete! Continuing with the rest of the process" -Type ([MessageType]::Success) - - Show-Message -Message "Primary Key: $($CacheInfo.PrimaryKey)" - Show-Message -Message "Host name: $($CacheInfo.HostName)" - } - else - { - Write-Output "Matter Center Redis cache already exists, hence skipping the process!" - } - #Return the cache details - return $CacheInfo - - } - catch - { - $ErrorMessage = $Error[0].Exception.Error.Message - Write-Log $ErrorLogFile $ErrorMessage - return $null - } -} -# First Phase : Resource Configuration -Show-Message -Message "Please enter your Azure credentials for Azure Resource Management" -if(Login-AzureRmAccount) -{ - - try{ - $AzureProperties = Get-AzureWebsiteProperties - - # Check if azure properties are not null and set it as per the service location - if($AzureProperties -ne $null) - { - $CacheLocation = $AzureProperties.Location - $ResourceGroupName = $AzureProperties.ResourceGroupName - } - - Show-Message -Message "Creating Redis cache" - # Call the function to create redis cache - $cacheName = ($ExcelValues[2] -split '//')[1].Split('.')[0] + $CacheName - $MatterCenterCache= Create-RedisCache $CacheLocation $ResourceGroupName $CacheName - - } - catch{ - - $ErrorMessage = $Error[0].Exception.ErrorRecord.Exception.Message - Write-Log $ErrorLogFile $ErrorMessage - return $false - } -} -else{ - return -} - -# Second phase: Service Configuration and deployment - -Show-Message -Message "Please enter your Azure credentials for Azure service management" -if(Add-AzureAccount) -{ - try - { - # Call azure publish for site and service - Publish-SiteOnAzure - - # Update the service appsettings with Primary key and host name of cache - if($MatterCenterCache -ne $null) - { - Write-Output "Updating the service appsettings with Primary key and host name of cache" - - Show-Message -Message "Updating App settings for web service" - $WebService = Get-AzureWebsite -Name $ExcelValues[1] - - $WebService.AppSettings["Cache_Primary_Key"]= $MatterCenterCache.PrimaryKey - $WebService.AppSettings["Cache_Host_Name"]= $MatterCenterCache.HostName - - Set-AzureWebsite -Name $ExcelValues[1] -AppSettings $WebService.AppSettings - } - else - { - return $false - - } - } - catch - { - $ErrorMessage = $Error[0].Exception.ErrorRecord.Exception.Message - Write-Log $ErrorLogFile $ErrorMessage - return $false - } -} -else { - return -} \ No newline at end of file diff --git a/tree/master/cloud/src/deployments/Scripts/Revert.ps1 b/tree/master/cloud/src/deployments/Scripts/Revert.ps1 index ba4a4b49..ab5b6c78 100644 --- a/tree/master/cloud/src/deployments/Scripts/Revert.ps1 +++ b/tree/master/cloud/src/deployments/Scripts/Revert.ps1 @@ -74,9 +74,9 @@ Show-Message -Message "Adding common library functions" -Type ([MessageType]::Wa Show-Message -Message "Added common library functions" -Type ([MessageType]::Success) #---------------------------------------------- -# Reverting step 13 +# Reverting step 11 #---------------------------------------------- -if (13 -le $Checkpoint) +if (11 -le $Checkpoint) { Show-Message -Message "" Show-Message -Message "Deleting files from SharePoint library" @@ -89,9 +89,9 @@ if (13 -le $Checkpoint) } #---------------------------------------------- -# Reverting step 12 +# Reverting step 10 #---------------------------------------------- -if (12 -le $Checkpoint) +if (10 -le $Checkpoint) { Show-Message -Message "" Show-Message -Message "Removing apps from Exchange" @@ -104,9 +104,9 @@ if (12 -le $Checkpoint) } #---------------------------------------------- -# Reverting step 11 +# Reverting step 9 #---------------------------------------------- -if (11 -le $Checkpoint) +if (9 -le $Checkpoint) { Show-Message -Message "" Show-Message -Message "Removing apps from SharePoint and Office" @@ -121,9 +121,9 @@ if (11 -le $Checkpoint) } #---------------------------------------------- -# Reverting Step 9 +# Reverting Step 8 #---------------------------------------------- -if (9 -le $Checkpoint) +if (8 -le $Checkpoint) { Show-Message -Message "" Show-Message -Message "Undoing Encryption" diff --git a/tree/master/cloud/src/deployments/Scripts/UpdateAppPackage.ps1 b/tree/master/cloud/src/deployments/Scripts/UpdateAppPackage.ps1 deleted file mode 100644 index 98868ffa..00000000 --- a/tree/master/cloud/src/deployments/Scripts/UpdateAppPackage.ps1 +++ /dev/null @@ -1,180 +0,0 @@ -# Script to update the App package with configurations -param -( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [bool] $IsDeployedOnAzure, - - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [System.Management.Automation.PSCredential] $Credentials -) - -# Function to get the parent Content Type ID -function GetContentTypeID(){ - param - ( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [bool] $IsDeployedOnAzure, - - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [System.Management.Automation.PSCredential] $Credentials - - ) - Show-Message -Message "Getting parent Content Type ID" -Type ([MessageType]::Success) - $contentTypeName = "MatterCenter" - $contentTypeGroup = "_MatterCenter" - try { - $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($ContentTypeHubURL) - if($IsDeployedOnAzure){ - $credential = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Credentials.UserName, $Credentials.Password) - } else { - $credential = New-Object System.Net.NetworkCredential($Credentials.UserName, $Credentials.Password) - } - $clientContext.Credentials = $credential - - # Retrieve the ID for parent Content Type - $web = $clientContext.Web - $contentTypeCollection = $web.ContentTypes - $clientContext.Load($contentTypeCollection) - $clientContext.ExecuteQuery() - $parentContentType = $contentTypeCollection | Where-Object {$_.Group -eq $contentTypeGroup -and $_.Name -eq $contentTypeName} - $parentContentTypeId = $parentContentType.Id.StringValue - Show-Message -Message "Parent Content Type ID retrieved" -Type ([MessageType]::Success) - } catch [Exception] - { - $parentContentTypeId = "" - Show-Message -Message "Failed to get the parent Content Type ID" -Type ([MessageType]::Failure) - Write-Log $ErrorLogFile $_.Exception.ToString() - } - return $parentContentTypeId -} - -# Function to update AppManifest.xml, Elements.xml and Feature.xml files present inside the App package -function UpdateAppFile(){ - param - ( - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [string] $appPackagePath, - - [parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [string] $parentContentTypeId - ) - - $fileName = Split-Path -Path $appPackagePath -Leaf - $appManifestFile = "/AppManifest.xml" - $elementsString = "/elements" - $featureString = "/feature" - $pages = "/pages/" - $sendToOneDrive = "Send To OneDrive" - $newProdID = [guid]::NewGuid().ToString() - $newFeatureID = [guid]::NewGuid().ToString() - - try - { - $package = [System.IO.Packaging.Package]::Open($appPackagePath, [System.IO.FileMode]::Open) - $manifestUri = New-Object System.Uri($appManifestFile, [System.UriKind]::Relative) - $appManifestPartNameUri = [System.IO.Packaging.PackUriHelper]::CreatePartUri($manifestUri) - $appManifestPart = $package.GetPart($appManifestPartNameUri) - $appManifestPartStream = $appManifestPart.GetStream() - $reader = New-Object -Type System.IO.StreamReader -ArgumentList $appManifestPartStream - $content = $reader.ReadToEnd() - $xml = [xml] $content - if($xml.App.ProductID) - { - $xml.App.ProductID = "{" + $newProdID + "}" - } - if($xml.App.Properties.StartPage -and -1 -lt $xml.App.Properties.StartPage.ToLowerInvariant().IndexOf($pages)) - { - $previousURL = $xml.App.Properties.StartPage - $xml.App.Properties.StartPage = $SiteUrl + $previousURL.Substring($previousURL.ToLowerInvariant().IndexOf($pages)) - } - if($xml.App.AppPrincipal.RemoteWebApplication.ClientId) - { - $xml.App.AppPrincipal.RemoteWebApplication.ClientId = $ClientID - } - - $appManifestPartStream.Position = 0 - $appManifestPartStream.SetLength(0) - $writer = New-Object -TypeName System.IO.StreamWriter -ArgumentList $appManifestPartStream - $writer.Write($xml.InnerXml) - $writer.Flush() - - $parts = $package.GetParts() - foreach ($part in $parts){ - $partNameUri = $part.Uri.OriginalString - if($partNameUri -match $elementsString -or $partNameUri -match $featureString){ - $partStream = $part.GetStream() - $partReader = New-Object -Type System.IO.StreamReader -ArgumentList $partStream - $partContent = $partReader.ReadToEnd() - $partXml = [xml] $partContent - if($partNameUri -match $elementsString){ - # Update Elements.xml for SharePoint App - if($partXml.Elements.CustomAction.UrlAction.Url -and -1 -lt $partXml.Elements.CustomAction.UrlAction.Url.ToLowerInvariant().IndexOf($pages)){ - $previousURL = $partXml.Elements.CustomAction.UrlAction.Url - $partXml.Elements.CustomAction.UrlAction.Url = $SiteUrl + $previousURL.Substring($previousURL.ToLowerInvariant().IndexOf($pages)) - } - if($sendToOneDrive -eq $partXml.Elements.CustomAction.Title -and "" -ne $parentContentTypeId){ - $partXml.Elements.CustomAction.RegistrationId = $parentContentTypeId - } - # Update Elements.xml for OneDrive Ribbon App - if($partXml.Elements.CustomAction.CommandUIExtension.CommandUIHandlers.CommandUIHandler.CommandAction -and 0 -lt $partXml.Elements.CustomAction.CommandUIExtension.CommandUIHandlers.CommandUIHandler.CommandAction.Count){ - foreach ($item in $partXml.Elements.CustomAction.CommandUIExtension.CommandUIHandlers.ChildNodes){ - $previousURL = $item.CommandAction - $item.CommandAction = $SiteUrl + $previousURL.Substring($previousURL.ToLowerInvariant().IndexOf($pages)) - } - } - } elseif($partNameUri -match $featureString){ - # Update Feature.xml for the App - if($partXml.Feature.Id){ - $partXml.Feature.Id = "{" + $newFeatureID.ToLowerInvariant() + "}" - } - } - $partStream.Position = 0 - $partStream.SetLength(0) - $partWriter = New-Object -TypeName System.IO.StreamWriter -ArgumentList $partStream - $partWriter.Write($partXml.InnerXml) - $partWriter.Flush() - } - } - $package.Close() - Show-Message -Message "Updated the $fileName package" -Type ([MessageType]::Success) - } catch [Exception] - { - $parentContentTypeId = " " - Show-Message -Message "Failed to update the $fileName package" -Type ([MessageType]::Failure) - Write-Log $ErrorLogFile $_.Exception.ToString() - } -} - -$Configurations = (Read-FromExcel $ExcelFilePath "Config" ("ContentTypeHubURL", "UISiteURL", "ClientID") $ErrorLogFile) -$Configurations = $Configurations.Split(";") -if (3 -eq $Configurations.Count){ - $ContentTypeHubURL = $Configurations[0] - $SiteUrl = $Configurations[1] - $ClientID = $Configurations[2] - - $UtilityFolder = "\Helper Utilities\" - $SharePointAppFolder = "\SharePoint App\" - - Add-Type -Path (Get-ChildItem ((Get-Item $ScriptDirectory).FullName + $UtilityFolder + "WindowsBase.dll")) - $SharePointAppPath = (Get-Item $ScriptDirectory).Parent.FullName + $SharePointAppFolder + "Microsoft.Legal.MatterCenter.app" - $RibbonAppPath = (Get-Item $ScriptDirectory).Parent.FullName + $SharePointAppFolder + "Microsoft.Legal.MatterCenter.OneDriveRibbon.app" - # Get the parent Content Type ID - $ParentContentTypeId = GetContentTypeID -IsDeployedOnAzure $IsDeployedOnAzure -Credentials $Credentials - - # Update SharePoint App - UpdateAppFile -appPackagePath $SharePointAppPath -parentContentTypeId $ParentContentTypeId - # Update OneDrive Ribbon App - if(Test-Path $RibbonAppPath) { - UpdateAppFile -appPackagePath $RibbonAppPath -parentContentTypeId $ParentContentTypeId - } -} else{ - $ErrorMessage = "Incorrect configuration retrieved while updating App packages" - Show-Message -Message $ErrorMessage -Type ([MessageType]::Failure) - Write-Log $ErrorMessage -} \ No newline at end of file diff --git a/tree/master/cloud/src/deployments/Static Content/HTML/SettingsSP.html b/tree/master/cloud/src/deployments/Static Content/HTML/SettingsSP.html index 103236d2..bff4b570 100644 --- a/tree/master/cloud/src/deployments/Static Content/HTML/SettingsSP.html +++ b/tree/master/cloud/src/deployments/Static Content/HTML/SettingsSP.html @@ -72,7 +72,7 @@ }, "sp.js"); function preLoad() { - var iFrameUrl = "SETTINGS_PAGE_URL", queryString = ""; + var iFrameUrl = "SETTINGS_PAGE_URL/#/settings", queryString = ""; if ("/" !== _spPageContextInfo.siteServerRelativeUrl) { queryString = "&clientdetails=" + _spPageContextInfo.webAbsoluteUrl + "$|$" + _spPageContextInfo.webTitle; iFrameUrl += "?" + encodeURIComponent(queryString); diff --git a/tree/master/cloud/src/deployments/Static Content/HTML/WebDashboardSPTemplate.html b/tree/master/cloud/src/deployments/Static Content/HTML/WebDashboardSPTemplate.html index 5eb82f96..c53959c3 100644 --- a/tree/master/cloud/src/deployments/Static Content/HTML/WebDashboardSPTemplate.html +++ b/tree/master/cloud/src/deployments/Static Content/HTML/WebDashboardSPTemplate.html @@ -109,7 +109,12 @@ if (sSectionID) { sQueryString = sQuestionMarkChar + sSection + sEqualChar + sSectionID + sAmpersandChar; } - oWebDashboardSPGlobal.iFrame.src = "WEB_DASHBOARD_PAGE_URL" + sQueryString; + if(sSectionID==="1"){ + oWebDashboardSPGlobal.iFrame.src = "WEB_DASHBOARD_PAGE_URL/#/matterdashboard"; + } + else{ + oWebDashboardSPGlobal.iFrame.src = "WEB_DASHBOARD_PAGE_URL/#/documentdashboard"; + } }); // Dynamically update height of iFrame (function () { diff --git a/tree/master/cloud/src/deployments/Static Content/HTML/documentDetails.html b/tree/master/cloud/src/deployments/Static Content/HTML/documentDetails.html index 854fae0b..3abe3893 100644 --- a/tree/master/cloud/src/deployments/Static Content/HTML/documentDetails.html +++ b/tree/master/cloud/src/deployments/Static Content/HTML/documentDetails.html @@ -3,7 +3,7 @@ - Document Details + @@ -18,7 +18,7 @@
+ - - Click here for details +
@@ -30,52 +30,53 @@
Loading - File Name: - + +
- + Open - open + - + Download - download + - + Share - share + - + Check in - check in + - + Loading Check out - check out + - + Send as link - send link + - + OneDrive - OneDrive + - + Pin - pin + - + Unpin - unpin +
@@ -85,8 +86,8 @@
- Preview not supported - There is no preview for this document + +
@@ -98,18 +99,24 @@ Open Close File Properties - View more +
  • Loading
  • -
  • File title:
  • -
  • Client:
  • -
  • Matter:
  • -
  • Client.MatterID:
  • -
  • Document ID:
  • -
  • - Checked out to: +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + + @@ -124,7 +131,8 @@
  • - Author: + + @@ -138,26 +146,35 @@
  • -
  • Date created:
  • -
  • Practice group:
  • -
  • Area of law:
  • -
  • Sub area of law:
  • -
  • File type:
  • -
  • File size:
  • -
  • File access:
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
Open Close - Version history - View more + +
- VersionModifiedModified By + + +
  • Loading
  • @@ -170,6 +187,7 @@
+ \ No newline at end of file diff --git a/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Common Assets/Scripts/uiconfigforspo.js b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Common Assets/Scripts/uiconfigforspo.js new file mode 100644 index 00000000..495e0299 --- /dev/null +++ b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Common Assets/Scripts/uiconfigforspo.js @@ -0,0 +1,77 @@ +var uiconfigs = +{ + "MatterLanding": { + "Label1Tab1HeaderText": "Matter Profile", + "Label2Tab2HeaderText": "Matter Description", + "Label3Tab1Column1Text": "Client Name", + "Label4Tab1Column2Text": "Client & Matter ID", + "Label5Tab1Column3Text": "Practice Group", + "Label6Tab1Column4Text": "Area of Law", + "Label7Tab1Column5Text": "Responsible Attorney", + "Label8Tab1Section2HeaderText": "Matter Library", + "MenuImageUpperCaption": "Matter Center", + "MenuImageLowerCaption": "for Office 365", + "Menu1Option1Text": "Matters", + "Menu1Option2Text": "Documents", + "Menu1Option3Text": "Settings", + "ErrMsg1NoTask": "There are no tasks created", + "ErrMsg2FetchTask": "Error occurred while trying to fetch tasks", + "ErrMsg3CreateEvent": "Error occurred while trying to fetch events", + "ErrMsg4ActiveEvents": "There are no active events", + "ErrMsg5NoMatterDescription": "There is no description for this matter", + "ErrMsg6ForPinUnpinMatters": "Error while trying to retrieve matter pin/unpin status", + "ErrMsg7MatterInformation": "Error while trying to retrieve matter information", + "ErrMsg8MatterDescription": "Error while trying to retrieve matter description", + "ErrMsg9NoPinUnpinMatter": "Error while trying to pin/unpin matter", + "Label1MenuText": "Matter Name", + "Label9Section1Text": "Matter Id", + "Label10Section1Text": "Client Id", + "Label11Section1Text": "Description", + "Label12ManageUserTitleText": "Manage users", + "Label13GotoOnnoteTitleText": "Go to Matter OneNote", + "Label14TaskeTitleText": "Task ", + "Label15CalenderTitleText": "Calendar Events", + "Label16RSSFeedTitleText": "Related News (RSS)", + "Label17EditTitleText": "View / Edit", + "Label18MenuText": "My Matters", + "Label19Section4Text": "Matter Library" + }, + "DocumentDetails": { + "Label1HeaderText": "File Name", + "Label2Section2HeaderText": "File Properties", + "Label3Section2Column1Text": "File title", + "Label4Section2Column2Text": "Client", + "Label5Section2Column3Text": "Matter", + "Label6Section2Column4Text": "Client.MatterID", + "Label7Section2Column5Text": "Document ID", + "Label8Section2Column6Text": "Checked out to", + "Label9Section2Column7Text": "Author", + "Label10Section2Column8Text": "Date created", + "Label11Section2Column9Text": "Practice group", + "Label12Section2Column10Text": "Area of law:", + "Label13Section2Column11Text": "Sub area of law", + "Label14Section2Column12Text": "File type", + "Label15Section2Column13Text": "File size", + "Label16Section2Column14Text": "File access", + "Label17Section2HeaderText": "Version history", + "Label18Section2Column1Text": "Version", + "Label19Section2Column2Text": "Modified", + "Label20Section2Column3Text": "Modified By", + "Label21MenuHeaderOption1Text": "open", + "Label22MenuHeaderOption2Text": "download", + "Label23MenuHeaderOption3Text": "share", + "Label24MenuHeaderOption4Text": "check in", + "Label25MenuHeaderOption5Text": "check out", + "Label26MenuHeaderOption6Text": "send link", + "Label27MenuHeaderOption7Text": "pin", + "Label28MenuHeaderOption8Text": "unpin", + "Label1TabTitleText": "Document Details", + "Link1ErrorDetailsCaptionText": "Click here for details", + "Link2AllDocumentText": "Go to all documents", + "LabelNoPreviewText": "There is no preview for this document", + "ImgNoPreviewSuppoertText": "Preview not supported...", + "Link3ViewMoreText": "View More", + "Label135MenuHead" : "OneDrive", + "Label36MenuHeaderOption7Text" : "Send to OneDrive" + } +}; diff --git a/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Document Landing Assets/Scripts/documentDetails.js b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Document Landing Assets/Scripts/documentDetails.js index b32e67a3..494006c4 100644 --- a/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Document Landing Assets/Scripts/documentDetails.js +++ b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Document Landing Assets/Scripts/documentDetails.js @@ -1157,6 +1157,77 @@ var oDocumentLandingObject = (function () { return string.replace(new RegExp(oCommonFunctions.escapeRegExp(find), "g"), replace); }; + oCommonFunctions.applyConfigSettings = function () { + + + $("#tabTitle").html(uiconfigs.DocumentDetails.Label1TabTitleText); + $("#collapseMessageDetails").html(uiconfigs.DocumentDetails.Link1ErrorDetailsCaptionText); + $("#gotoAllDocuments").attr("title",uiconfigs.DocumentDetails.Link2AllDocumentText); + $("#linkGoToAllDocument").html(uiconfigs.DocumentDetails.Link2AllDocumentText); + $("#previewUnsupportedText").html(uiconfigs.DocumentDetails.LabelNoPreviewText); + $("#imgNoPreview").attr("title",uiconfigs.DocumentDetails.ImgNoPreviewSuppoertText); + $("#spanViewMore").attr("title",uiconfigs.DocumentDetails.Link3ViewMoreText); + $("#viewMoreFileProperties").html(uiconfigs.DocumentDetails.Link3ViewMoreText); + $("#viewMoreVersions").attr("title",uiconfigs.DocumentDetails.Link3ViewMoreText); + $("#viewMoreVersions").html(uiconfigs.DocumentDetails.Link3ViewMoreText); + + $("#spanDocumentName").html(uiconfigs.DocumentDetails.Label1HeaderText+ ":"); + + $("#filePropertiesTitle").html(uiconfigs.DocumentDetails.Label2Section2HeaderText); + $("#Section1Column1").html(uiconfigs.DocumentDetails.Label1HeaderText + ":"); + $("#Section1Column1").attr("title",uiconfigs.DocumentDetails.Label1HeaderText); + $("#Section1Column2").html(uiconfigs.DocumentDetails.Label4Section2Column2Text+ ":"); + $("#Section1Column2").attr("title",uiconfigs.DocumentDetails.Label4Section2Column2Text); + $("#Section1Column3").html(uiconfigs.DocumentDetails.Label5Section2Column3Text+ ":"); + $("#Section1Column3").attr("title",uiconfigs.DocumentDetails.Label5Section2Column3Text); + $("#Section1Column4").html(uiconfigs.DocumentDetails.Label6Section2Column4Text+ ":"); + $("#Section1Column4").attr("title",uiconfigs.DocumentDetails.Label6Section2Column4Text); + $("#Section1Column5").html(uiconfigs.DocumentDetails.Label7Section2Column5Text+ ":"); + $("#Section1Column5").attr("title",uiconfigs.DocumentDetails.Label7Section2Column5Text); + $("#Section1Column6").html(uiconfigs.DocumentDetails.Label8Section2Column6Text+ ":"); + $("#Section1Column6").attr("title",uiconfigs.DocumentDetails.Label8Section2Column6Text); + $("#Section1Column7").html(uiconfigs.DocumentDetails.Label9Section2Column7Text+ ":"); + $("#Section1Column7").attr("title",uiconfigs.DocumentDetails.Label9Section2Column7Text); + $("#Section1Column8").html(uiconfigs.DocumentDetails.Label10Section2Column8Text+ ":"); + $("#Section1Column8").attr("title",uiconfigs.DocumentDetails.Label10Section2Column8Text); + $("#Section1Column9").html(uiconfigs.DocumentDetails.Label11Section2Column9Text+ ":"); + $("#Section1Column9").attr("title",uiconfigs.DocumentDetails.Label11Section2Column9Text); + $("#Section1Column10").html(uiconfigs.DocumentDetails.Label12Section2Column10Text+ ":"); + $("#Section1Column10").attr("title",uiconfigs.DocumentDetails.Label12Section2Column10Text); + $("#Section1Column11").html(uiconfigs.DocumentDetails.Label13Section2Column11Text+ ":"); + $("#Section1Column11").attr("title",uiconfigs.DocumentDetails.Label13Section2Column11Text); + $("#Section1Column12").html(uiconfigs.DocumentDetails.Label14Section2Column12Text+ ":"); + $("#Section1Column12").attr("title",uiconfigs.DocumentDetails.Label14Section2Column12Text); + $("#Section1Column13").html(uiconfigs.DocumentDetails.Label15Section2Column13Text+ ":"); + $("#Section1Column13").attr("title",uiconfigs.DocumentDetails.Label15Section2Column13Text); + $("#Section1Column14").html(uiconfigs.DocumentDetails.Label16Section2Column14Text+ ":"); + $("#Section1Column14").attr("title",uiconfigs.DocumentDetails.Label16Section2Column14Text); + + + $("#Section2Header").html(uiconfigs.DocumentDetails.Label17Section2HeaderText); + $("#Section2Column1").html(uiconfigs.DocumentDetails.Label18Section2Column1Text); + $("#Section2Column2").html(uiconfigs.DocumentDetails.Label19Section2Column2Text); + $("#Section2Column3").html(uiconfigs.DocumentDetails.Label20Section2Column3Text); + + $("#spanOpenDownload").html(uiconfigs.DocumentDetails.Label21MenuHeaderOption1Text); + $("#spanDownload").html(uiconfigs.DocumentDetails.Label22MenuHeaderOption2Text); + $("#spanShare").html(uiconfigs.DocumentDetails.Label23MenuHeaderOption3Text); + $("#spanCheckin").html(uiconfigs.DocumentDetails.Label24MenuHeaderOption4Text); + $("#spanCheckOut").html(uiconfigs.DocumentDetails.Label25MenuHeaderOption5Text); + $("#spanSendLink").html(uiconfigs.DocumentDetails.Label26MenuHeaderOption6Text); + $("#spanPin").html(uiconfigs.DocumentDetails.Label27MenuHeaderOption7Text); + $("#spanUnpin").html(uiconfigs.DocumentDetails.Label28MenuHeaderOption8Text); + + $("#openDocument").attr("title",uiconfigs.DocumentDetails.Label21MenuHeaderOption1Text); + $("#download").attr("title",uiconfigs.DocumentDetails.Label22MenuHeaderOption2Text); + $("#shareDocument").attr("title",uiconfigs.DocumentDetails.Label23MenuHeaderOption3Text); + $("#checkInDocument").attr("title",uiconfigs.DocumentDetails.Label24MenuHeaderOption4Text); + $("#checkOutDocument").attr("title",uiconfigs.DocumentDetails.Label25MenuHeaderOption5Text); + $("#sendLink").attr("title",uiconfigs.DocumentDetails.Label26MenuHeaderOption6Text); + $("#pinDocument").attr("title",uiconfigs.DocumentDetails.Label27MenuHeaderOption7Text); + $("#unpinDocument").attr("title",uiconfigs.DocumentDetails.Label28MenuHeaderOption8Text); + + } /* Function to be executed once DOM loaded completely */ $(document).ready(function () { @@ -1166,6 +1237,7 @@ var oDocumentLandingObject = (function () { oDocumentLanding.sDocumentParentListId = oCommonFunctions.getParameterByName("listguid"); oDocumentLanding.sDocumentGUID = oCommonFunctions.getParameterByName("docguid"); oCommonFunctions.applyBindings(); + oCommonFunctions.applyConfigSettings(); if ("" === oDocumentLanding.sClientRelativeUrl || "" === oDocumentLanding.sDocumentParentListId || "" === oDocumentLanding.sDocumentGUID) { oCommonFunctions.showCommonErrorPopUp(oErrorMessages.sInsufficientParametersMessage); } else { diff --git a/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Matter Landing Assets/scripts/MatterLanding.js b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Matter Landing Assets/scripts/MatterLanding.js index d27fc806..879a88f1 100644 --- a/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Matter Landing Assets/scripts/MatterLanding.js +++ b/tree/master/cloud/src/deployments/Static Content/Matter Center Assets/Matter Landing Assets/scripts/MatterLanding.js @@ -1,7 +1,9 @@ /// JS1003,JS2005,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS2085,JS3054,JS3057,JS3085,JS3116,JS3056,JS3058,JS3092 /* Matter Center constants */ + + var oMatterLandingHtmlConstants = { - "matterInfoHtml": "
\"Loading\"/
\"Close\"
Something went wrong
+-Click here for details
@@MatterName
Matter Profile
Matter Description
@@PinChunk
\"Loading
\"Loading
", + "matterInfoHtml": "
\"Loading\"/
\"Close\"
Something went wrong
+-Click here for details
@@MatterName
@@Label1Tab1HeaderText
@@Label2Tab2HeaderText
@@PinChunk
\"Loading
\"Loading
", "taskSectionHtml": "
\"Loading\"/
", "calendarSectionHtml": "
Calendar Events
\"Loading\"/
", "rssSectionHtml": "
Related News (RSS)
", @@ -180,40 +182,29 @@ oGlobalConstants.Go_To_OneNote = "GoToOneNote"; oGlobalConstants.sAppName = "ProvisionDMSMatter"; oGlobalConstants.sSendMailListName = "SendMail"; oGlobalConstants.sEffectivePermissionUrl = "{0}/_api/Web/lists/getbytitle('{1}')/EffectiveBasePermissions"; - +oGlobalConstants.matterCenterMatterList = "MatterCenterMatters"; // Declare the element for pin var oElement = null; - +//window.location.pathname.split('/').pop().replace('.aspx', '') /* Function to get matter name in case if GUID is not present */ function getMatterName() { return ("undefined" === typeof (documentLibraryGUID)) ? documentLibraryName : documentLibraryGUID; + //return documentLibraryGUID; } /* Document ready function */ $(document).ready(function () { + + "use strict"; displayHeaderAndFooterContent(); var clientUrl = _spPageContextInfo.webServerRelativeUrl + "/"; LogEvent(appInsightsMatterLandingText + appInsightsOperations.PageLoad); /* Make a call to display content on the page */ + //documentLibraryGUID = window.location.pathname.split('/').pop().replace('.aspx', '') displayContent(); /* Register the click event for Matter Information section */ - $(".matterDescriptionTitle,.matterProfileTitle").click(function () { - var className = $(this)[0].className; - if (-1 !== className.indexOf("matterDescriptionTitle")) { - $(".matterDescriptionTitle").removeClass("changeSection"); - $(".matterProfileTitle").addClass("changeSection"); - $(".matterDescriptionBody").removeClass("hide"); - $(".matterProfileBody").addClass("hide"); - LogEvent(appInsightsMatterLandingText + appInsightsOperations.MatterDescription); - } else { - $(".matterDescriptionTitle").addClass("changeSection"); - $(".matterProfileTitle").removeClass("changeSection"); - $(".matterDescriptionBody").addClass("hide"); - $(".matterProfileBody").removeClass("hide"); - LogEvent(appInsightsMatterLandingText + appInsightsOperations.MatterInfo); - } - }); + $("#matterLink").click(function (event) { LogEvent(appInsightsMatterLandingText + appInsightsOperations.MatterLink); @@ -311,8 +302,7 @@ $(document).ready(function () { $(".errorPopUpHolder").addClass("hide"); }); - // Cache the pin element - oElement = document.getElementById("PinMatter"); + // Make a call to SharePoint functions ExecuteOrDelayUntilScriptLoaded(function () { @@ -330,12 +320,14 @@ $(document).ready(function () { getCurrentUserTitle(); retrievePinListItems(); }, "sp.js"); + }); $(window).on("resize", function (event) { adjustFooter(); }); + /* Close the popup if clicked outside the selected area */ function closeAllPopup(event) { "use strict"; @@ -396,6 +388,7 @@ function createModalDialog(isEdit) { var options = SP.UI.$create_DialogOptions(); options.title = title; options.url = oGlobalModalDialog.url + "?" + querystring; + options.width = oGlobalModalDialog.width; options.height = oGlobalModalDialog.height; if ("addEventListener" in window) { // All browsers except IE before version 9 @@ -429,47 +422,132 @@ function receiveMessage(event) { /* Attaches all the content on the page */ function displayContent() { - "use strict"; + "use strict"; + var url = "/sites/catalog/SiteAssets/Matter Center Assets/Common Assets/Scripts/uiconfigforspo.js"; + $.getScript( url, function() { + /* Remove the hierarchy div if it already exists */ + var hierarchyDiv = $("#documentLibraryTitle"); + if (hierarchyDiv) { + $(hierarchyDiv).remove(); + } + + var listUrl = _spPageContextInfo.webAbsoluteUrl + "/Lists"; + //alert(uiconfigs.MatterLanding.Label1Tab1HeaderText); + + oMatterLandingCommonObjects.hierarchyLibraryName = uiconfigs.MatterLanding.Label19Section4Text; + /* Set the matter information html */ + var pinChunk = oMatterLandingHtmlConstants.pinHtml.replace("@@PinIcon", oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.pinIcon); + pinChunk = pinChunk.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); + pinChunk = pinChunk.replace("@@UnpinIcon", oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.unPinIcon); + var sMatterInformationText = oMatterLandingHtmlConstants.matterInfoHtml.replace("@@PinChunk", pinChunk); + sMatterInformationText = sMatterInformationText.replace("@@FindMatterUrl", oFooterLinks.dashboard + oFooterLinks.matterDocumentsQueryString); + sMatterInformationText = sMatterInformationText.replace("@@MatterUrl", _spPageContextInfo.siteServerRelativeUrl + "/" + getMatterName() + oGlobalConstants.sUrlExtension); + sMatterInformationText = sMatterInformationText.replace(/@@MatterName/g, documentLibraryName); + sMatterInformationText = sMatterInformationText.replace(/@@LoadingImage/g, oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); + sMatterInformationText = sMatterInformationText.replace(/@@PopupCloseIcon/g, oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.popupCloseIcon); + + sMatterInformationText = sMatterInformationText.replace("@@Label1Tab1HeaderText", uiconfigs.MatterLanding.Label1Tab1HeaderText); + sMatterInformationText = sMatterInformationText.replace("@@Label2Tab2HeaderText", uiconfigs.MatterLanding.Label2Tab2HeaderText); + sMatterInformationText = sMatterInformationText.replace("@@MyMatters", uiconfigs.MatterLanding.Label18MenuText); + sMatterInformationText = sMatterInformationText.replace("title='My Matters'", "title='" + uiconfigs.MatterLanding.Label18MenuText + "'"); + + + + $("#matterInfo").html(sMatterInformationText); + $("#matterInfo").parent().append(oMatterLandingHtmlConstants.hierarchyHtml.replace(/@@MatterName/g, oMatterLandingCommonObjects.hierarchyLibraryName)); + + /* Set the task panel html text */ + var sTaskPanelText = oMatterLandingHtmlConstants.taskSectionHtml; + sTaskPanelText = sTaskPanelText.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); + sTaskPanelText = sTaskPanelText.replace("@@TaskLink", listUrl + getMatterName() + libraryNameSuffix.taskSuffix); + sTaskPanelText = sTaskPanelText.replace("title='Task'> Task
", "title='" + uiconfigs.MatterLanding.Label14TaskeTitleText + "'> "+ uiconfigs.MatterLanding.Label14TaskeTitleText+" "); + sTaskPanelText = sTaskPanelText.replace("View / Edit ", "" + uiconfigs.MatterLanding.Label17EditTitleText + ""); + sTaskPanelText = sTaskPanelText.replace("title= \"View / Edit\"" , "title=\"" + uiconfigs.MatterLanding.Label17EditTitleText+ "\""); + + + $("#taskPane").html(sTaskPanelText); + + noItemsMessage.noTasks = uiconfigs.MatterLanding.ErrMsg1NoTask; + noItemsMessage.errorMsgTask = uiconfigs.MatterLanding.ErrMsg2FetchTask; + noItemsMessage.errorMsgCalendar = uiconfigs.MatterLanding.ErrMsg3CreateEvent; + noItemsMessage.noEvents = uiconfigs.MatterLanding.ErrMsg4ActiveEvents; + noItemsMessage.noDescription = uiconfigs.MatterLanding.ErrMsg5NoMatterDescription; + noItemsMessage.errorRetrieveFails = uiconfigs.MatterLanding.ErrMsg6ForPinUnpinMatters; + noItemsMessage.errorMatterInfo = uiconfigs.MatterLanding.ErrMsg7MatterInformation; + noItemsMessage.errorMatterDesc = uiconfigs.MatterLanding.ErrMsg8MatterDescription; + noItemsMessage.errorPinUnpinData = uiconfigs.MatterLanding.ErrMsg9NoPinUnpinMatter; + + oPropertyNameMapping.MatterName = uiconfigs.MatterLanding.Label1MenuText; + oPropertyNameMapping.ClientName = uiconfigs.MatterLanding.Label3Tab1Column1Text; + oPropertyNameMapping.AreaOfLaw = uiconfigs.MatterLanding.Label6Tab1Column4Text; + oPropertyNameMapping.ClientID = uiconfigs.MatterLanding.Label10Section1Text; + oPropertyNameMapping.MatterID = uiconfigs.MatterLanding.Label9Section1Text; + oPropertyNameMapping.PracticeGroup= uiconfigs.MatterLanding.Label5Tab1Column3Text; + oPropertyNameMapping.ResponsibleAttorney = uiconfigs.MatterLanding.Label7Tab1Column5Text; + oPropertyNameMapping.Description = uiconfigs.MatterLanding.Label11Section1Text; + + oGlobalConstants.sMatterIdAndClientIdTitle = uiconfigs.MatterLanding.Label4Tab1Column2Text; + + /* Set the calendar panel html text */ + var sCalendarPanelText = oMatterLandingHtmlConstants.calendarSectionHtml; + sCalendarPanelText = sCalendarPanelText.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); + sCalendarPanelText = sCalendarPanelText.replace("@@TaskLink", listUrl + getMatterName() + libraryNameSuffix.calendarSuffix); + sCalendarPanelText = sCalendarPanelText.replace("Calendar Events ", "" + uiconfigs.MatterLanding.Label15CalenderTitleText + " "); + sCalendarPanelText = sCalendarPanelText.replace("title= \"View / Edit\"" , "title=\"" + uiconfigs.MatterLanding.Label17EditTitleText+ "\""); + sCalendarPanelText = sCalendarPanelText.replace("View / Edit ", "" + uiconfigs.MatterLanding.Label17EditTitleText + ""); + + + $("#calendarPane").html(sCalendarPanelText); + + /* Set the rss panel html text */ + var sRSSText = oMatterLandingHtmlConstants.rssSectionHtml; + sRSSText = sRSSText.replace("Related News (RSS) ", "" + uiconfigs.MatterLanding.Label16RSSFeedTitleText+ ""); + sRSSText = sRSSText.replace("title='Related News (RSS)'", "title='" + uiconfigs.MatterLanding.Label16RSSFeedTitleText + "'"); + + + $("#rssPane").html(sRSSText); + + /* Add loading image to OneNote section */ + $("#oneNotePane").html(oMatterLandingHtmlConstants.oneNoteLoadingHtml.replace("@@LoadingImage", + oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage)); + // Cache the pin element + oElement = $("#PinMatter"); + $(".matterDescriptionTitle, .matterProfileTitle").click(function () { + var className = $(this)[0].className; + if (-1 !== className.indexOf("matterDescriptionTitle")) { + $(".matterDescriptionTitle").removeClass("changeSection"); + $(".matterProfileTitle").addClass("changeSection"); + $(".matterDescriptionBody").removeClass("hide"); + $(".matterProfileBody").addClass("hide"); + LogEvent(appInsightsMatterLandingText + appInsightsOperations.MatterDescription); + } + else { + $(".matterDescriptionTitle").addClass("changeSection"); + $(".matterProfileTitle").removeClass("changeSection"); + $(".matterDescriptionBody").addClass("hide"); + $(".matterProfileBody").removeClass("hide"); + LogEvent(appInsightsMatterLandingText + appInsightsOperations.MatterInfo); + } + }); + + $("#matterLink").text(uiconfigs.MatterLanding.Menu1Option1Text); + $("#matterLink").attr('title', uiconfigs.MatterLanding.Menu1Option1Text); + + $("#documentLink").text(uiconfigs.MatterLanding.Menu1Option2Text); + $("#documentLink").attr('title', uiconfigs.MatterLanding.Menu1Option2Text); + + $("#settingsLink").text(uiconfigs.MatterLanding.Menu1Option3Text); + $("#settingsLink").attr('title', uiconfigs.MatterLanding.Menu1Option3Text); + + $(".iconText .mainText")[0].innerHTML = uiconfigs.MatterLanding.MenuImageUpperCaption; + $(".iconText .subText")[0].innerHTML = uiconfigs.MatterLanding.MenuImageLowerCaption; + + //$("#searchText").attr('placeholder', uiconfigs.MatterLanding.Menu1Option3Text); + + - /* Remove the hierarchy div if it already exists */ - var hierarchyDiv = $("#documentLibraryTitle"); - if (hierarchyDiv) { - $(hierarchyDiv).remove(); - } - var listUrl = _spPageContextInfo.webAbsoluteUrl + "/Lists/"; - - /* Set the matter information html */ - var pinChunk = oMatterLandingHtmlConstants.pinHtml.replace("@@PinIcon", oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.pinIcon); - pinChunk = pinChunk.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); - pinChunk = pinChunk.replace("@@UnpinIcon", oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.unPinIcon); - var sMatterInformationText = oMatterLandingHtmlConstants.matterInfoHtml.replace("@@PinChunk", pinChunk); - sMatterInformationText = sMatterInformationText.replace("@@FindMatterUrl", oFooterLinks.dashboard + oFooterLinks.matterDocumentsQueryString); - sMatterInformationText = sMatterInformationText.replace("@@MatterUrl", _spPageContextInfo.siteServerRelativeUrl + "/" + getMatterName() + oGlobalConstants.sUrlExtension); - sMatterInformationText = sMatterInformationText.replace(/@@MatterName/g, documentLibraryName); - sMatterInformationText = sMatterInformationText.replace(/@@LoadingImage/g, oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); - sMatterInformationText = sMatterInformationText.replace(/@@PopupCloseIcon/g, oCommonLinks.sCatalogSite + oMatterLandingCommonObjects.oMatterCenterAssetsLocation + oMatterLandingAssetsLocation.popupCloseIcon); - $("#matterInfo").html(sMatterInformationText); - $("#matterInfo").parent().append(oMatterLandingHtmlConstants.hierarchyHtml.replace(/@@MatterName/g, oMatterLandingCommonObjects.hierarchyLibraryName)); - - /* Set the task panel html text */ - var sTaskPanelText = oMatterLandingHtmlConstants.taskSectionHtml; - sTaskPanelText = sTaskPanelText.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); - sTaskPanelText = sTaskPanelText.replace("@@TaskLink", listUrl + getMatterName() + libraryNameSuffix.taskSuffix); - $("#taskPane").html(sTaskPanelText); - - /* Set the calendar panel html text */ - var sCalendarPanelText = oMatterLandingHtmlConstants.calendarSectionHtml; - sCalendarPanelText = sCalendarPanelText.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage); - sCalendarPanelText = sCalendarPanelText.replace("@@TaskLink", listUrl + getMatterName() + libraryNameSuffix.calendarSuffix); - $("#calendarPane").html(sCalendarPanelText); - - /* Set the rss panel html text */ - var sRSSText = oMatterLandingHtmlConstants.rssSectionHtml; - $("#rssPane").html(sRSSText); - - /* Add loading image to OneNote section */ - $("#oneNotePane").html(oMatterLandingHtmlConstants.oneNoteLoadingHtml.replace("@@LoadingImage", oCommonLinks.sCatalogSite + oCommonLinks.oMatterCenterAssetsLocation + oCommonAssets.loadingImage)); + }); } // Replace query string key with value @@ -751,7 +829,7 @@ function getUserData() { arrResponsibleAttorney = trimEndChar(htmlDecode(oPinProperties.ResponsibleAttorney.trim()), ";").split(";"); } arrUserNames = $.merge(arrTeamMembers, arrResponsibleAttorney); - if (oPinProperties.BlockedUsers) { + if (oPinProperties.BlockedUsers && trimEndChar(htmlDecode(oPinProperties.BlockedUsers.trim()), ";").length > 0) { arrBlockUserName = trimEndChar(htmlDecode(oPinProperties.BlockedUsers.trim()), ";").split(";"); arrBlockUserName = unique($.map(arrBlockUserName, function (item) { return item.trim(); })); } @@ -861,7 +939,7 @@ function displayUserDetails(oUserArray, IsTeam) { // Function to check if user is exist of SharePoint Group function checkUserExistsInSharePointGroup() { "use strict"; - var sUrl = oCommonLinks.sCatalogSite + oGlobalConstants.sEffectivePermissionUrl.replace("{0}", oGlobalConstants.sAppName).replace("{1}", oGlobalConstants.sSendMailListName); + var sUrl = oCommonLinks.sCatalogSite + oGlobalConstants.sEffectivePermissionUrl.replace("{0}", oGlobalConstants.matterCenterMatterList); $.ajax({ url: sUrl, type: "GET", @@ -1421,6 +1499,10 @@ function pinUnpinMatter(event) { "use strict"; $(".pinIcon .loadingIcon").removeClass("hide"); $("#PinMatter").addClass("hide"); + // if( $(".pinImg").cl) + // $(".pinImg").addClass("hide"); + // $(".unPinImg").removeClass("hide"); + if (oElement) { if (oGlobalConstants.sOperationPin === $(oElement).attr("title")) { LogEvent(appInsightsMatterLandingText + appInsightsOperations.Pin); @@ -1468,7 +1550,7 @@ function urlExists() { // Get the link from the data-href attribute var oOneNoteLink = $("#oneNotePane"), arrOneNoteURL; var sDocumentLibraryOriginalName = getMatterName(); - var sOneNoteURL = _spPageContextInfo.siteServerRelativeUrl + oGlobalConstants.wopiFrameUrl + _spPageContextInfo.siteServerRelativeUrl + "/" + sDocumentLibraryOriginalName + libraryNameSuffix.oneNoteSuffix + "/" + sDocumentLibraryOriginalName + "/" + sDocumentLibraryOriginalName + oGlobalConstants.oneNoteExtension; + var sOneNoteURL = _spPageContextInfo.siteServerRelativeUrl + oGlobalConstants.wopiFrameUrl + _spPageContextInfo.siteServerRelativeUrl + "/" + sDocumentLibraryOriginalName + libraryNameSuffix.oneNoteSuffix + "/" + documentLibraryName + "/" + sDocumentLibraryOriginalName + oGlobalConstants.oneNoteExtension; if (sOneNoteURL && "" !== sOneNoteURL) { arrOneNoteURL = sOneNoteURL.split("sourcedoc="); if (arrOneNoteURL.length && arrOneNoteURL[1]) { diff --git a/tree/master/cloud/src/solution/Deployment/Deployment.deployproj b/tree/master/cloud/src/solution/Deployment/Deployment.deployproj new file mode 100644 index 00000000..683d8518 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Deployment.deployproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + + + Release + AnyCPU + + + + ad4204fd-2f59-4a0c-868a-4a9a3c602df1 + + + Deployment + 1.0 + + + + + + + + + + + + + + False + + + + + + + + + + + + + False + + + False + + + False + + + False + + + False + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Deployment.targets b/tree/master/cloud/src/solution/Deployment/Deployment.targets new file mode 100644 index 00000000..4616e6bb --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Deployment.targets @@ -0,0 +1,123 @@ + + + + Debug + AnyCPU + bin\$(Configuration)\ + false + true + false + None + obj\ + $(BaseIntermediateOutputPath)\ + $(BaseIntermediateOutputPath)$(Configuration)\ + $(IntermediateOutputPath)ProjectReferences + $(ProjectReferencesOutputPath)\ + true + + + + false + false + + + + + + + + + + + Always + + + Never + + + false + Build + + + + + + + + _GetDeploymentProjectContent; + _CalculateContentOutputRelativePaths; + _GetReferencedProjectsOutput; + _CalculateArtifactStagingDirectory; + _CopyOutputToArtifactStagingDirectory; + + + + + + + + + + + + + + + + + Configuration=$(Configuration);Platform=$(Platform) + + + + + + + $([System.IO.Path]::GetFileNameWithoutExtension('%(ProjectReference.Identity)')) + + + + + + + $(OutDir) + $(OutputPath) + $(ArtifactStagingDirectory)\ + $(ArtifactStagingDirectory)staging\ + $(Build_StagingDirectory) + + + + + + + <_OriginalIdentity>%(DeploymentProjectContentOutput.Identity) + <_RelativePath>$(_OriginalIdentity.Replace('$(MSBuildProjectDirectory)', '')) + + + + + $(_RelativePath) + + + + + + + + + PrepareForRun + + + + + + + + + + + diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/Create-AzureStorageTable.ps1 b/tree/master/cloud/src/solution/Deployment/Scripts/Create-AzureStorageTable.ps1 new file mode 100644 index 00000000..93a3afcb --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/Create-AzureStorageTable.ps1 @@ -0,0 +1,23 @@ +Function Create-AzureTableStorage +{ + [CmdletBinding(SupportsShouldProcess=$true)] + Param + ( + [Parameter(Mandatory=$true)] + [String]$ResourceGroupName, + [Parameter(Mandatory=$true)] + [String]$StorageAccountName, + [Parameter(Mandatory=$true)] + [String]$StorageAccountKey, + [Parameter(Mandatory=$true)] + [String]$TableName + + ) + + Import-Module "$PSScriptRoot\ManageTableStorageWithCsvFile\ManageTableStorageWithCsvFile.psm1" + $Path = "$PSScriptRoot\ManageTableStorageWithCsvFile\AzureStorageTable.csv" + Get-Module -Name ManageTableStorageWithCsvFile + Get-Command -Module ManageTableStorageWithCsvFile + Import-AzureTableStorage -ResourceGroupName $ResourceGroupName -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey -TableName $TableName -Path $Path + +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/Deploy-AzureResourceGroup.ps1 b/tree/master/cloud/src/solution/Deployment/Scripts/Deploy-AzureResourceGroup.ps1 new file mode 100644 index 00000000..1c9f5335 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/Deploy-AzureResourceGroup.ps1 @@ -0,0 +1,110 @@ +#Requires -Version 3.0 +#Requires -Module AzureRM.Resources +#Requires -Module Azure.Storage + +Param( + [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, + [string] $ResourceGroupName = 'Microsoft.Legal.MatterCenter', + [switch] $UploadArtifacts, + [string] $StorageAccountName, + [string] $StorageAccountResourceGroupName, + [string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts', + [string] $TemplateFile = '..\Templates\template.json', + [string] $TemplateParametersFile = '..\Templates\template.parameters.json', + [string] $ArtifactStagingDirectory = '..\bin\Debug\staging', + [string] $AzCopyPath = '..\Tools\AzCopy.exe', + [string] $DSCSourceFolder = '..\DSC' +) + +Import-Module Azure -ErrorAction SilentlyContinue + +try { + [Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent("VSAzureTools-$UI$($host.name)".replace(" ","_"), "2.8") +} catch { } + +Set-StrictMode -Version 3 + +$OptionalParameters = New-Object -TypeName Hashtable +$TemplateFile = [System.IO.Path]::Combine($PSScriptRoot, $TemplateFile) +$TemplateParametersFile = [System.IO.Path]::Combine($PSScriptRoot, $TemplateParametersFile) + +if ($UploadArtifacts) { + # Convert relative paths to absolute paths if needed + $AzCopyPath = [System.IO.Path]::Combine($PSScriptRoot, $AzCopyPath) + $ArtifactStagingDirectory = [System.IO.Path]::Combine($PSScriptRoot, $ArtifactStagingDirectory) + $DSCSourceFolder = [System.IO.Path]::Combine($PSScriptRoot, $DSCSourceFolder) + + Set-Variable ArtifactsLocationName '_artifactsLocation' -Option ReadOnly -Force + Set-Variable ArtifactsLocationSasTokenName '_artifactsLocationSasToken' -Option ReadOnly -Force + + $OptionalParameters.Add($ArtifactsLocationName, $null) + $OptionalParameters.Add($ArtifactsLocationSasTokenName, $null) + + # Parse the parameter file and update the values of artifacts location and artifacts location SAS token if they are present + $JsonContent = Get-Content $TemplateParametersFile -Raw | ConvertFrom-Json + $JsonParameters = $JsonContent | Get-Member -Type NoteProperty | Where-Object {$_.Name -eq "parameters"} + + if ($JsonParameters -eq $null) { + $JsonParameters = $JsonContent + } + else { + $JsonParameters = $JsonContent.parameters + } + + $JsonParameters | Get-Member -Type NoteProperty | ForEach-Object { + $ParameterValue = $JsonParameters | Select-Object -ExpandProperty $_.Name + + if ($_.Name -eq $ArtifactsLocationName -or $_.Name -eq $ArtifactsLocationSasTokenName) { + $OptionalParameters[$_.Name] = $ParameterValue.value + } + } + + $StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $StorageAccountResourceGroupName -Name $StorageAccountName).Key1 + + $StorageAccountContext = (Get-AzureRmStorageAccount -ResourceGroupName $StorageAccountResourceGroupName -Name $StorageAccountName).Context + + # Create DSC configuration archive + if (Test-Path $DSCSourceFolder) { + Add-Type -Assembly System.IO.Compression.FileSystem + $ArchiveFile = Join-Path $ArtifactStagingDirectory "dsc.zip" + Remove-Item -Path $ArchiveFile -ErrorAction SilentlyContinue + [System.IO.Compression.ZipFile]::CreateFromDirectory($DSCSourceFolder, $ArchiveFile) + } + + # Generate the value for artifacts location if it is not provided in the parameter file + $ArtifactsLocation = $OptionalParameters[$ArtifactsLocationName] + if ($ArtifactsLocation -eq $null) { + $ArtifactsLocation = $StorageAccountContext.BlobEndPoint + $StorageContainerName + $OptionalParameters[$ArtifactsLocationName] = $ArtifactsLocation + } + + # Use AzCopy to copy files from the local storage drop path to the storage account container + & $AzCopyPath """$ArtifactStagingDirectory""", $ArtifactsLocation, "/DestKey:$StorageAccountKey", "/S", "/Y", "/Z:$env:LocalAppData\Microsoft\Azure\AzCopy\$ResourceGroupName" + if ($LASTEXITCODE -ne 0) { return } + + # Generate the value for artifacts location SAS token if it is not provided in the parameter file + $ArtifactsLocationSasToken = $OptionalParameters[$ArtifactsLocationSasTokenName] + if ($ArtifactsLocationSasToken -eq $null) { + # Create a SAS token for the storage container - this gives temporary read-only access to the container + $ArtifactsLocationSasToken = New-AzureStorageContainerSASToken -Container $StorageContainerName -Context $StorageAccountContext -Permission r -ExpiryTime (Get-Date).AddHours(4) + $ArtifactsLocationSasToken = ConvertTo-SecureString $ArtifactsLocationSasToken -AsPlainText -Force + $OptionalParameters[$ArtifactsLocationSasTokenName] = $ArtifactsLocationSasToken + } +} + +# Create or update the resource group using the specified template file and template parameters file +New-AzureRmResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose -Force -ErrorAction Stop + +New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) ` + -ResourceGroupName $ResourceGroupName ` + -TemplateFile $TemplateFile ` + -TemplateParameterFile $TemplateParametersFile ` + @OptionalParameters ` + -Force -Verbose + +$custScriptFile = [System.IO.Path]::Combine($PSScriptRoot, 'MatterCenter-Deploy.ps1') +Invoke-Expression $custScriptFile + +Invoke-Expression "$PSScriptRoot/Create-AzureStorageTable.ps1" + +Create-AzureTableStorage -ResourceGroupName $ResourceGroupName -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey -TableName "MatterCenterConfiguration" diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/KeyVaultSecret.ps1 b/tree/master/cloud/src/solution/Deployment/Scripts/KeyVaultSecret.ps1 new file mode 100644 index 00000000..65e99849 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/KeyVaultSecret.ps1 @@ -0,0 +1,14 @@ +# +# KeyVaultSecret.ps1 +# + +Param( + [string] [Parameter(Mandatory=$true)] $AppKey, + [string] [Parameter(Mandatory=$true)] $VaultName, + [string] [Parameter(Mandatory=$true)] $secretvalue +) + +Login-AzureRmAccount + +$secretvalue = ConvertTo-SecureString $AppKey -AsPlainText -Force +$secret = Set-AzureKeyVaultSecret -VaultName $VaultName -Name 'General-AppKey' -SecretValue $secretvalue \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/AzureStorageTable.csv b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/AzureStorageTable.csv new file mode 100644 index 00000000..f5c86f8c --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/AzureStorageTable.csv @@ -0,0 +1,479 @@ +"PartitionKey","RowKey","ConfigGroup","Key","Value" +MatterCenterConfig,RowKey001,CreateMatter,Tab1HeaderTitle,Step 1: Select a client and provide basic information for your new matter. +MatterCenterConfig,RowKey002,CreateMatter,Tab2HeaderTitle,Step 2: Confirm that a conflict check was conducted and specify who should be conflicted from or given access to this matter. +MatterCenterConfig,RowKey003,CreateMatter,Tab3HeaderTitle,"Step 3: When you've entered all relevant information for your new matter, create the matter and notify your team." +MatterCenterConfig,RowKey004,CreateMatter,ButtonNextText,Next +MatterCenterConfig,RowKey005,CreateMatter,ButtonPreviousText,Previous +MatterCenterConfig,RowKey006,CreateMatter,ButtonCreateText,Create +MatterCenterConfig,RowKey007,CreateMatter,Tab2NoSearchResultText,No Results Found +MatterCenterConfig,RowKey008,CreateMatter,Tab1Type1Header1Label1,Select a Practice Group +MatterCenterConfig,RowKey009,CreateMatter,Tab1Type1Footer1Label1,Please select primary matter type before you save. +MatterCenterConfig,RowKey010,CreateMatter,Tab1SiteColumn1Caption,Area of Law +MatterCenterConfig,RowKey011,CreateMatter,Tab1SiteColumn2Caption,Sub Area of Law (select matter type) +MatterCenterConfig,RowKey012,CreateMatter,Tab1SiteColumn3Caption,Matter Type +MatterCenterConfig,RowKey013,CreateMatter,Tab1Type1Label1,select primary matter type +MatterCenterConfig,RowKey014,CreateMatter,Tab1ButtonAddTitle,Add +MatterCenterConfig,RowKey015,CreateMatter,Tab1ButtonRemoveTitle,Remove +MatterCenterConfig,RowKey016,CreateMatter,MenuImageTitle,Matter Center menu +MatterCenterConfig,RowKey017,CreateMatter,MenuImageCaption,menu +MatterCenterConfig,RowKey018,CreateMatter,Tab1ButtonCloseTitle,Close +MatterCenterConfig,RowKey019,CreateMatter,Tab1ButtonSelectType,Select Type +MatterCenterConfig,RowKey020,CreateMatter,Tab1ImageLoadingAltText,Loading... +MatterCenterConfig,RowKey021,CreateMatter,MenuItem1LinkTitle,Home +MatterCenterConfig,RowKey022,CreateMatter,MenuItem2LinkTitle,Search matters +MatterCenterConfig,RowKey023,CreateMatter,MenuItem3LinkTitle,Search documents +MatterCenterConfig,RowKey024,CreateMatter,MenuItem1LinkText,Home +MatterCenterConfig,RowKey025,CreateMatter,MenuItem2LinkText,Matters +MatterCenterConfig,RowKey026,CreateMatter,MenuItem3LinkText,Documents +MatterCenterConfig,RowKey027,CreateMatter,ButtonSaveText,Save +MatterCenterConfig,RowKey028,CreateMatter,MenuImageOpenTitle,Open App Switcher +MatterCenterConfig,RowKey029,CreateMatter,MenuImageCloseTitle,Close App Switcher +MatterCenterConfig,RowKey030,CreateMatter,ButtonDeleteText,Delete +MatterCenterConfig,RowKey031,CreateMatter,Tab1LeftButtonAltText,Left +MatterCenterConfig,RowKey032,CreateMatter,Tab1RighttButtonAltText,Right +MatterCenterConfig,RowKey033,CreateMatter,Tab3SectionText,"You have entered all of the necessary information to create this matter. After you click Create and Notify, the matter will be created and all team members will receive an email containing a link to this matter's location. " +MatterCenterConfig,RowKey034,CreateMatter,LabelNotificationPopupForExternalSharingText,The following recipent is outside your organization. Would you still like to invite them to the Assigned Team? +MatterCenterConfig,RowKey035,CreateMatter,RemoveLinkText,Remove +MatterCenterConfig,RowKey036,CreateMatter,ConfirmLinkText,Confirm +MatterCenterConfig,RowKey037,CreateMatter,Tab1Dropdown1Label,Client Name +MatterCenterConfig,RowKey038,CreateMatter,Tab1Header,Open Matter +MatterCenterConfig,RowKey039,CreateMatter,Tab2Header,Assign Permission +MatterCenterConfig,RowKey040,CreateMatter,Tab3Header,Create and Notify +MatterCenterConfig,RowKey041,CreateMatter,Tab2Checkbox1Lebal,Conflict check conducted (must be complete prior to provisioning matter) +MatterCenterConfig,RowKey042,CreateMatter,Tab2Textbox1Label,Who conducted the conflict check? +MatterCenterConfig,RowKey043,CreateMatter,Tab2DateLabel,Date Conducted +MatterCenterConfig,RowKey044,CreateMatter,Tab2RadioButton1Label,Conflict Identified? +MatterCenterConfig,RowKey045,CreateMatter,Tab2RadioButton1Option1,Yes +MatterCenterConfig,RowKey046,CreateMatter,Tab2RadioButton1Option2,No +MatterCenterConfig,RowKey047,CreateMatter,Tab2Textbox2Label,Conflicted Users +MatterCenterConfig,RowKey048,CreateMatter,Tab1Textbox1Label,Client ID +MatterCenterConfig,RowKey049,CreateMatter,Tab2Textbox2PlaceHolder,Enter and select names +MatterCenterConfig,RowKey050,CreateMatter,Tab2RadioButton2Label,Would you like this matter to be secured only to the assigned team? +MatterCenterConfig,RowKey051,CreateMatter,Tab2RadioButton2Option1,Yes +MatterCenterConfig,RowKey052,CreateMatter,Tab2RadioButton2Option2,No +MatterCenterConfig,RowKey053,CreateMatter,Tab2TeamHeader,Assign Team +MatterCenterConfig,RowKey054,CreateMatter,Tab2Textbox3Label,Name +MatterCenterConfig,RowKey055,CreateMatter,Tab2Textbox3PlaceHolder,Enter and select names +MatterCenterConfig,RowKey056,CreateMatter,Tab2Deopdown1Label,Role +MatterCenterConfig,RowKey057,CreateMatter,Tab2Deopdown2Label,Permission Level +MatterCenterConfig,RowKey058,CreateMatter,Tab2AddMoreHeaderLabel,Add More Names +MatterCenterConfig,RowKey059,CreateMatter,Tab1Textbox2Label,Matter Name +MatterCenterConfig,RowKey060,CreateMatter,Tab3CheckBox1Text,Include calendar +MatterCenterConfig,RowKey061,CreateMatter,Tab3CheckBox2Text,Include RSS Feeds +MatterCenterConfig,RowKey062,CreateMatter,Tab3CheckBox3Text,Include email notification +MatterCenterConfig,RowKey063,CreateMatter,Tab3CheckBox4Text,Include Tasks +MatterCenterConfig,RowKey064,CreateMatter,Tab3ButtonText,Create and Notify +MatterCenterConfig,RowKey065,CreateMatter,Tab1Textbox2PlaceholderText,Enter a name for this matter +MatterCenterConfig,RowKey066,CreateMatter,Tab1Textbox3Label,Matter ID +MatterCenterConfig,RowKey067,CreateMatter,Tab1Textbox3PlaceholderText,Enter a matter ID +MatterCenterConfig,RowKey068,CreateMatter,Tab1Textbox4Label,Matter Description +MatterCenterConfig,RowKey069,CreateMatter,Tab1Textbox4PlaceholderText,Enter a brief description of the matter +MatterCenterConfig,RowKey070,CreateMatter,Tab1Textbox5Label,Matter Type (click Select to define the practice group and area of law) +MatterCenterConfig,RowKey071,CreateMatter,Tab1DrpDownLevel1DefaultSelectOption,Select a practice group +MatterCenterConfig,RowKey072,CreateMatter,Tab1TermsSelectionSearchPlaceHolderText,Search by typing +MatterCenterConfig,RowKey073,CreateMatter,Tab1LabelFinalTypeText,MatterType +MatterCenterConfig,RowKey074,CreateMatter,Tab1LabelPrimaryTypeText,Please select primary matter type +MatterCenterConfig,RowKey075,CreateMatter,Tab1LabelPrimaryTypeBeforeSaveText,Please select primary matter type before you save. +MatterCenterConfig,RowKey076,CreateMatter,Tab1ButtonSaveSelectiponText,Save Selections +MatterCenterConfig,RowKey081,DocumentDashboard,LinkImageLoadingTitle,Matter Center Home +MatterCenterConfig,RowKey082,DocumentDashboard,ImageLoadingAltText,Matter Center +MatterCenterConfig,RowKey083,DocumentDashboard,Image1EmailAttachmentText,Email as attachment +MatterCenterConfig,RowKey084,DocumentDashboard,Image2EmailAttachmentLinkText,Email as link +MatterCenterConfig,RowKey085,DocumentDashboard,Image3EmailRemovalAttachmentLinkText,Remove attachment +MatterCenterConfig,RowKey086,DocumentDashboard,SearchDocumentPlaceholderText,"Search by document name, document ID, or keyword" +MatterCenterConfig,RowKey087,DocumentDashboard,ImageAdvanceSearchAltText,Drop Down +MatterCenterConfig,RowKey088,DocumentDashboard,ImageAdvanceSearchTitle,Advanced search +MatterCenterConfig,RowKey089,DocumentDashboard,AdvSearchLabel1Text,Clients +MatterCenterConfig,RowKey090,DocumentDashboard,AdvSearchLabel1FunctionParameterText,client +MatterCenterConfig,RowKey091,DocumentDashboard,AdvSearchTextbox1PlaceholderText,Enter or select a client +MatterCenterConfig,RowKey092,DocumentDashboard,AdvSearchSelectAllLinkText,Select All +MatterCenterConfig,RowKey093,DocumentDashboard,AdvSearchSelectNoneLinkText,Select None +MatterCenterConfig,RowKey094,DocumentDashboard,AdvSearchbuttonOkText,Ok +MatterCenterConfig,RowKey095,DocumentDashboard,AdvSearchbuttonCancelText,Cancel +MatterCenterConfig,RowKey096,DocumentDashboard,AdvSearchLabel2Text,Author +MatterCenterConfig,RowKey097,DocumentDashboard,AdvSearchTextbox2PlaceholderText,Document Author +MatterCenterConfig,RowKey098,DocumentDashboard,AdvSearchLabel3Text,Date +MatterCenterConfig,RowKey099,DocumentDashboard,AdvSearchTextbox3PlaceholderText,From +MatterCenterConfig,RowKey100,DocumentDashboard,AdvSearchTextbox4PlaceholderText,To +MatterCenterConfig,RowKey101,DocumentDashboard,NoSearchResultMsgText,No Results Found +MatterCenterConfig,RowKey102,DocumentDashboard,AdvSearchButtonSearchText,Search +MatterCenterConfig,RowKey103,DocumentDashboard,Tab1HeaderText,My documents +MatterCenterConfig,RowKey104,DocumentDashboard,Tab2HeaderText,All documents +MatterCenterConfig,RowKey105,DocumentDashboard,Tab3HeaderText,Pinned documents +MatterCenterConfig,RowKey106,DocumentDashboard,ImageMailCartIconTitle,Review the contents of your mail cart and send the selected documents to your OneDrive or via email. +MatterCenterConfig,RowKey107,DocumentDashboard,ImageMailCartIconAltText,Mail Cart +MatterCenterConfig,RowKey108,DocumentDashboard,LabelSortByText,Sort by: +MatterCenterConfig,RowKey109,DocumentDashboard,LabelSortByTitle,Sort By +MatterCenterConfig,RowKey110,DocumentDashboard,DrpDownOption1Text,None +MatterCenterConfig,RowKey111,DocumentDashboard,DrpDownOption2Text,Alphabetical +MatterCenterConfig,RowKey112,DocumentDashboard,DrpDownOption3Text,Created date +MatterCenterConfig,RowKey113,DocumentDashboard,DrpDownOption4Text,Modified date +MatterCenterConfig,RowKey114,DocumentDashboard,MattersPreLoadingMsgText, Please wait while the Documents load. +MatterCenterConfig,RowKey115,DocumentDashboard,AttachmentLoadingText,Loading... +MatterCenterConfig,RowKey116,DocumentDashboard,GridColumn1Header,Document +MatterCenterConfig,RowKey117,DocumentDashboard,GridColumn2Header,Client +MatterCenterConfig,RowKey118,DocumentDashboard,GridColumn3Header,Author +MatterCenterConfig,RowKey119,DocumentDashboard,GridColumn4Header,Modified Date +MatterCenterConfig,RowKey120,DocumentDashboard,GridColumn5Header,Document ID +MatterCenterConfig,RowKey121,DocumentDashboard,GridColumn6Header,Version +MatterCenterConfig,RowKey131,Documents,EllipsisLink4Text,Unpin this Document +MatterCenterConfig,RowKey132,Documents,StartDatePlaceHolder,Start mm/dd/yyyy +MatterCenterConfig,RowKey133,Documents,EndDatePlaceHolder,End mm/dd/yyyy +MatterCenterConfig,RowKey134,Documents,ImageWarningTitle,Warning +MatterCenterConfig,RowKey135,Documents,ImageWarningAltText,Warning icon +MatterCenterConfig,RowKey136,Documents,AttachmentSuccessfullyMsgText,Documents successfully attached. +MatterCenterConfig,RowKey137,Documents,AttachmentProgressingText,Attaching +MatterCenterConfig,RowKey138,Documents,AttachmentProgressingWarningText,Do not close Matter Center until all documents are attached. +MatterCenterConfig,RowKey139,Documents,AttachmentLoadingText,Loading... +MatterCenterConfig,RowKey140,Documents,ButtonOkText,Ok +MatterCenterConfig,RowKey141,Documents,ImageClearTitle,Clear +MatterCenterConfig,RowKey142,Documents,LabelCloseText,Close +MatterCenterConfig,RowKey143,Documents,ClearFilterFromLabelText,Clear filters from +MatterCenterConfig,RowKey144,Documents,NoFilterMatchMsgTitle,There are no items that match this filter +MatterCenterConfig,RowKey145,Documents,NoFilterMatchMsgText,There are no items that match this filter +MatterCenterConfig,RowKey146,Documents,LabelDocumentText,documents... +MatterCenterConfig,RowKey147,Documents,LabelOfText,of +MatterCenterConfig,RowKey148,Documents,ImageClearAltText,Clear filters +MatterCenterConfig,RowKey149,Documents,FilterSearchPlaceholderText,Search +MatterCenterConfig,RowKey150,Documents,EllipsisDocTypeIconAltText,Document type icon +MatterCenterConfig,RowKey151,Documents,FlyoutLable1Text,Matter +MatterCenterConfig,RowKey152,Documents,FlyoutLable2Text,Document ID +MatterCenterConfig,RowKey153,Documents,GridColumn8Header,Created Date +MatterCenterConfig,RowKey154,Documents,Dropdown1Item1,All Documents +MatterCenterConfig,RowKey155,Documents,Dropdown1Item2,My Documents +MatterCenterConfig,RowKey156,Documents,Dropdown1Item3,Pinned Documents +MatterCenterConfig,RowKey157,Documents,SearchPlaceholderText,"Search by ID, or document or client name" +MatterCenterConfig,RowKey158,Documents,NoDataSearchText,"Nothing matches your search term or the filter you selected. Please try again.
If you applied a filter, remove it to get back to your list.
Search suggestions:
  • Make sure all words are spelled correctly
  • Try different keywords
  • Try searching by the matter name or client name
  • Try more general search terms
" +MatterCenterConfig,RowKey159,Documents,GridColumn1Header,Document +MatterCenterConfig,RowKey160,Documents,GridColumn2Header,Client +MatterCenterConfig,RowKey161,Documents,GridColumn3Header,Client.MatterID +MatterCenterConfig,RowKey162,Documents,GridColumn4Header,Modified Date +MatterCenterConfig,RowKey163,Documents,GridColumn5Header,Author +MatterCenterConfig,RowKey164,Documents,GridColumn6Header,Document Version +MatterCenterConfig,RowKey165,Documents,GridColumn7Header,Checked out to +MatterCenterConfig,RowKey166,Documents,HeaderText,All Documents +MatterCenterConfig,RowKey167,Documents,EllipsisLink1Text,Open this Document +MatterCenterConfig,RowKey168,Documents,EllipsisLink2Text,View Matter Details +MatterCenterConfig,RowKey169,Documents,EllipsisLink3Text,Pin this Document +MatterCenterConfig,RowKey170,Documents,FlyoutButton1Text,Open document +MatterCenterConfig,RowKey171,Documents,FlyoutButton2Text,View document details +MatterCenterConfig,RowKey181,Header,MenuImage1Title,Matter center menu +MatterCenterConfig,RowKey182,Header,MenuImage1Caption,menu +MatterCenterConfig,RowKey183,Header,MenuImage1OpenTitle,Open App Switcher +MatterCenterConfig,RowKey184,Header,MenuImage1CloseTitle,Close App Switcher +MatterCenterConfig,RowKey185,Header,Menu1Option1Title,Home +MatterCenterConfig,RowKey186,Header,Menu1Option2Title,Search matters +MatterCenterConfig,RowKey187,Header,Menu1Option3Title,Search documents +MatterCenterConfig,RowKey188,Header,Menu1Option1Text,Home +MatterCenterConfig,RowKey189,Header,Menu1Option2Text,Matters +MatterCenterConfig,RowKey190,Header,Menu1Option3Text,Documents +MatterCenterConfig,RowKey191,Header,ContextualHelpImageTitle,Matter center help +MatterCenterConfig,RowKey192,Header,ContextualHelpHeader,Matter Center For Outlook +MatterCenterConfig,RowKey193,Header,ContextualHelpNoLinkText,There are no help links available. +MatterCenterConfig,RowKey194,Header,ContextualHelpFooterLink1Label,Matter Center Aisling Support +MatterCenterConfig,RowKey195,Header,LogoImageTitle,Matter center home +MatterCenterConfig,RowKey196,Header,ContextualHelpLabel1,Get to know this view +MatterCenterConfig,RowKey197,Header,ContextualHelpLabel2,How do I get Project Center on my device? +MatterCenterConfig,RowKey198,Header,MatterCenterSupportLink,mailto:support@supportsite.com +MatterCenterConfig,RowKey199,Header,ContextualHelpFooterLink1Title,Write an email to support +MatterCenterConfig,RowKey200,Header,ContextualHelpFooterLabel,Questions? Contact +MatterCenterConfig,RowKey201,Header,ContextualHelpAltText,Contextual Help +MatterCenterConfig,RowKey202,Header,ContextualHelpFlyoutAltText,Close flyout +MatterCenterConfig,RowKey203,Header,CloseTitle,Close +MatterCenterConfig,RowKey204,Header,DashboardMenuImageUpperCaption,Matter Center +MatterCenterConfig,RowKey205,Header,DashboardMenuImageLowerCaption,for Office 365 +MatterCenterConfig,RowKey206,Header,ImageOpenHamburgerTitle,View links +MatterCenterConfig,RowKey207,Header,DashboardHeaderSearchPlaceholderText,Search SharePoint +MatterCenterConfig,RowKey208,Header,DashboardSearchIconTitle,Search +MatterCenterConfig,RowKey209,Header,HamburgerMenuOption3Text,Settings +MatterCenterConfig,RowKey210,Header,FooterMenuOption4Text,Microsoft +MatterCenterConfig,RowKey211,Header,FooterMenuOption1Text,Feedback & Support +MatterCenterConfig,RowKey212,Header,FooterMenuOption2Text,Privacy & Cookies +MatterCenterConfig,RowKey213,Header,FooterMenuOption3Text,Terms of use +MatterCenterConfig,RowKey214,Header,ProfilePictureLabelText,Profile Picture +MatterCenterConfig,RowKey215,Header,LabelSingOutText,Sign Out +MatterCenterConfig,RowKey216,Header,ImageCloseHamburgerTitle,Close +MatterCenterConfig,RowKey226,MatterDashboard,LinkImageLoadingTitle,Matter Center Home +MatterCenterConfig,RowKey227,MatterDashboard,ImageLoadingAltText,Matter Center +MatterCenterConfig,RowKey228,MatterDashboard,ImageCloseTitle,Close +MatterCenterConfig,RowKey229,MatterDashboard,AttachmentLoadingText,Loading... +MatterCenterConfig,RowKey230,MatterDashboard,SearchTextboxPlaceholderText,"Search by document name, document ID, or keyword" +MatterCenterConfig,RowKey231,MatterDashboard,ImageAdvanceSearchAltText,Drop Down +MatterCenterConfig,RowKey232,MatterDashboard,ImageAdvanceSearchTitle,Advanced search +MatterCenterConfig,RowKey233,MatterDashboard,AdvSearchLabel1Text,Clients +MatterCenterConfig,RowKey234,MatterDashboard,AdvSearchTextbox1PlaceholderText,Enter or select a client +MatterCenterConfig,RowKey235,MatterDashboard,AdvSearchSelectAllLinkText,Select All +MatterCenterConfig,RowKey236,MatterDashboard,AdvSearchSelectNoneLinkText,Select None +MatterCenterConfig,RowKey237,MatterDashboard,AdvSearchbuttonOkText,Ok +MatterCenterConfig,RowKey238,MatterDashboard,AdvSearchbuttonCancelText,Cancel +MatterCenterConfig,RowKey239,MatterDashboard,AdvSearchLabel2Text,Practice Group +MatterCenterConfig,RowKey240,MatterDashboard,AdvSearchTextbox2PlaceholderText,Enter or select a practice group +MatterCenterConfig,RowKey241,MatterDashboard,AdvSearchLabel3Text,Area of Law +MatterCenterConfig,RowKey242,MatterDashboard,AdvSearchTextbox3PlaceholderText,Enter or select an area of law +MatterCenterConfig,RowKey243,MatterDashboard,AdvSearchLabel4Text,Date +MatterCenterConfig,RowKey244,MatterDashboard,AdvSearchTextbox4PlaceholderText,From +MatterCenterConfig,RowKey245,MatterDashboard,AdvSearchTextbox5PlaceholderText,To +MatterCenterConfig,RowKey246,MatterDashboard,AdvSearchButtonSearchText,Search +MatterCenterConfig,RowKey247,MatterDashboard,Tab1HeaderText,My matters +MatterCenterConfig,RowKey248,MatterDashboard,Tab2HeaderText,All matters +MatterCenterConfig,RowKey249,MatterDashboard,Tab3HeaderText,Pinned matters +MatterCenterConfig,RowKey250,MatterDashboard,ButtonExportText,Export +MatterCenterConfig,RowKey251,MatterDashboard,LabelSortByText,Sort by: +MatterCenterConfig,RowKey252,MatterDashboard,DrpDownOption1Text,None +MatterCenterConfig,RowKey253,MatterDashboard,DrpDownOption2Text,Alphabetical +MatterCenterConfig,RowKey254,MatterDashboard,DrpDownOption3Text,Created date +MatterCenterConfig,RowKey255,MatterDashboard,NoSearchResultMsgText,No results found. +MatterCenterConfig,RowKey256,MatterDashboard,Button1DuplicateContentTitle,Matter Center will compare all content and data associated with the two documents. Navigating away from this screen will cancel the content check. +MatterCenterConfig,RowKey257,MatterDashboard,Button1DuplicateContentText,Perform content check +MatterCenterConfig,RowKey258,MatterDashboard,Button2SaveLatestVersionTitle,The file will be saved as the latest version of the existing document that has same title. Matter Center will retain all prior versions of the document. +MatterCenterConfig,RowKey259,MatterDashboard,Button2SaveLatestVersionText,Save as latest version +MatterCenterConfig,RowKey260,MatterDashboard,Button3AppendDateTitle,"The file will be saved as new, separate document with the current date and time added to the end of the file name." +MatterCenterConfig,RowKey261,MatterDashboard,Button3AppendDateText,Append date to file name and save +MatterCenterConfig,RowKey262,MatterDashboard,Button4CancelUploadTitle,This document will not be uploaded and you will return to the previous screen. +MatterCenterConfig,RowKey263,MatterDashboard,Button4CancelUploadText,Cancel upload +MatterCenterConfig,RowKey264,MatterDashboard,Image1ContentCheckText,Checking content +MatterCenterConfig,RowKey265,MatterDashboard,UploadCompleteLabel1Text,Upload complete. +MatterCenterConfig,RowKey266,MatterDashboard,CloseIconText,X +MatterCenterConfig,RowKey267,MatterDashboard,AttachmentPopupHeaderText,Drag and drop items to folders on the right +MatterCenterConfig,RowKey268,MatterDashboard,AttachmentPopupHeaderItem1Text,Items +MatterCenterConfig,RowKey269,MatterDashboard,AttachmentPopupHeaderItem2Text,Folders +MatterCenterConfig,RowKey270,MatterDashboard,AttachmentEditImageTitle,Edit attachment name +MatterCenterConfig,RowKey271,MatterDashboard,AttachmentEditImageAltText,Edit +MatterCenterConfig,RowKey272,MatterDashboard,AttachmentSaveImageTitle,Save attachment name +MatterCenterConfig,RowKey273,MatterDashboard,AttachmentSaveImageText,Save +MatterCenterConfig,RowKey274,MatterDashboard,AttachmentUploadSuccessfullyImageAltText,Uploaded successfully +MatterCenterConfig,RowKey275,MatterDashboard,AttachmentIconImageAltText,attachment icon +MatterCenterConfig,RowKey276,MatterDashboard,AttachmentTestTitle,Test attachments +MatterCenterConfig,RowKey277,MatterDashboard,AttachmentEmptyText,No files uploaded +MatterCenterConfig,RowKey278,MatterDashboard,AttachmentPopupFooterImageCapetion,You can also drag and drop files from your desktop. +MatterCenterConfig,RowKey279,MatterDashboard,MattersPreLoadingMsgText,Please wait while the Matters load. +MatterCenterConfig,RowKey280,MatterDashboard,GridColumn1Header,Matter +MatterCenterConfig,RowKey281,MatterDashboard,GridColumn2Header,Client +MatterCenterConfig,RowKey282,MatterDashboard,GridColumn3Header,Client.Matter ID +MatterCenterConfig,RowKey283,MatterDashboard,GridColumn4Header,Modified Date +MatterCenterConfig,RowKey284,MatterDashboard,GridColumn5Header,Responsible attorney +MatterCenterConfig,RowKey285,MatterDashboard,AdvSearchLabel1InternalFuncParamText,client +MatterCenterConfig,RowKey286,MatterDashboard,AdvSearchLabel2InternalFuncParamText,level1 +MatterCenterConfig,RowKey287,MatterDashboard,AdvSearchLabel3InternalFuncParamText,level2 +MatterCenterConfig,RowKey297,Matters,EllipsisLink5Text,Unpin this matter +MatterCenterConfig,RowKey298,Matters,AttachmentEditImageTitle,Edit attachment name +MatterCenterConfig,RowKey299,Matters,AttachmentEditImageAltText,Edit +MatterCenterConfig,RowKey300,Matters,AttachmentSaveImageTitle,Save attachment name +MatterCenterConfig,RowKey301,Matters,AttachmentSaveImageText,Save +MatterCenterConfig,RowKey302,Matters,AttachmentUploadSuccessfullyImageAltText,Uploaded successfully +MatterCenterConfig,RowKey303,Matters,AttachmentIconImageAltText,attachment icon +MatterCenterConfig,RowKey304,Matters,AttachmentTestTitle,Test attachments +MatterCenterConfig,RowKey305,Matters,AttachmentEmptyText,No files uploaded +MatterCenterConfig,RowKey306,Matters,AttachmentBreadcrumAltText,Root +MatterCenterConfig,RowKey307,Matters,AttachmentFolderAltText,Documents +MatterCenterConfig,RowKey308,Matters,FilterSearchPlaceholderText,Search +MatterCenterConfig,RowKey309,Matters,ClearFilterText,Clear filters from +MatterCenterConfig,RowKey310,Matters,NoFilterMatchMsgTitle,There are no items that match this filter +MatterCenterConfig,RowKey311,Matters,NoFilterMatchMsgText,There are no items that match this filter +MatterCenterConfig,RowKey312,Matters,ImageCloseText,Close +MatterCenterConfig,RowKey313,Matters,ImageClearTitle,Clear +MatterCenterConfig,RowKey314,Matters,ImageClearAltText,Clear filters +MatterCenterConfig,RowKey315,Matters,ClearFilterFromLabelText,Clear filters from +MatterCenterConfig,RowKey316,Matters,ImageWarningAltText,Warning Message +MatterCenterConfig,RowKey317,Matters,Button1DuplicateContentTitle,Matter Center will compare all content and data associated with the two documents. Navigating away from this screen will cancel the content check. +MatterCenterConfig,RowKey318,Matters,Button1DuplicateContentText,Perform content check +MatterCenterConfig,RowKey319,Matters,Button2SaveLatestVersionTitle,The file will be saved as the latest version of the existing document that has same title. Matter Center will retain all prior versions of the document. +MatterCenterConfig,RowKey320,Matters,Button2SaveLatestVersionText,Save as latest version +MatterCenterConfig,RowKey321,Matters,Button3AppendDateTitle,"The file will be saved as new, separate document with the current date and time added to the end of the file name." +MatterCenterConfig,RowKey322,Matters,Button3AppendDateText,Append date to file name and save +MatterCenterConfig,RowKey323,Matters,Button4CancelUploadTitle,This document will not be uploaded and you will return to the previous screen. +MatterCenterConfig,RowKey324,Matters,Button4CancelUploadText,Cancel upload +MatterCenterConfig,RowKey325,Matters,Button5OkTitle,This document will not be uploaded and you will return to the previous screen. +MatterCenterConfig,RowKey326,Matters,Button5OkText,Ok +MatterCenterConfig,RowKey327,Matters,Image1ContentCheckText,Checking content +MatterCenterConfig,RowKey328,Matters,Button6CancelText,Cancel +MatterCenterConfig,RowKey329,Matters,UploadCompleteLabel1Text,Upload complete. +MatterCenterConfig,RowKey330,Matters,CloseIconText,x +MatterCenterConfig,RowKey331,Matters,StartDatePlaceHolder,Start mm/dd/yyyy +MatterCenterConfig,RowKey332,Matters,EndDatePlaceHolder,End mm/dd/yyyy +MatterCenterConfig,RowKey333,Matters,GridColumn8Header,Area of Law +MatterCenterConfig,RowKey334,Matters,AttachmentLoadingText,Loading... +MatterCenterConfig,RowKey335,Matters,GridColumn5Header,Responsible Attorney +MatterCenterConfig,RowKey336,Matters,GridColumn6Header,Sub Area of Law +MatterCenterConfig,RowKey337,Matters,GridColumn7Header,Open Date +MatterCenterConfig,RowKey338,Matters,Dropdown1Item1,All Matters +MatterCenterConfig,RowKey339,Matters,Dropdown1Item2,My Matters +MatterCenterConfig,RowKey340,Matters,Dropdown1Item3,Pinned Matters +MatterCenterConfig,RowKey341,Matters,SearchPlaceholderText,"Search by ID, or matter or client name" +MatterCenterConfig,RowKey342,Matters,NoDataSearchText,"Nothing matches your search term or the filter you selected. Please try again.
If you applied a filter, remove it to get back to your list.
Search suggestions:
  • Make sure all words are spelled correctly
  • Try different keywords
  • Try searching by the matter name or client name
  • Try more general search terms
" +MatterCenterConfig,RowKey343,Matters,GridColumn1Header,Matter +MatterCenterConfig,RowKey344,Matters,GridColumn2Header,Client +MatterCenterConfig,RowKey345,Matters,GridColumn3Header,Client.MatterID +MatterCenterConfig,RowKey346,Matters,GridColumn4Header,Modified Date +MatterCenterConfig,RowKey347,Matters,HeaderText,All Matters +MatterCenterConfig,RowKey348,Matters,EllipsisLink1Text,Upload to this Matter +MatterCenterConfig,RowKey349,Matters,EllipsisLink2Text,View Matter Details +MatterCenterConfig,RowKey350,Matters,EllipsisLink3Text,Go to Matter OneNote +MatterCenterConfig,RowKey351,Matters,EllipsisLink4Text,Pin this matter +MatterCenterConfig,RowKey352,Matters,FlyoutButton1Text,View matter details +MatterCenterConfig,RowKey353,Matters,FlyoutButton2Text,Upload to a matter +MatterCenterConfig,RowKey354,Matters,AttachmentPopupHeaderText,Drag and drop items to folders on the right +MatterCenterConfig,RowKey355,Matters,AttachmentPopupFooterImageCapetion,You can also drag and drop files from your desktop. +MatterCenterConfig,RowKey356,Matters,AttachmentPopupHeaderItem1Text,Items +MatterCenterConfig,RowKey357,Matters,AttachmentPopupHeaderItem2Text,Folders +MatterCenterConfig,RowKey358,Matters,AttachmentPopupHeaderText,Upload to a matter +MatterCenterConfig,RowKey371,Navigation,MenuItem1LinkTitle,Home +MatterCenterConfig,RowKey372,Navigation,MenuItem1LinkTitle,Search matters +MatterCenterConfig,RowKey373,Navigation,MenuItem1LinkTitle,Search documents +MatterCenterConfig,RowKey374,Navigation,NameTitle,Matter +MatterCenterConfig,RowKey375,Navigation,HeaderBarLink1Title,Learn more about matter center +MatterCenterConfig,RowKey376,Navigation,HeaderBarLink2Title,Remove this section +MatterCenterConfig,RowKey377,Navigation,MenuImageOpenTitle,Open App Switcher +MatterCenterConfig,RowKey378,Navigation,MenuImageCloseTitle,Close App Switcher +MatterCenterConfig,RowKey379,Navigation,HeaderBarLink1Text,LearnMore +MatterCenterConfig,RowKey380,Navigation,HomeMenuText,Home +MatterCenterConfig,RowKey381,Navigation,Image1Title,Search matters +MatterCenterConfig,RowKey382,Navigation,Image2Title,Search documents +MatterCenterConfig,RowKey383,Navigation,HelpRequesURL,https://msmatter.sharepoint.com/sites/catalog +MatterCenterConfig,RowKey384,Navigation,FooterLabel,Questions? Contact +MatterCenterConfig,RowKey385,Navigation,MenuImageCaption,menu +MatterCenterConfig,RowKey386,Navigation,MenuImageTitle,Matter center menu +MatterCenterConfig,RowKey387,Navigation,MenuItem1LinkText,Home +MatterCenterConfig,RowKey388,Navigation,MenuItem2LinkText,Matters +MatterCenterConfig,RowKey389,Navigation,MenuItem3LinkText,Documents +MatterCenterConfig,RowKey390,Navigation,LogoImageTitle,Matter center home +MatterCenterConfig,RowKey391,Navigation,ContextualHelpImageTitle,Matter center help +MatterCenterConfig,RowKey392,Navigation,ContextualHelpLabel1,Get to know this view +MatterCenterConfig,RowKey393,Navigation,ContextualHelpLink1Text,Home in Outlook and Word +MatterCenterConfig,RowKey394,Navigation,ContextualHelpLink1URL,https://microsoft.sharepoint.com/teams/celapcconfig/Shared%20Documents/CELA%20Project%20Center%20End%20User%20Guide_24.pdf#Home_in_Outlook_and_Word +MatterCenterConfig,RowKey395,Navigation,ContextualHelpLabel2,How do I get Project Center on my device? +MatterCenterConfig,RowKey396,Navigation,ContextualHelpLink2URL,https://microsoft.sharepoint.com/teams/celapcconfig/Shared%20Documents/CELA%20Project%20Center%20End%20User%20Guide_24.pdf#Enabling_Project_Center +MatterCenterConfig,RowKey397,Navigation,ContextualHelpFooterLink1Label,Matter Center Aisling Support +MatterCenterConfig,RowKey398,Navigation,MatterCenterSupportLink,mailto:support@supportsite.com +MatterCenterConfig,RowKey399,Navigation,ContextualHelpFooterLink1Title,Write an email to support +MatterCenterConfig,RowKey400,Navigation,ContextualHelpHeader,Matter Center For Outlook +MatterCenterConfig,RowKey401,Navigation,ContextualHelpFooterLabel,Questions? Contact +MatterCenterConfig,RowKey402,Navigation,HeaderBarLabel,"Welcome to Matter Center! Upload, share, and save your documents here." +MatterCenterConfig,RowKey403,Navigation,Image1Caption,Matters +MatterCenterConfig,RowKey404,Navigation,Image2Caption,Documents +MatterCenterConfig,RowKey405,Navigation,HeaderBarLink1URL,http://www.microsoft.com/mattercenter +MatterCenterConfig,RowKey406,Navigation,HeaderBarLink2Text,dismiss +MatterCenterConfig,RowKey407,Navigation,Image3Caption,Upload attachments +MatterCenterConfig,RowKey408,Navigation,Image4Caption,Create a new matter +MatterCenterConfig,RowKey409,Navigation,Image5Caption,Go to Matter Center Home +MatterCenterConfig,RowKey410,Navigation,FooterLink1Title,Matter Center Support +MatterCenterConfig,RowKey411,Navigation,FooterLink1Text,Matter Center Support +MatterCenterConfig,RowKey412,Navigation,FooterLink1URL,mailto:lcaweb2@microsoft.com?subject=CELA Project Center Feedback and Support request +MatterCenterConfig,RowKey413,Navigation,Image3Title,Upload documents to a matter +MatterCenterConfig,RowKey414,Navigation,Image4Title,Create a new matter site +MatterCenterConfig,RowKey415,Navigation,Image5Title,Go to the web home page +MatterCenterConfig,RowKey425,Settings,Label1HeaderText,Settings +MatterCenterConfig,RowKey426,Settings,Label2Text,Click on a name to configure matter creation options for that client. +MatterCenterConfig,RowKey427,Settings,Label3Text,Client Name +MatterCenterConfig,RowKey429,Settings,Label5Section1HeaderText,Select default values +MatterCenterConfig,RowKey430,Settings,Label6Section1HeaderText,Default selections will be editable when a new matter is created. +MatterCenterConfig,RowKey431,Settings,Label7DefaultValue1TitleText,Matter Name +MatterCenterConfig,RowKey432,Settings,Label8DefaultValue1TitleDescription,"Enter default text to appear when a new matter is created. For example, a matter name prefix or suffix, or naming convention instructions.This text can be removed or changed when a new matter is created." +MatterCenterConfig,RowKey433,Settings,Label9DefaultValue2TitleText,Matter ID +MatterCenterConfig,RowKey434,Settings,Label10DefaultValue2TitleDescription,"ID numbers must be manually entered when a new matter is created. Enter default text, such as ID prefix or suffix, or numbering instructions. This text can be removed or changed when a new matter is created." +MatterCenterConfig,RowKey435,Settings,Label11DefaultValue3HeaderText,"Set a default matter type by selecting a Practice group, Area of law, and Sub areas of law below." +MatterCenterConfig,RowKey436,Settings,Label12DefaultValue3TitleText,Default to restricting access to an assigned team? +MatterCenterConfig,RowKey437,Settings,Label13DefaultValue3TitleDescription,"This can be changed when a new matter is created. If you select yes, you can either define a default team below or leave the team permission blank." +MatterCenterConfig,RowKey438,Settings,Radio1Option1Text,Yes +MatterCenterConfig,RowKey439,Settings,Radio1Option2Text,No +MatterCenterConfig,RowKey440,Settings,Label14DefaultValue4HeaderText,Assign team permission +MatterCenterConfig,RowKey441,Settings,Label15DefaultValue4Text,Name +MatterCenterConfig,RowKey442,Settings,Label16DefaultValue4Text,Role +MatterCenterConfig,RowKey443,Settings,Label17DefaultValue4Text,Permission level +MatterCenterConfig,RowKey444,Settings,Textbox1DefaultValue4PlaceholdertText,Enter and select names +MatterCenterConfig,RowKey445,Settings,Label18DefaultValue4NoResultsFoundText,No Results Found +MatterCenterConfig,RowKey446,Settings,Label19DefaultValue4AddMoreText,Add More +MatterCenterConfig,RowKey447,Settings,Label20DefaultValue5Text,Include email notification? +MatterCenterConfig,RowKey448,Settings,Label21DefaultValue6Text,Include calendar? +MatterCenterConfig,RowKey449,Settings,Label22DefaultValue7Text,Include tasks? +MatterCenterConfig,RowKey450,Settings,Label23DefaultValue8Text,Include RSS Feeds? +MatterCenterConfig,RowKey451,Settings,Label24Section2HeaderText,Set matter options +MatterCenterConfig,RowKey452,Settings,Label25Section2HeaderText,These settings will not be editable when a new matter is created. +MatterCenterConfig,RowKey453,Settings,Label26Section2Text,Make the matter description field required? +MatterCenterConfig,RowKey454,Settings,Label27Section2DescriptionText,Selecting No will allow new matters to be saved without a description +MatterCenterConfig,RowKey455,Settings,Label28Section2Text,Do matters need conflict check data? +MatterCenterConfig,RowKey456,Settings,Label29Section2DescriptionText,Selecting No will remove the conflict check declaration fields from new matters +MatterCenterConfig,RowKey457,Settings,Label30Section2Text,Show or hide role? +MatterCenterConfig,RowKey458,Settings,Label31Section2Text,Show matter id? +MatterCenterConfig,RowKey459,Settings,Label32Section2Text,Matter Id Configuration +MatterCenterConfig,RowKey460,Settings,Radio2Option1Text,Guid +MatterCenterConfig,RowKey461,Settings,Radio2Option2Text,Date Time +MatterCenterConfig,RowKey462,Settings,Radio2Option3Text,Custom +MatterCenterConfig,RowKey463,Settings,ButtonSaveText,Save +MatterCenterConfig,RowKey464,Settings,ButtonCancelText,Cancel +MatterCenterConfig,RowKey465,Settings,ImageLoadingAltText,Loading... +MatterCenterConfig,RowKey466,Settings,Label4Selection1HeaderText,"This page shows the current settings for this client's new matters. The first section allows you to set new matter default selections, which can be changed when a matter is created. The second section defines settings that can not be changed when a new matter is created. No changes are required, and any changes made will not affect existing matters." +MatterCenterConfig,RowKey467,Settings,DeleteTitleText,Delete +MatterCenterConfig,RowKey468,Settings,Radio2Option2ValueText,DateTime +MatterCenterConfig,RowKey469,Settings,Label33Section2Text,Your changes have been saved. Go back to +MatterCenterConfig,RowKey470,Settings,Label34Section2Text,Clients +MatterCenterConfig,RowKey481,MatterLanding,Label1Tab1HeaderText,Matter Profile +MatterCenterConfig,RowKey482,MatterLanding,Label2Tab2HeaderText,Matter Description +MatterCenterConfig,RowKey483,MatterLanding,Label3Tab1Column1Text,Client Name +MatterCenterConfig,RowKey484,MatterLanding,Label4Tab1Column2Text,Client & Matter ID +MatterCenterConfig,RowKey485,MatterLanding,Label5Tab1Column3Text,Practice Group +MatterCenterConfig,RowKey486,MatterLanding,Label6Tab1Column4Text,Area of Law +MatterCenterConfig,RowKey487,MatterLanding,Label7Tab1Column5Text,Responsible Attorney +MatterCenterConfig,RowKey488,MatterLanding,Label8Tab1Section2HeaderText,Matter Library +MatterCenterConfig,RowKey489,MatterLanding,MenuImageUpperCaption,Matter Center +MatterCenterConfig,RowKey490,MatterLanding,MenuImageLowerCaption,for Office 365 +MatterCenterConfig,RowKey491,MatterLanding,Menu1Option1Text,Matters +MatterCenterConfig,RowKey492,MatterLanding,Menu1Option2Text,Documents +MatterCenterConfig,RowKey493,MatterLanding,Menu1Option3Text,Settings +MatterCenterConfig,RowKey502,DocumentDetails,Label1HeaderText,File Name +MatterCenterConfig,RowKey503,DocumentDetails,Label2Section2HeaderText,File Properties +MatterCenterConfig,RowKey504,DocumentDetails,Label3Section2Column1Text,File title +MatterCenterConfig,RowKey505,DocumentDetails,Label4Section2Column2Text,Client +MatterCenterConfig,RowKey506,DocumentDetails,Label5Section2Column3Text,Matter +MatterCenterConfig,RowKey507,DocumentDetails,Label6Section2Column4Text,Client.MatterID +MatterCenterConfig,RowKey508,DocumentDetails,Label7Section2Column5Text,Document ID +MatterCenterConfig,RowKey509,DocumentDetails,Label8Section2Column6Text,Checked out to +MatterCenterConfig,RowKey510,DocumentDetails,Label9Section2Column7Text,Author +MatterCenterConfig,RowKey511,DocumentDetails,Label10Section2Column8Text,Date created +MatterCenterConfig,RowKey512,DocumentDetails,Label11Section2Column9Text,Practice group +MatterCenterConfig,RowKey513,DocumentDetails,Label12Section2Column10Text,Area of law: +MatterCenterConfig,RowKey514,DocumentDetails,Label13Section2Column11Text,Sub area of law +MatterCenterConfig,RowKey515,DocumentDetails,Label14Section2Column12Text,File type +MatterCenterConfig,RowKey516,DocumentDetails,Label15Section2Column13Text,File size +MatterCenterConfig,RowKey517,DocumentDetails,Label16Section2Column14Text,File access +MatterCenterConfig,RowKey518,DocumentDetails,Label17Section2HeaderText,Version history +MatterCenterConfig,RowKey519,DocumentDetails,Label18Section2Column1Text,Version +MatterCenterConfig,RowKey520,DocumentDetails,Label19Section2Column2Text,Modified +MatterCenterConfig,RowKey521,DocumentDetails,Label20Section2Column3Text,Modified By +MatterCenterConfig,RowKey522,DocumentDetails,Label21MenuHeaderOption1Text,open +MatterCenterConfig,RowKey523,DocumentDetails,Label22MenuHeaderOption2Text,download +MatterCenterConfig,RowKey524,DocumentDetails,Label23MenuHeaderOption3Text,share +MatterCenterConfig,RowKey525,DocumentDetails,Label24MenuHeaderOption4Text,check in +MatterCenterConfig,RowKey526,DocumentDetails,Label25MenuHeaderOption5Text,check out +MatterCenterConfig,RowKey527,DocumentDetails,Label26MenuHeaderOption6Text,send link +MatterCenterConfig,RowKey528,DocumentDetails,Label27MenuHeaderOption7Text,pin +MatterCenterConfig,RowKey529,DocumentDetails,Label28MenuHeaderOption8Text,unpin +MatterCenterConfig,RowKey530,DocumentDetails,Label1TabTitleText,Document Details +MatterCenterConfig,RowKey531,DocumentDetails,Link1ErrorDetailsCaptionText,Click here for details +MatterCenterConfig,RowKey532,DocumentDetails,Link2AllDocumentText,Go to all documents +MatterCenterConfig,RowKey533,DocumentDetails,LabelNoPreviewText,There is no preview for this document +MatterCenterConfig,RowKey534,DocumentDetails,ImgNoPreviewSuppoertText,Preview not supported... +MatterCenterConfig,RowKey538,DocumentDetails,Link3ViewMoreText,View More +MatterCenterConfig,RowKey540,MatterLanding,ErrMsg1NoTask,There are no tasks created +MatterCenterConfig,RowKey541,MatterLanding,ErrMsg2FetchTask,Error occurred while trying to fetch tasks +MatterCenterConfig,RowKey542,MatterLanding,ErrMsg3CreateEvent,Error occurred while trying to fetch events +MatterCenterConfig,RowKey543,MatterLanding,ErrMsg4ActiveEvents,There are no active events +MatterCenterConfig,RowKey544,MatterLanding,ErrMsg5NoMatterDescription,There is no description for this matter +MatterCenterConfig,RowKey545,MatterLanding,ErrMsg6ForPinUnpinMatters,Error while trying to retrieve matter pin/unpin status +MatterCenterConfig,RowKey546,MatterLanding,ErrMsg7MatterInformation,Error while trying to retrieve matter information +MatterCenterConfig,RowKey547,MatterLanding,ErrMsg8MatterDescription,Error while trying to retrieve matter description +MatterCenterConfig,RowKey548,MatterLanding,ErrMsg9NoPinUnpinMatter,Error while trying to pin/unpin matter +MatterCenterConfig,RowKey549,MatterLanding,Label1MenuText,Matter Name +MatterCenterConfig,RowKey550,MatterLanding,Label9Section1Text,Matter Id +MatterCenterConfig,RowKey551,MatterLanding,Label10Section1Text,Client Id +MatterCenterConfig,RowKey552,MatterLanding,Label11Section1Text,Description +MatterCenterConfig,RowKey553,MatterLanding,Label12ManageUserTitleText,Manage users +MatterCenterConfig,RowKey554,MatterLanding,Label13GotoOnnoteTitleText,Go to Matter OneNote +MatterCenterConfig,RowKey555,MatterLanding,Label14TaskeTitleText,Task +MatterCenterConfig,RowKey556,MatterLanding,Label15CalenderTitleText,Calendar Events +MatterCenterConfig,RowKey557,MatterLanding,Label16RSSFeedTitleText,Related News (RSS) +MatterCenterConfig,RowKey558,MatterLanding,Label17EditTitleText,View / Edit +MatterCenterConfig,RowKey561,MatterLanding,Label18MenuText,My Matters +MatterCenterConfig,RowKey562,MatterLanding,Label19Section4Text,Matter Library +MatterCenterConfig,RowKey570,DocumentDetails,Label135MenuHead,OneDrive +MatterCenterConfig,RowKey571,DocumentDetails,Label36MenuHeaderOption7Text,Send to OneDrive diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psd1 b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psd1 new file mode 100644 index 00000000..b99c6613 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psd1 @@ -0,0 +1,40 @@ +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'ManageTableStorageWithCsvFile' + +# Version number of this module. +ModuleVersion = '1.0' + +# ID used to uniquely identify this module +GUID = '587ec309-7f25-4f13-b360-03db37a4d80d' + +# Author of this module +Author = 'OneScript Team' + +# Company or vendor of this module +CompanyName = 'Microsoft' + +# Copyright statement for this module +Copyright = '(c) 2015 Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'The module contains two advanced functions that can be used to import/export data with Excel to/from Azure table storage.' + +# Minimum version of the Windows PowerShell engine required by this module +PowerShellVersion = '1.0' + +# Functions to export from this module +FunctionsToExport = '*' + +# Cmdlets to export from this module +CmdletsToExport = '*' + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module +AliasesToExport = '*' + +} + diff --git a/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psm1 b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psm1 new file mode 100644 index 00000000..e02e17c6 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Scripts/ManageTableStorageWithCsvFile/ManageTableStorageWithCsvFile.psm1 @@ -0,0 +1,230 @@ +#--------------------------------------------------------------------------------- +#The sample scripts are not supported under any Microsoft standard support +#program or service. The sample scripts are provided AS IS without warranty +#of any kind. Microsoft further disclaims all implied warranties including, +#without limitation, any implied warranties of merchantability or of fitness for +#a particular purpose. The entire risk arising out of the use or performance of +#the sample scripts and documentation remains with you. In no event shall +#Microsoft, its authors, or anyone else involved in the creation, production, or +#delivery of the scripts be liable for any damages whatsoever (including, +#without limitation, damages for loss of business profits, business interruption, +#loss of business information, or other pecuniary loss) arising out of the use +#of or inability to use the sample scripts or documentation, even if Microsoft +#has been advised of the possibility of such damages +#--------------------------------------------------------------------------------- + +#requires -Version 3.0 + +Function Export-AzureTableStorage +{ +<# + .SYNOPSIS + This is an advanced function which can be used to export the entity of azure table storage. + .DESCRIPTION + This is an advanced function which can be used to export the entity of azure table storage. + .PARAMETER StorageAccountName + Spcifies the name of storage account. + .PARAMETER TableName + Specifies the name of table storage. + .PARAMETER Path + Specifies the path to the item that will save it to a csv file. + .EXAMPLE + C:\PS> Export-AzureTableStorage -StorageAccountName "storageaccount" -TableName SchemasTable -Path C:\Tables\ + + Successfully export the table storage to csv file. + + This command shows how to export the entities of table storage and saves them to a csv file named 'ShemasTable'. +#> + [CmdletBinding(SupportsShouldProcess=$true)] + Param + ( + [Parameter(Mandatory=$true)] + [String]$StorageAccountName, + [Parameter(Mandatory=$true)] + [String]$TableName, + [Parameter(Mandatory=$true)] + [String]$Path + ) + + #Check if Windows Azure PowerShell Module is avaliable + If((Get-Module -ListAvailable Azure) -eq $null) + { + Write-Warning "Windows Azure PowerShell module not found! Please install from http://www.windowsazure.com/en-us/downloads/#cmd-line-tools" + } + Else + { + If($StorageAccountName) + { + Get-AzureRmStorageAccount -ResourceGroupName "test26aug" -Name $StorageAccountName -verbose -ErrorAction SilentlyContinue ` + -ErrorVariable IsExistStorageError | Out-Null + + #Check if storage account is exist + If($IsExistStorageError.Exception -eq $null) + { + If($TableName) + { + Get-AzureStorageTable -Name $TableName -ErrorAction SilentlyContinue ` + -ErrorVariable IsExistTableError | Out-Null + + #Check if table is exist + If($IsExistTableError.Exception -eq $null) + { + #Specify a Windows Azure Storage Library path + $StorageLibraryPath = "$env:SystemDrive\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\ref\Microsoft.WindowsAzure.Storage.dll" + + #Getting Azure storage account key + $Keys = Get-AzureStorageKey -StorageAccountName $StorageAccountName + $StorageAccountKey = "yDOE9PA2C/IDy0EL50eMOY3AnUkBN7qXn4AtXDYtJg6Y9xnZtokBugYhKoVn3fMfliYtm/uOU+ry5mGNaJdwIA==" + + #Loading Windows Azure Storage Library for .NET. + Write-Verbose -Message "Loading Windows Azure Storage Library from $StorageLibraryPath" + [Reflection.Assembly]::LoadFile("$StorageLibraryPath") | Out-Null + + $Creds = New-Object Microsoft.WindowsAzure.Storage.Auth.StorageCredentials("$StorageAccountName","$StorageAccountKey") + $CloudStorageAccount = New-Object Microsoft.WindowsAzure.Storage.CloudStorageAccount($Creds, $true) + $CloudTableClient = $CloudStorageAccount.CreateCloudTableClient() + $Table = $CloudTableClient.GetTableReference($TableName) + + $Query = New-Object "Microsoft.WindowsAzure.Storage.Table.TableQuery" + $Datas = $Table.ExecuteQuery($Query) + + $ExportObjs = @() + + Foreach($Data in $Datas) + { + + $Obj = New-Object PSObject + + $Obj | Add-Member -Name PartitionKey -Value $Data.PartitionKey -MemberType NoteProperty + $Obj | Add-Member -Name RowKey -Value $Data.RowKey -MemberType NoteProperty + + $Data.Properties.Keys | Foreach{$Value = $data.Properties[$_].PropertyAsObject; + $Obj | Add-Member -Name $_ -Value $value -MemberType NoteProperty; } + + $ExportObjs += $Obj + } + + #Export the entities of table storage to csv file. + $ExportObjs | Export-Csv "$Path\$TableName.csv" -NoTypeInformation + Write-Host "Successfully export the table storage to csv file." + + } + Else + { + Write-Warning "Cannot find blob '$TableName' because it does not exist. Please make sure thar the name of table is correct." + } + } + } + Else + { + Write-Warning "Cannot find storage account '$StorageAccountName' because it does not exist. Please make sure thar the name of storage is correct." + } + } + } +} + + + +Function Import-AzureTableStorage +{ +<# + .SYNOPSIS + This is an advanced function which can be used to import the entities of csv file into a table storage. + .DESCRIPTION + This is an advanced function which can be used to import the entities of csv file into a table storage. + .PARAMETER StorageAccountName + Spcifies the name of storage account. + .PARAMETER TableName + Specifies the name of table storage. + .PARAMETER Path + Specifies the file path of the csv to be imported. This parameter is required. + + .EXAMPLE + C:\PS> Import-AzureTableStorage -StorageAccountName "storageaccount" -TableName SchemasTable2 -Path C:\Tables\SchemasTable.csv + + Successfully Imported entities of table storage named 'SchemasTable'. + + This command shows how to import the entities of the csv file into a table storage. +#> + [CmdletBinding(SupportsShouldProcess=$true)] + Param + ( + [Parameter(Mandatory=$true)] + [String]$ResourceGroupName, + [Parameter(Mandatory=$true)] + [String]$StorageAccountName, + [Parameter(Mandatory=$true)] + [String]$StorageAccountKey, + [Parameter(Mandatory=$true)] + [String]$TableName, + [Parameter(Mandatory=$true)] + [String]$Path + + ) + + #Check if Windows Azure PowerShell Module is avaliable + If((Get-Module -ListAvailable Azure) -eq $null) + { + Write-Warning "Windows Azure PowerShell module not found! Please install from http://www.windowsazure.com/en-us/downloads/#cmd-line-tools" + } + Else + { + If($StorageAccountName) + { + Get-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName -ErrorAction SilentlyContinue ` + -ErrorVariable IsExistStorageError | Out-Null + + #Check if storage account is exist + If($IsExistStorageError.Exception -eq $null) + { + If($TableName) + { + #Specify a Windows Azure Storage Library path + $StorageLibraryPath = "$env:SystemDrive\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\ref\Microsoft.WindowsAzure.Storage.dll" + + #Getting Azure storage account key + + $Creds = New-Object Microsoft.WindowsAzure.Storage.Auth.StorageCredentials("$StorageAccountName","$StorageAccountKey") + $CloudStorageAccount = New-Object Microsoft.WindowsAzure.Storage.CloudStorageAccount($Creds, $true) + $CloudTableClient = $CloudStorageAccount.CreateCloudTableClient() + $Table = $CloudTableClient.GetTableReference($TableName) + + #Create a Table Storage + Write-Verbose "Creating a table storage named '$TableName'." + #Try to create table if it does not exist + $Table.CreateIfNotExists() | Out-Null + + If(Test-Path -Path $Path) + { + $CsvContents = Import-Csv -Path $Path + $CsvHeaders = ($CsvContents[0] | Get-Member -MemberType NoteProperty).Name | Where{$_ -ne "RowKey" -and $_ -ne "PartitionKey"} + + Foreach($CsvContent in $CsvContents) + { + $PartitionKey = $CsvContent.PartitionKey + $RowKey = $CsvContent.RowKey + $Entity = New-Object "Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity" "$PartitionKey", "$RowKey" + + Foreach($CsvHeader in $CsvHeaders) + { + $Value = $CsvContent.$CsvHeader + $Entity.Properties.Add($CsvHeader, $Value) + } + Write-Verbose "Inserting the entity into table storage." + $result = $Table.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::Insert($Entity)) + } + Write-Host "Successfully Imported entities of table storage named '$TableName'." + } + Else + { + Write-Warning "The path does not exist, please check it is correct." + } + } + } + Else + { + Write-Warning "Cannot find storage account '$StorageAccountName' because it does not exist. Please make sure thar the name of storage is correct." + } + } + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Templates/template.json b/tree/master/cloud/src/solution/Deployment/Templates/template.json new file mode 100644 index 00000000..2f46736e --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Templates/template.json @@ -0,0 +1,220 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "Tenant_id": { + "defaultValue": "", + "type": "String" + }, + "Redis_cache_name": { + "defaultValue": "MatterCenterCache", + "type": "String" + }, + "autoscalesettings_name": { + "defaultValue": "MatterCenterWebPlan", + "type": "String" + }, + "components_AppInsights_name": { + "defaultValue": "MatterCenterInsights", + "type": "String" + }, + "vaults_KeyVault_name": { + "defaultValue": "MatterCenterKeyVault", + "type": "String" + }, + "storageAccount_name": { + "defaultValue": "mattercenterstorage", + "type": "String" + }, + "serverfarms_WebPlan_name": { + "defaultValue": "MatterCenterWebPlan", + "type": "String" + }, + "webSite_name": { + "defaultValue": "MatterCenterWeb", + "type": "String" + }, + "Web_ADApp_Name": { + "defaultValue": "MatterCenterWebApp", + "type": "String" + }, + "KeyVault_ADApp_Name": { + "defaultValue": "MatterCenterKVApp", + "type": "String" + }, + "KeyVault_certificate_expiryDate": { + "defaultValue": "2018-04-11", + "type": "String" + } + }, + "variables": {}, + "resources": [ + + { + "type": "microsoft.insights/autoscalesettings", + "name": "[parameters('autoscalesettings_name')]", + "apiVersion": "2014-04-01", + "location": "westus", + "properties": { + "profiles": [ + { + "name": "Default", + "capacity": { + "minimum": "1", + "maximum": "2", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "CpuPercentage", + "metricNamespace": "", + "metricResourceUri": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT10M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 80 + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT10M" + } + }, + { + "metricTrigger": { + "metricName": "CpuPercentage", + "metricNamespace": "", + "metricResourceUri": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT1H", + "timeAggregation": "Average", + "operator": "LessThan", + "threshold": 60 + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT1H" + } + } + ] + } + ], + "enabled": false, + "name": "[parameters('autoscalesettings_name')]", + "targetResourceUri": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]" + }, + "resources": [], + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]" + ] + }, + { + "type": "Microsoft.Insights/components", + "kind": "web", + "name": "[parameters('components_AppInsights_name')]", + "apiVersion": "2014-04-01", + "location": "Central US", + "properties": { + "ApplicationId": "[parameters('components_AppInsights_name')]" + }, + "resources": [], + "dependsOn": [] + }, + { + "type": "Microsoft.KeyVault/vaults", + "name": "[parameters('vaults_KeyVault_name')]", + "apiVersion": "2015-06-01", + "location": "West US", + "tags": {}, + "properties": { + "sku": { + "family": "A", + "name": "Standard" + }, + "tenantId": "[parameters('Tenant_id')]", + "accessPolicies": [ + + ], + "enabledForDeployment": false + }, + "resources": [], + "dependsOn": [] + }, + { + "type": "Microsoft.Storage/storageAccounts", + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "kind": "Storage", + "name": "[parameters('storageAccount_name')]", + "apiVersion": "2016-01-01", + "location": "westus", + "tags": {}, + "properties": {}, + "resources": [], + "dependsOn": [] + }, + { + "type": "Microsoft.Web/serverfarms", + "sku": { + "name": "F1", + "tier": "Free", + "size": "F1", + "family": "F", + "capacity": 0 + }, + "name": "[parameters('serverfarms_WebPlan_name')]", + "apiVersion": "2015-08-01", + "location": "West US", + "properties": { + "name": "[parameters('serverfarms_WebPlan_name')]", + "numberOfWorkers": 0 + }, + "resources": [], + "dependsOn": [] + }, + { + "type": "Microsoft.Web/sites", + "name": "[parameters('webSite_name')]", + "apiVersion": "2015-08-01", + "location": "West US", + "properties": { + "name": "[parameters('webSite_name')]", + "hostNames": [ + "[concat(parameters('webSite_name'),'.azurewebsites.net')]" + ], + "enabledHostNames": [ + "[concat(parameters('webSite_name'),'.azurewebsites.net')]", + "[concat(parameters('webSite_name'),'.scm.azurewebsites.net')]" + ], + "hostNameSslStates": [ + { + "name": "[concat(parameters('webSite_name'),'.azurewebsites.net')]", + "sslState": 0, + "thumbprint": null, + "ipBasedSslState": 0 + }, + { + "name": "[concat(parameters('webSite_name'),'.scm.azurewebsites.net')]", + "sslState": 0, + "thumbprint": null, + "ipBasedSslState": 0 + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]" + }, + "resources": [], + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_WebPlan_name'))]" + ] + } + ] +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Templates/template.parameters.json b/tree/master/cloud/src/solution/Deployment/Templates/template.parameters.json new file mode 100644 index 00000000..46723555 --- /dev/null +++ b/tree/master/cloud/src/solution/Deployment/Templates/template.parameters.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "Redis_cache_name": { + "value": "MatterCenterAug2614" + }, + "autoscalesettings_name": { + "value": "MatterCenterAug2614" + }, + "components_AppInsights_name": { + "value": "MatterCenterAug2614" + }, + "vaults_KeyVault_name": { + "value": "MatterCenterAug2614" + }, + "storageAccount_name": { + "value": "mattercenteraug2614" + }, + "serverfarms_WebPlan_name": { + "value": "MatterCenterAug2614" + }, + "webSite_name": { + "value": "MatterCenterAug2614" + }, + "Tenant_id": { + "value": "3c4562ca-39a4-4d8b-91ff-6d3eefab5c1d" + }, + "Web_ADApp_Name": { + "value": "MatterCenterWebAppAD1" + }, + "KeyVault_ADApp_Name": { + "value": "MatterCenterKVApp1" + }, + "KeyVault_certificate_expiryDate": { + "value": "2018-04-11" + } + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Deployment/Tools/AzCopy.exe b/tree/master/cloud/src/solution/Deployment/Tools/AzCopy.exe new file mode 100644 index 00000000..486f6a40 Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/AzCopy.exe differ diff --git a/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Edm.dll b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Edm.dll new file mode 100644 index 00000000..12d07d3b Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Edm.dll differ diff --git a/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.OData.dll b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.OData.dll new file mode 100644 index 00000000..884b52a6 Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.OData.dll differ diff --git a/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Services.Client.dll b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Services.Client.dll new file mode 100644 index 00000000..65c265c4 Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.Data.Services.Client.dll differ diff --git a/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.DataMovement.dll b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 00000000..589e1a94 Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.dll b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 00000000..692d64f6 Binary files /dev/null and b/tree/master/cloud/src/solution/Deployment/Tools/Microsoft.WindowsAzure.Storage.dll differ diff --git a/tree/master/cloud/src/solution/ManagedColumn.cs b/tree/master/cloud/src/solution/ManagedColumn.cs new file mode 100644 index 00000000..466348b2 --- /dev/null +++ b/tree/master/cloud/src/solution/ManagedColumn.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class ManagedColumn + { + /// + /// Gets or sets the name of the term (practice group). + /// + /// The name of the term. + public string TermName + { + get; + set; + } + + /// + /// Gets or sets the id of the term (practice group). This is a GUID value (string representation) and is used as the Id property of the Term. + /// + /// The id of the term. + public string Id + { + get; + set; + } + + /// + /// Gets or sets the WssId of the term (practice group). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. + /// + /// The WssId of the term. + public int WssId + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Constants/Constants.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Constants/Constants.cs deleted file mode 100644 index 72fb8ef6..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Constants/Constants.cs +++ /dev/null @@ -1,143 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.DataLayer -// Author : v-swmirj -// Created : 06-16-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines constants used under current project. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.DataLayer -{ - #region using - using System.Collections.Generic; - #endregion - - static class Constants - { - - /// - /// Holds the relative location for OneNote file that is uploaded upon matter creation - /// - internal const string ONENOTERELATIVEFILEPATH = "~/Open Notebook.onetoc2"; - - /// - /// Constant required for extension for OneNote table of content - /// - internal const string EXTENSIONONENOTETABLEOFCONTENT = ".onetoc2"; - - /// - /// The true constant - /// - internal const string TRUE = "true"; - - /// - /// The false constant - /// - internal const string FALSE = "false"; - - /// - /// The colon constant - /// - internal const string COLON = ":"; - - /// - /// The forward slash constant - /// - internal const string FORWARDSLASH = "/"; - /// - /// Web Query string - /// - internal const string WEBSTRING = "?Web=1"; - /// - /// The dollar constant - /// - internal const string DOLLAR = "$"; - - /// - /// Modified date column - /// - internal const string MODIFIED_DATE_COLUMN = "Modified"; - - /// - /// The pipe constant - /// - internal const string PIPE = "|"; - - /// - /// Zone index to be used while creating matter page - /// - internal const int ZONEINDEX = 1; - - /// - /// Title column for list item - /// - internal const string TITLE = "Title"; - } - - public class ListInformation - { - public string name - { - get; - set; - } - public string description - { - get; - set; - } - - public string templateType - { - get; - set; - } - - public bool isContentTypeEnable - { - get; - set; - } - - public IList folderNames - { - get; - set; - } - - public VersioningInfo versioning - { - get; - set; - } - - public string Path - { - get; - set; - } - } - - public class VersioningInfo - { - public bool EnableVersioning - { - get; - set; - } - public bool EnableMinorVersions - { - get; - set; - } - public bool ForceCheckout - { - get; - set; - } - - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/DataLayer.snk b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/DataLayer.snk deleted file mode 100644 index 2dd3dd4d..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/DataLayer.snk and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/GlobalSuppressions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/GlobalSuppressions.cs deleted file mode 100644 index e8224f34..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/GlobalSuppressions.cs and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Lists.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Lists.cs deleted file mode 100644 index 99ecf69f..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Lists.cs +++ /dev/null @@ -1,669 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.DataLayer -// Author : v-rijadh -// Created : 06-16-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains methods related to SharePoint list object. -// *********************************************************************** - -//// Keeping using System over here because of usage of CLSComplaint attribute for namespace -using System; -[assembly: CLSCompliant(false)] -namespace Microsoft.Legal.MatterCenter.DataLayer -{ - #region using - using Microsoft.SharePoint.Client; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Globalization; - using System.Linq; - using System.Web; - using IO = System.IO; - #endregion - - /// - /// Performs operation to update SharePoint list - /// - public static class Lists - { - /// - /// Function to create document library for Matter and OneNote - /// - /// Client Context - /// List information - /// Success flag - - public static bool Create(ClientContext clientContext, ListInformation listInfo) - { - bool result = true; - if (null != clientContext && null != listInfo && !string.IsNullOrWhiteSpace(listInfo.name)) - { - Web web = clientContext.Web; - ListTemplateCollection listTemplates = web.ListTemplates; - ListCreationInformation creationInfo = new ListCreationInformation(); - creationInfo.Title = listInfo.name; - creationInfo.Description = listInfo.description; - // To determine changes in URL we specified below condition as this function is common - if (!string.IsNullOrWhiteSpace(listInfo.Path)) - { - creationInfo.Url = listInfo.Path; - } - if (!string.IsNullOrWhiteSpace(listInfo.templateType)) - { - string templateType = listInfo.templateType; - clientContext.Load(listTemplates, item => item.Include(currentTemplate => currentTemplate.Name, currentTemplate => currentTemplate.ListTemplateTypeKind).Where(selectedTemplate => selectedTemplate.Name == templateType)); - clientContext.ExecuteQuery(); - if (null != listTemplates && 0 < listTemplates.Count) - { - creationInfo.TemplateType = listTemplates.FirstOrDefault().ListTemplateTypeKind; - } - else - { - result = false; - } - } - else - { - creationInfo.TemplateType = (int)ListTemplateType.DocumentLibrary; - } - if (result) - { - List list = web.Lists.Add(creationInfo); - list.ContentTypesEnabled = listInfo.isContentTypeEnable; - if (null != listInfo.folderNames && listInfo.folderNames.Count > 0) - { - list = Lists.AddFolders(clientContext, list, listInfo.folderNames); - } - if (null != listInfo.versioning) - { - list.EnableVersioning = listInfo.versioning.EnableVersioning; - list.EnableMinorVersions = listInfo.versioning.EnableMinorVersions; - list.ForceCheckout = listInfo.versioning.ForceCheckout; - } - list.Update(); - clientContext.Load(list, l => l.DefaultViewUrl); - clientContext.ExecuteQuery(); - result = true; - } - } - return result; - } - - /// - /// Creates the OneNote in List/Library - /// - /// Client Context - /// Client URL - /// OneNote URL - /// OneNote Title - /// List/library name - /// - public static string AddOneNote(ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle) - { - string returnValue = String.Empty; - if (null != clientContext && !string.IsNullOrWhiteSpace(clientAddressPath) && !string.IsNullOrWhiteSpace(oneNoteLocation) && !string.IsNullOrWhiteSpace(listName)) - { - Uri clientUrl = new Uri(clientAddressPath); - string oneNotePath = HttpContext.Current.Server.MapPath(Constants.ONENOTERELATIVEFILEPATH); - byte[] oneNoteFile = System.IO.File.ReadAllBytes(oneNotePath); - Web web = clientContext.Web; - Microsoft.SharePoint.Client.File file = web.GetFolderByServerRelativeUrl(oneNoteLocation).Files.Add(new FileCreationInformation() - { - Url = string.Concat(listName, Constants.EXTENSIONONENOTETABLEOFCONTENT), - Overwrite = true, - ContentStream = new IO.MemoryStream(oneNoteFile) - }); - web.Update(); - clientContext.Load(file); - clientContext.ExecuteQuery(); - ListItem oneNote = file.ListItemAllFields; - oneNote["Title"] = oneNoteTitle; - oneNote.Update(); - returnValue = string.Concat(clientUrl.Scheme, Constants.COLON, Constants.FORWARDSLASH, Constants.FORWARDSLASH, clientUrl.Authority, file.ServerRelativeUrl, Constants.WEBSTRING); - } - return returnValue; - } - - /// - /// Adds all the folders from Content type in matter library. - /// - /// Client context - /// List of folders - /// The folder names. - /// Microsoft SharePoint Client List - public static List AddFolders(ClientContext clientContext, List list, IList folderNames) - { - if (null != clientContext && null != list && null != folderNames) - { - FolderCollection listFolders = list.RootFolder.Folders; - Folder listRootFolder = list.RootFolder; - clientContext.Load(listFolders); - clientContext.ExecuteQuery(); - if (0 < folderNames.Count) - { - foreach (string folderName in folderNames) - { - // Check for empty folder names - if (!string.IsNullOrEmpty(folderName)) - { - listFolders.Add(folderName); - listRootFolder.Update(); - } - } - list.Update(); - } - } - return list; - } - - /// - /// Adds list item in specified list. - /// - /// Client context - /// Name of the list - /// List of column names - /// Values for corresponding columns - /// String stating success flag - public static bool AddItem(ClientContext clientContext, List list, IList columns, IList values) - { - bool result = false; - if (null != clientContext && null != list && null != columns && null != values && columns.Count == values.Count) - { - // Add the Matter URL in list - ListItemCreationInformation listItemCreateInfo = new ListItemCreationInformation(); - ListItem newListItem = list.AddItem(listItemCreateInfo); - int position = 0; - foreach (string column in columns) - { - newListItem[column] = values[position++]; - } - ///// Update the list - newListItem.Update(); - clientContext.ExecuteQuery(); - result = true; - } - return result; - } - - /// - /// Breaks the permissions of the list. - /// - /// Client context - /// Name of list - /// Flag to copy permission from parent - /// Success flag - public static bool BreakPermission(ClientContext clientContext, string libraryName, bool isCopyRoleAssignment) - { - bool flag = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(libraryName)) - { - try - { - List list = clientContext.Web.Lists.GetByTitle(libraryName); - clientContext.Load(list, l => l.HasUniqueRoleAssignments); - clientContext.ExecuteQuery(); - - if (!list.HasUniqueRoleAssignments) - { - list.BreakRoleInheritance(isCopyRoleAssignment, true); - list.Update(); - clientContext.Load(list); - clientContext.ExecuteQuery(); - flag = true; - } - } - catch (Exception) - { - throw; // This will transfer control to catch block of parent function. - } - } - return flag; - } - - /// - /// Sets permissions for the list. - /// - /// Client Context - /// List of User emails to give permission - /// Permissions for the users - /// List name - /// String stating success flag - public static bool SetPermission(ClientContext clientContext, IList> AssignUserEmails, IList permissions, string listName) - { - bool result = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) - { - ClientRuntimeContext clientRuntimeContext = clientContext; - try - { - List list = clientContext.Web.Lists.GetByTitle(listName); - clientContext.Load(list, l => l.HasUniqueRoleAssignments); - clientContext.ExecuteQuery(); - if (list.HasUniqueRoleAssignments && null != permissions && null != AssignUserEmails && permissions.Count == AssignUserEmails.Count) - { - int position = 0; - foreach (string roleName in permissions) - { - IList assignUserEmails = AssignUserEmails[position]; - if (!string.IsNullOrWhiteSpace(roleName) && null != assignUserEmails) - { - RoleDefinition roleDefinition = clientContext.Web.RoleDefinitions.GetByName(roleName); - foreach (string user in assignUserEmails) - { - if (!string.IsNullOrWhiteSpace(user)) - { - /////get the user object - Principal userPrincipal = clientContext.Web.EnsureUser(user.Trim()); - /////create the role definition binding collection - RoleDefinitionBindingCollection roleDefinitionBindingCollection = new RoleDefinitionBindingCollection(clientRuntimeContext); - /////add the role definition to the collection - roleDefinitionBindingCollection.Add(roleDefinition); - /////create a RoleAssigment with the user and role definition - list.RoleAssignments.Add(userPrincipal, roleDefinitionBindingCollection); - } - } - /////execute the query to add everything - clientRuntimeContext.ExecuteQuery(); - } - position++; - } - ///// Success. Return a success code - result = true; - } - } - catch (Exception) - { - result = false; - } - } - return result; - } - - /// - /// Validates and breaks the item level permission for the specified list item under the list/library. - /// - /// Client Context - /// List name - /// Unique list item id to break item level permission - /// Flag to copy permission from parent - /// String stating success flag - public static bool BreakItemPermission(ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment) - { - bool result = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) - { - ListItem listItem = clientContext.Web.Lists.GetByTitle(listName).GetItemById(listItemId); - clientContext.Load(listItem, item => item.HasUniqueRoleAssignments); - clientContext.ExecuteQuery(); - - if (!listItem.HasUniqueRoleAssignments) - { - listItem.BreakRoleInheritance(isCopyRoleAssignment, true); - listItem.Update(); - clientContext.ExecuteQuery(); - result = true; - } - } - return result; - } - - /// - /// Set permission to the specified list item - /// - /// Client context object - /// User emails to give permission - /// List name - /// Unique list item id to break item level permission - /// Permissions for the users - /// Status of the unique item level permission assignment operation - public static bool SetItemPermission(ClientContext clientContext, IList> AssignUserEmails, string listName, int listItemId, IList permissions) - { - bool result = false; - if (null != clientContext) - { - ClientRuntimeContext clientRuntimeContext = clientContext; - ListItem listItem = clientContext.Web.Lists.GetByTitle(listName).GetItemById(listItemId); - clientContext.Load(listItem, item => item.HasUniqueRoleAssignments); - clientContext.ExecuteQuery(); - if (listItem.HasUniqueRoleAssignments && null != permissions && null != AssignUserEmails && permissions.Count == AssignUserEmails.Count) - { - int position = 0; - foreach (string roleName in permissions) - { - IList assignUserEmails = AssignUserEmails[position]; - if (!string.IsNullOrWhiteSpace(roleName) && null != assignUserEmails) - { - RoleDefinition roleDefinition = clientContext.Web.RoleDefinitions.GetByName(roleName); - foreach (string user in assignUserEmails) - { - - if (!string.IsNullOrWhiteSpace(user)) - { - /////get the user object - Principal userPrincipal = clientContext.Web.EnsureUser(user.Trim()); - /////create the role definition binding collection - RoleDefinitionBindingCollection roleDefinitionBindingCollection = new RoleDefinitionBindingCollection(clientRuntimeContext); - /////add the role definition to the collection - roleDefinitionBindingCollection.Add(roleDefinition); - /////create a RoleAssigment with the user and role definition - listItem.RoleAssignments.Add(userPrincipal, roleDefinitionBindingCollection); - } - } - /////execute the query to add everything - clientRuntimeContext.ExecuteQuery(); - } - position++; - } - ///// Success. Return a success code - result = false; - } - } - return result; - } - - /// - /// Gets the list items of specified list based on CAML query. - /// - /// Client context - /// Name of the list - /// CAML Query that need to be executed on list - /// Collection of list items - public static ListItemCollection GetData(ClientContext clientContext, string listName, string camlQuery = null) - { - ListItemCollection listItemCollection = null; - if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) - { - try - { - CamlQuery query = new CamlQuery(); - if (!string.IsNullOrWhiteSpace(camlQuery)) - { - query.ViewXml = camlQuery; - listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(query); - } - else - { - listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(CamlQuery.CreateAllItemsQuery()); - } - clientContext.Load(listItemCollection); - clientContext.ExecuteQuery(); - } - catch (Exception) - { - listItemCollection = null; - throw; - } - } - return listItemCollection; - } - - /// - /// Creates a new view for the list - /// - /// Client Context - /// List name - /// Name of the columns in view - /// View name - /// View query - /// String stating success flag - public static bool AddView(ClientContext clientContext, List matterList, string[] viewColumnList, string viewName, string strQuery) - { - bool result = true; - if (null != clientContext && null != matterList && null != viewColumnList && !string.IsNullOrWhiteSpace(viewName) && !string.IsNullOrWhiteSpace(strQuery)) - try - { - View outlookView = matterList.Views.Add(new ViewCreationInformation - { - Title = viewName, - ViewTypeKind = ViewType.Html, - ViewFields = viewColumnList, - Paged = true - }); - outlookView.ViewQuery = strQuery; - outlookView.Update(); - clientContext.ExecuteQuery(); - } - catch (Exception) - { - result = false; - } - return result; - } - - /// - /// Function to check whether list is present or not. - /// - /// Client context object for SharePoint - /// List name - /// Success flag - public static List Exists(ClientContext clientContext, ReadOnlyCollection listsNames) - { - List existingLists = new List(); - if (null != clientContext && null != listsNames) - { - ListCollection lists = clientContext.Web.Lists; - clientContext.Load(lists); - clientContext.ExecuteQuery(); - existingLists = (from listName in listsNames - join item in lists - on listName.ToUpper(CultureInfo.InvariantCulture) equals item.Title.ToUpper(CultureInfo.InvariantCulture) - select listName).ToList(); - } - return existingLists; - } - - /// - /// Function to delete the list - /// - /// Client context - /// List name - /// Success flag - public static bool Delete(ClientContext clientContext, IList listsNames) - { - bool result = false; - if (null != clientContext && null != listsNames) - { - ListCollection allLists = clientContext.Web.Lists; - clientContext.Load(allLists); - clientContext.ExecuteQuery(); - foreach (string listName in listsNames) - { - List list = allLists.Cast().FirstOrDefault(item => item.Title.ToUpperInvariant().Equals(listName.ToUpperInvariant())); - if (null != list) - { - result = true; - list.DeleteObject(); - } - - } - clientContext.ExecuteQuery(); - } - return result; - } - - /// - /// Retrieves the list item ID. - /// - /// Client context object - /// Library name - /// Page name - /// List item id - public static int RetrieveItemId(ClientContext clientContext, string libraryName, string pageName) - { - int listItemId = -1; - if (null != clientContext && !string.IsNullOrWhiteSpace(libraryName) && !string.IsNullOrWhiteSpace(pageName)) - { - ListItemCollection listItemCollection = GetData(clientContext, libraryName); - clientContext.Load(listItemCollection, listItemCollectionProperties => listItemCollectionProperties.Include(listItemProperties => listItemProperties.Id, listItemProperties => listItemProperties.DisplayName)); - clientContext.ExecuteQuery(); - - ListItem listItem = listItemCollection.Cast().FirstOrDefault(listItemProperties => listItemProperties.DisplayName.ToUpper(CultureInfo.InvariantCulture).Equals(pageName.ToUpper(CultureInfo.InvariantCulture))); - - if (null != listItem) - { - listItemId = listItem.Id; - } - } - return listItemId; - } - - /// - /// To check if the folder is present in the list - /// - /// Client context object - /// Folder path - /// Document library name - /// true or false - public static bool CheckFolderPresent(ClientContext clientContext, string folderPath, string documentLibraryName) - { - bool folderFound = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(documentLibraryName) && !string.IsNullOrWhiteSpace(folderPath)) - { - List list = clientContext.Web.Lists.GetByTitle(documentLibraryName); - ListItemCollection folderList = list.GetItems(CamlQuery.CreateAllFoldersQuery()); - clientContext.Load(folderList, item => item.Include(items => items.Folder.Name, items => items.Folder.ServerRelativeUrl).Where(items => items.Folder.ServerRelativeUrl == folderPath)); - clientContext.ExecuteQuery(); - folderFound = 0 < folderList.Count; - } - return folderFound; - } - - /// - /// Returns stream data of the file. - /// - /// ClientContext object - /// Document URL of the document whose stream is to be retrieved - /// Stream of the file - public static ClientResult GetStreamFromFile(ClientContext clientContext, string documentUrl) - { - ClientResult data = null; - if (null != clientContext && !string.IsNullOrWhiteSpace(documentUrl)) - { - File file = clientContext.Web.GetFileByServerRelativeUrl(documentUrl); - data = file.OpenBinaryStream(); - // Load the Stream data for the file - clientContext.Load(file); - clientContext.ExecuteQuery(); - } - return data; - } - - /// - /// Checks if item is modified after it is loaded on the client side - /// - /// List item collection - /// Date time when current user loaded the page to see/update configuration values. - /// Success flag - public static bool CheckItemModified(ListItemCollection collection, string cachedItemModifiedDate) - { - bool response = false; - int errorModifiedDate = 0; // If there is new list item being created then 'cachedItemModifiedDate' will be 0 - if (null != collection && !string.IsNullOrWhiteSpace(cachedItemModifiedDate)) - { - if (String.Equals(Convert.ToString(errorModifiedDate, CultureInfo.InvariantCulture), cachedItemModifiedDate) && collection.Count.Equals(0)) // Verify if new item flag is true and no list item is present in the Matter Configuration list - { - response = true; - } - else if (0 < collection.Count) - { - ListItem settingsListItem = collection.FirstOrDefault(); - DateTime cachedDate; - if (DateTime.TryParse(cachedItemModifiedDate, out cachedDate)) - { - DateTime itemModifiedDate = Convert.ToDateTime(settingsListItem[Constants.MODIFIED_DATE_COLUMN], CultureInfo.InvariantCulture); - if (0 == DateTime.Compare(cachedDate, itemModifiedDate)) - { - response = true; - } - } - - } - } - return response; - } - - /// - /// Sets the value of the specified property. - /// - /// Client context - /// Property Bag - /// Name of matter to which property is to be attached - /// List of properties - public static void SetPropertBagValuesForList(ClientContext clientContext, PropertyValues props, string matterName, Dictionary propertyList) - { - if (null != clientContext && !string.IsNullOrWhiteSpace(matterName) && null != props && null != propertyList) - { - List list = clientContext.Web.Lists.GetByTitle(matterName); - - foreach (var item in propertyList) - { - props[item.Key] = item.Value; - list.Update(); - } - - clientContext.ExecuteQuery(); - } - } - - /// - /// Fetches the values of property for specified matter. - /// - /// Client context - /// Name of matter - /// List of properties - /// Property list stamped to the matter - public static string GetPropertyValueForList(ClientContext context, string matterName, string propertyList) - { - string value = string.Empty; - if (null != context && !string.IsNullOrWhiteSpace(matterName) && null != propertyList) - { - ListCollection allLists = context.Web.Lists; - context.Load(allLists); - context.ExecuteQuery(); - List list = allLists.Cast().FirstOrDefault(item => item.Title.ToUpperInvariant().Equals(matterName.ToUpperInvariant())); - if (null != list) - { - var props = list.RootFolder.Properties; - context.Load(props); - context.ExecuteQuery(); - if (null != props) - { - if (props.FieldValues.ContainsKey(propertyList)) - { - value = Convert.ToString(props.FieldValues[propertyList], CultureInfo.InvariantCulture); - } - } - } - } - return value; - } - - /// - /// Determines whether user has a particular permission on the list - /// - /// Client context - /// List name - /// Permission to be checked - /// Success flag - public static bool CheckPermissionOnList(ClientContext clientContext, string listName, PermissionKind permission) - { - bool returnValue = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) - { - ListCollection listCollection = clientContext.Web.Lists; - clientContext.Load(listCollection, lists => lists.Include(list => list.Title, list => list.EffectiveBasePermissions).Where(list => list.Title == listName)); - clientContext.ExecuteQuery(); - if (0 < listCollection.Count) - { - returnValue = listCollection[0].EffectiveBasePermissions.Has(permission); - } - } - return returnValue; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj deleted file mode 100644 index f0dcd551..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Debug - AnyCPU - {C1760739-9EB8-4F21-BB8D-14E6EACC7CE1} - Library - Properties - Microsoft.Legal.MatterCenter.DataLayer - Microsoft.Legal.MatterCenter.DataLayer - v4.5 - 512 - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - true - - - DataLayer.snk - - - - False - ..\External\DocumentFormat.OpenXml.dll - - - False - ..\External\Microsoft.Exchange.WebServices.dll - - - False - ..\External\Microsoft.SharePoint.Client.dll - - - False - ..\External\Microsoft.SharePoint.Client.Runtime.dll - - - False - ..\External\Microsoft.SharePoint.Client.Search.dll - - - False - ..\External\Microsoft.SharePoint.Client.Taxonomy.dll - - - False - ..\External\Microsoft.SharePoint.Client.UserProfiles.dll - - - False - ..\External\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\External\Microsoft.WindowsAzure.Storage.dll - - - False - ..\External\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj.vspscc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj.vspscc deleted file mode 100644 index b6d32892..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Microsoft.Legal.MatterCenter.DataLayer.csproj.vspscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Page.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Page.cs deleted file mode 100644 index ad100ebd..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Page.cs +++ /dev/null @@ -1,159 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.DataLayer -// Author : v-nikhid -// Created : 06-16-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains methods related to SharePoint page object. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.DataLayer -{ - #region using - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.WebParts; - using System; - using System.IO; - #endregion - - /// - /// Performs operations related to SharePoint page. - /// - public static class Page - { - - /// - /// Deletes the page - /// - /// Client Context - /// Page URL - public static void Delete(ClientContext clientContext, string pageUrl) - { - if (null != clientContext && !string.IsNullOrWhiteSpace(pageUrl)) - { - Microsoft.SharePoint.Client.File clientFile = clientContext.Web.GetFileByServerRelativeUrl(pageUrl); - if (IsFileExists(clientContext, pageUrl)) - { - clientFile.DeleteObject(); - clientContext.ExecuteQuery(); - } - } - } - - /// - /// Checks the file at the specified location and return the file existence status. - /// - /// Client Context - /// File URL - /// Success flag - public static bool IsFileExists(ClientContext clientContext, string pageUrl) - { - bool success = false; - if (null != clientContext && !string.IsNullOrWhiteSpace(pageUrl)) - { - Microsoft.SharePoint.Client.File clientFile = clientContext.Web.GetFileByServerRelativeUrl(pageUrl); - clientContext.Load(clientFile, cf => cf.Exists); - clientContext.ExecuteQuery(); - success = clientFile.Exists; - } - return success; - } - - /// - /// Create a web part page of matter in the document library. - /// - /// Client Context - /// Web part page name - /// Layout for the page - /// List/library name - /// master page list name - /// Page title - /// Web part page id - public static int CreateWebPartPage(ClientContext clientContext, string pageName, string layout, string masterpagelistName, string listName, string pageTitle) - { - int response = -1; - if (null != clientContext && !string.IsNullOrWhiteSpace(pageName) && !string.IsNullOrWhiteSpace(layout) && !string.IsNullOrWhiteSpace(masterpagelistName) && !string.IsNullOrWhiteSpace(listName)) - { - try - { - //// Find Default Layout from Master Page Gallery to create Web Part Page - - Web web = clientContext.Web; - ListItemCollection collection = Lists.GetData(clientContext, masterpagelistName); - clientContext.Load(collection, listItemCollectionProperties => listItemCollectionProperties.Include(listItemProperties => listItemProperties.Id, listItemProperties => listItemProperties.DisplayName)); - clientContext.ExecuteQuery(); - ListItem fileName = null; - foreach (ListItem findLayout in collection) - { - if (findLayout.DisplayName.Equals(layout, StringComparison.OrdinalIgnoreCase)) - { - fileName = findLayout; - break; - } - } - FileCreationInformation objFileInfo = new FileCreationInformation(); - objFileInfo.Url = pageName; - Microsoft.SharePoint.Client.File fileLayout = fileName.File; - clientContext.Load(fileLayout); - clientContext.ExecuteQuery(); - ClientResult filedata = fileLayout.OpenBinaryStream(); - List sitePageLib = web.Lists.GetByTitle(listName); - clientContext.Load(sitePageLib); - clientContext.ExecuteQuery(); - StreamReader reader = new StreamReader(filedata.Value); - objFileInfo.Content = System.Text.Encoding.ASCII.GetBytes(reader.ReadToEnd()); - Microsoft.SharePoint.Client.File matterLandingPage = sitePageLib.RootFolder.Files.Add(objFileInfo); - ListItem matterLandingPageDetails = matterLandingPage.ListItemAllFields; - // Update the title of the page - matterLandingPageDetails[Constants.TITLE] = pageTitle; - matterLandingPageDetails.Update(); - clientContext.Load(matterLandingPageDetails, matterLandingPageProperties => matterLandingPageProperties[Constants.TITLE], matterLandingPageProperties => matterLandingPageProperties.Id); - clientContext.ExecuteQuery(); - response = matterLandingPageDetails.Id; - } - catch (Exception) - { - response = -1; - } - } - return response; - } - - /// - /// Adds all web parts on matter landing page. - /// - /// Client Context - /// LimitedWebPartManager object to import web parts - /// WebPartDefinition object to add web parts on page - /// Array of web parts that should be added on Matter Landing Page - /// Array of Zone IDs - /// Success flag - public static bool AddWebPart(ClientContext clientContext, LimitedWebPartManager limitedWebPartManager, WebPartDefinition webPartDefinition, string[] webParts, string[] zones) - { - bool result = false; - if (null != clientContext && null != limitedWebPartManager && null != webParts && null != zones) - { - int index = 0; - try - { - for (index = 0; index < webParts.Length; index++) - { - if (!string.IsNullOrWhiteSpace(webParts[index])) - { - webPartDefinition = limitedWebPartManager.ImportWebPart(webParts[index]); - limitedWebPartManager.AddWebPart(webPartDefinition.WebPart, zones[index], Constants.ZONEINDEX); - clientContext.ExecuteQuery(); - } - } - } - catch (Exception) - { - result = false; - } - } - return result; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Properties/AssemblyInfo.cs deleted file mode 100644 index 44e2547d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.DataLayer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.DataLayer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.DataLayer")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d43c4b81-a55e-4597-85e8-1df084923d86")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Enumerators.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Enumerators.cs deleted file mode 100644 index ef9759f2..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Enumerators.cs +++ /dev/null @@ -1,81 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.Entity -// Author : v-akvira -// Created : 04-01-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines enumerators used under current project. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.Entity -{ - /// - /// Provides set of enumerators available in Matter Center. - /// - public static class Enumerators - { - /// - /// Supports selection of enumerator to refer to local/global resource file. - /// - public enum ResourceFileLocation - { - /// - /// The resource file refers to App_GlobalResource folder. - /// - App_GlobalResources, - - /// - /// The resource file refers to App_LocalResource folder. - /// - App_LocalResources, - - /// - /// The resource file refers to bin folder. - /// - bin - } - - /// - /// Matter Landing page section mapping - /// - public enum MatterLandingSection - { - /// - /// Task panel mapping - /// - TaskPanel, - - /// - /// Calendar panel mapping - /// - CalendarPanel, - - /// - /// Footer panel mapping - /// - FooterPanel, - - /// - /// Information panel mapping - /// - InformationPanel, - - /// - /// Header panel mapping - /// - HeaderPanel, - - /// - /// RSS Title panel mapping - /// - RSSTitlePanel, - - /// - /// OneNote panel mapping - /// - OneNotePanel - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/GlobalSuppressions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/GlobalSuppressions.cs deleted file mode 100644 index f02cec28..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/GlobalSuppressions.cs and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/LegalBriefcaseObject.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/LegalBriefcaseObject.cs deleted file mode 100644 index 43e5c8d7..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/LegalBriefcaseObject.cs +++ /dev/null @@ -1,297 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.Entity -// Author : v-swmirj -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides the structure required for briefcase operations. It includes the document ID and URL. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.Entity -{ - #region using - using System.Collections.Generic; - #endregion - - /// - /// Provides the structure required for Matter Center briefcase operations. It includes the document ID and URL. - /// - public class BriefcaseDetails - { - /// - /// Gets or sets document ID. Represents the unique document in matter library. - /// - /// The document identifier. - public string DocumentId - { - get; - set; - } - - /// - /// Gets or sets document URL. Represents the URL of document in matter library. - /// - /// The document URL. - public string DocumentUrl - { - get; - set; - } - } - - /// - /// Provides the structure required to perform briefcase operations (Update Copy, Matter Check In, and Matter Check Out and Detach) for particular briefcase document. - /// - public class SyncDetails - { - /// - /// Gets or sets List ID of the item. - /// - /// The list identifier. - public string ListId - { - get; - set; - } - - /// - /// Gets or sets list of item ID. Represents the items selected in briefcase operations. - /// - /// The item identifier. - public IList ItemId - { - get; - set; - } - - /// - /// Gets or sets the Integer value specifying the type of operation i.e. Update Copy, Matter Check In, and Matter Check Out and Detach. - /// - /// The briefcase operation. - public int Operation - { - get; - set; - } - } - - /// - /// Provides the response/status of each document in legal briefcase operation. - /// - public class ResponseDetails - { - /// - /// Gets or sets the status of operation requested. Indicates whether the operation was success/failure. - /// - /// The status of operation. - public string Status - { - get; - set; - } - - /// - /// Gets or sets the list of file names returned. Represents the files involved in the operation. - /// - /// The file names. - public IList FileNames - { - get; - set; - } - } - - /// - /// Provides the version details, status flag, and success/error message, relative URL for document after briefcase operation. - /// - public class VersionDetails - { - /// - /// Initializes a new instance of the class. - /// - public VersionDetails() - { - this.IsMajorVersion = new List(); - this.IsMinorVersion = new List(); - this.CurrentMinorVersion = new List(); - this.CurrentMajorVersion = new List(); - this.CheckOutStatus = new List(); - this.RelativeURL = new List(); - } - - /// - /// Gets or sets a value indicating whether this is having status. - /// - /// The status indicating whether the document is checked out by logged-in user or not. - public bool Status - { - get; - set; - } - - /// - /// Gets or sets boolean indicator for major version. - /// - /// The major version. - public IList IsMajorVersion - { - get; - set; - } - - /// - /// Gets or sets boolean indicator for minor version. - /// - /// The minor version. - public IList IsMinorVersion - { - get; - set; - } - - /// - /// Gets or sets minor version of the item. - /// - /// The current minor version. - public IList CurrentMinorVersion - { - get; - set; - } - - /// - /// Gets or sets major version of the item. - /// - /// The current major version. - public IList CurrentMajorVersion - { - get; - set; - } - - /// - /// Gets or sets check out status for the item. - /// - /// The check out status. - public IList CheckOutStatus - { - get; - set; - } - - /// - /// Gets or sets relative URL of the items. - /// - /// The relative URL. - public IList RelativeURL - { - get; - set; - } - - /// - /// Gets or sets the error message. - /// - /// The error message. - public string ErrorMessage - { - get; - set; - } - } - - /// - /// Provides the file names, status, success/error message for briefcase operation. - /// - public class CommonResponse - { - /// - /// Initializes a new instance of the class. - /// - public CommonResponse() - { - this.Status = new List(); - this.FileNames = new List(); - } - - /// - /// Gets or sets the status of the request. Indicates whether the operation was success/failure. - /// - /// The status. - public IList Status - { - get; - set; - } - - /// - /// Gets or sets relative URL of the file. Represents the files involved in the operation. - /// - /// The file names. - public IList FileNames - { - get; - set; - } - - /// - /// Gets or sets the error message. Represents the error details in case of operation failure. - /// - /// The error message. - public string ErrorMessage - { - get; - set; - } - } - - /// - /// Provides the structure required for mail attachment meta-data. It includes full URL of mail and flag to overwrite existing files, if present. - /// - - public class MailAttachmentDetails - { - /// - /// Gets or sets the full URL of mail attachment. - /// - /// The full URL. - - public string FullUrl - { - get; - set; - } - - /// - /// Gets or sets overwrite option for mail attachment. - /// - /// The overwrite. - - public int IsOverwrite - { - get; - set; - } - - /// - /// Gets or sets file position where check out failed - /// - public static int CheckoutFailedPosition - { - get; - set; - } - - /// - /// Gets or sets value based on attachment call for mail attachment. - /// - /// The Attachment Flag. - public bool IsAttachmentCall - { - get; - set; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterCenterEntity.snk b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterCenterEntity.snk deleted file mode 100644 index 8e0788db..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterCenterEntity.snk and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterProvisionObjects.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterProvisionObjects.cs deleted file mode 100644 index b78f0fd5..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/MatterProvisionObjects.cs +++ /dev/null @@ -1,923 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.Entity -// Author : v-nikhid -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines classes used under current project. -// *********************************************************************** -//// Keeping using System over here because of usage of CLSComplaint attribute for namespace -using System; -[assembly: CLSCompliant(true)] -namespace Microsoft.Legal.MatterCenter.Entity -{ - #region using - using System; - using System.Collections.Generic; - #endregion - - /// - /// Holds the SP app token to authenticate current request. - /// - [CLSCompliant(true)] - public class RequestObject - { - /// - /// Gets or sets the SP application token. Represents the token for authenticated user. - /// - /// The SP application token. - - public string SPAppToken - { - get; - set; - } - - /// - /// Gets or sets the refresh token. Represents the token used for single sign-on. - /// - /// The refresh token. - - public string RefreshToken - { - get; - set; - } - } - - /// - /// Provides the structure required to hold flag values - /// - public class MatterProvisionFlags - { - /// - /// Gets or sets value for matter landing flag - /// - /// Matter landing - - public string MatterLandingFlag - { - get; - set; - } - - /// - /// Gets or sets boolean value for send email flag - /// - /// Send email - - public bool SendEmailFlag - { - get; - set; - } - } - - /// - /// Provides the structure required to hold client meta-data. It includes client unique ID, client name, and client URL. - /// - public class Client - { - /// - /// Gets or sets the client identifier. Represents the unique identifier for client. - /// - /// The client identifier. - - public string Id - { - get; - set; - } - - /// - /// Gets or sets the name of the client. Represents the unique name of client. - /// - /// The name of the client. - - public string Name - { - get; - set; - } - - /// - /// Gets or sets the client URL. - /// - /// The client URL. - - public string Url - { - get; - set; - } - } - - /// - /// Provides the structure required to hold matter meta-data. It includes matter ID, name, description, conflict details, allowed teams, blocked users, permissions, and content type. - /// - public class Matter - { - /// - /// Gets or sets the matter identifier. Represents the matter ID under a client. - /// - /// The matter identifier. - - public string Id - { - get; - set; - } - - /// - /// Gets or sets the name of the matter. Represents the matter name under a client. - /// - /// The name of the matter. - - public string Name - { - get; - set; - } - - /// - /// Gets or sets the matter description. Represents the description of matter library. - /// - /// The matter description. - - public string Description - { - get; - set; - } - - /// - /// Gets or sets the matter conflict meta-data. Represents conflict checked by user, conflict check date, and security of matter from external users. - /// - /// The conflict. - - public Conflict Conflict - { - get; - set; - } - - /// - /// Gets or sets the user names. Represents the user names associated with the matter. - /// - /// The user names. - - public IList UserNames - { - get; - set; - } - - /// - /// Gets or sets the content types. Represents all the content types associated with the matter library. - /// - /// The content types. - - public IList ContentTypes - { - get; - set; - } - - /// - /// Gets or sets the assigned user names. Represents the team members and responsible attorneys associated with the matter. - /// - /// The assign user names. - - public IList> AssignUserNames - { - get; - set; - } - - /// - /// Gets or sets the assigned user email addresses. Represents the team members associated with the project. - /// - /// The list of assign user email addresses. - public IList> AssignUserEmails - { - get; - set; - } - - /// - /// Gets or sets the blocked user names. Represents the users who are blocked from viewing the matter details. - /// - /// The block user names. - - public IList BlockUserNames - { - get; - set; - } - - /// - /// Gets or sets the permissions. Represents the permission levels associated with the matter. - /// - /// The permissions. - - public IList Permissions - { - get; - set; - } - - /// - /// Gets or sets the roles. Represents the role of users associated with the matter. - /// - /// The roles. - - public IList Roles - { - get; - set; - } - - /// - /// Gets or sets the folder names. Represents the list of folders that will be created with the matter. - /// - /// The folder names. - - public IList FolderNames - { - get; - set; - } - - /// - /// Gets or sets the default content type. - /// - /// The default content type. - - public string DefaultContentType - { - get; - set; - } - - /// - /// Gets or sets the Document template count. Represents the document templates count of matter. - /// - /// The Document template count. - - public IList DocumentTemplateCount - { - get; - set; - } - - ///// - ///// Gets or sets the Matter GUID. - ///// - ///// The Matter GUID. - - public string MatterGuid - { - get; - set; - } - } - - /// - /// Provides the structure required to hold matter conflict meta-data. It includes user who performed the conflict check, the conflict check date, and security of matter from external users. - /// - public class Conflict - { - /// - /// Gets or sets the user who performed the conflict check for matter. - /// - /// The conflict check by. - - public string CheckBy - { - get; - set; - } - - /// - /// Gets or sets the conflict check date for matter. - /// - /// The conflict check on. - - public string CheckOn - { - get; - set; - } - - /// - /// Gets or sets the conflict identified option (Yes/No) for matter. Represents if the conflict was identified or not. - /// - /// The conflict identified. - - public string Identified - { - get; - set; - } - - /// - /// Gets or sets the flag to mark the matter as secure or not. - /// - /// The secure matter. - - public string SecureMatter - { - get; - set; - } - } - - /// - /// Provides the structure required to hold additional matter meta-data. It includes matter practice group, area of law, sub area of law, responsible attorney, team members, and blocked users. - /// - public class MatterDetails - { - /// - /// Gets or sets the practice group associated with the matter. - /// - /// The practice group. - - public string PracticeGroup - { - get; - set; - } - - /// - /// Gets or sets the area of law associated with the matter. - /// - /// The area of law. - - public string AreaOfLaw - { - get; - set; - } - - /// - /// Gets or sets the sub area of law associated with the matter. - /// - /// The sub area of law. - - public string SubareaOfLaw - { - get; - set; - } - - /// - /// Gets or sets the responsible attorney associated with the matter. - /// - /// The responsible attorney. - - public string ResponsibleAttorney - { - get; - set; - } - - /// - /// Gets or sets the responsible attorney email associated with the matter. - /// - /// The list of responsible attorney email addresses. - - public string ResponsibleAttorneyEmail - { - get; - set; - } - - /// - /// Gets or sets the team members associated with the matter. - /// - /// The team members. - - public string TeamMembers - { - get; - set; - } - - /// - /// Gets or sets the users who can only view the matter. - /// - /// The upload blocked users. - - public IList UploadBlockedUsers - { - get; - set; - } - - /// - /// Gets or sets the role information associated with the matter. - /// - /// The team members. - - public string RoleInformation - { - get; - set; - } - } - - /// - /// Provides the structure required to hold role meta-data. It includes role ID, name, and flag indicating whether role is mandatory or not. - /// - public class Role - { - /// - /// Gets or sets the role identifier. Represents the role identifier. - /// - /// The role identifier. - - public string Id - { - get; - set; - } - - /// - /// Gets or sets the name of the role. Represents the role name. - /// - /// The name of the role. - - public string Name - { - get; - set; - } - - /// - /// Gets or sets a value indicating whether this is mandatory. - /// - /// true if mandatory; otherwise, false. - - public bool Mandatory - { - get; - set; - } - } - - /// - /// Provides the structure required to hold user meta-data. It includes user ID, name/alias, logged-in user name, and email. - /// - public class Users - { - /// - /// Gets or sets the user name. - /// - /// The name of the user. - - public string Name - { - get; - set; - } - - /// - /// Gets or sets the logged-in user name. - /// - /// The name of the user log on. - - public string LogOnName - { - get; - set; - } - - /// - /// Gets or sets the user email. - /// - /// The user email. - - public string Email - { - get; - set; - } - - /// - /// Gets or sets the entity type (user or security group). - /// - public string EntityType - { - get; - set; - } - - /// - /// Gets or sets the Provider name indicating tenant or extranet user - /// - public string ProviderName - { - get; - set; - } - - /// - /// Gets or sets the entity data returned from people picker web service - /// - public EntityData EntityData { get; set; } - } - - /// - /// Provides the structure required to hold term store meta-data. It includes term group, term set, and additional custom property. - /// - public class TermStoreDetails - { - /// - /// Gets or sets the term group. Represents the name of parent node of term store. - /// - /// The term group. - - public string TermGroup - { - get; - set; - } - - /// - /// Gets or sets the name of the term set. Represents the term sets under term group. - /// - /// The name of the term set. - - public string TermSetName - { - get; - set; - } - - /// - /// Gets or sets the name of the custom property. Represents custom properties associated with each term. - /// - /// The name of the custom property. - - public string CustomPropertyName - { - get; - set; - } - } - - /// - /// Provides the structure required to hold user meta-data retrieved from client people picker web service. - /// - public class PeoplePickerUser - { - /// - /// Gets or sets the user logon name. - /// - public string Key { get; set; } - - /// - /// Gets or sets the user email. - /// - public string Description { get; set; } - - /// - /// Gets or sets the user display name. - /// - public string DisplayText { get; set; } - - /// - /// Gets or sets the Provider name indicating tenant or extranet user - /// - public string ProviderName { get; set; } - - /// - /// Gets or sets the entity type (user or security group). - /// - public string EntityType { get; set; } - - /// - /// Gets or sets the entity data returned from people picker web service - /// - public EntityData EntityData { get; set; } - } - - /// - /// Holds the structure of entity data returned from people picker web service. - /// - public class EntityData - { - /// - /// Gets or sets the title of user or security group - /// - public string Title { get; set; } - - /// - /// Gets or sets the department of user or security group - /// - public string Department { get; set; } - - /// - /// Gets or sets the email of user or security group - /// - public string Email { get; set; } - } - - /// - /// Provides the structure required to hold matter property bag information (stamped properties). - /// - public class MatterStampedDetails - { - /// - /// Indicates if the matter is old or new - /// - public string IsNewMatter { get; set; } - - /// - /// Provides the structure required to hold matter meta-data. It includes matter ID, name, description, conflict details, allowed teams, blocked users, permissions, and content type. - /// - public Matter MatterObject { get; set; } - - /// - /// Provides the structure required to hold additional matter meta-data. It includes matter practice group, area of law, sub area of law, responsible attorney, team members, and blocked users. - /// - public MatterDetails MatterDetailsObject { get; set; } - - /// - /// Provides the structure required to hold client meta-data. It includes client unique ID, client name, and client URL. - /// - public Client ClientObject { get; set; } - } - - /// - /// Provides the structure needed to revert the matter permission update operation. - /// - [CLSCompliant(false)] - public class MatterRevertList - { - /// - /// Gets or sets a matter library instance - /// - public string MatterLibrary { get; set; } - - /// - /// Gets or sets a matter OneNote library instance - /// - public string MatterOneNoteLibrary { get; set; } - - /// - /// Gets or sets a matter calendar instance - /// - public string MatterCalendar { get; set; } - - /// - /// Gets or sets a matter site pages instance - /// - public string MatterSitePages { get; set; } - - /// - /// Gets or sets a matter task instance - /// - public string MatterTask { get; set; } - } - - /// - /// Represents configuration for the matter. Holds value for various entities on the Matter Provision page - /// - public class MatterConfigurations - { - /// - /// Gets or sets the name of the matter. Represents the name of matter library. - /// - /// The default name of the matter. - public string DefaultMatterName - { - get; - set; - } - - /// - /// Gets or sets the default matter id - /// - /// The default matter id - public string DefaultMatterId - { - get; - set; - } - - /// - /// Gets or sets the default matter type - /// - /// The default matter type - public string DefaultMatterType - { - get; - set; - } - - /// - /// Gets or sets the matter types - /// - /// The matter types - public string MatterTypes - { - get; - set; - } - - /// - /// Gets or sets the users of the matters - /// - /// The matter users - public string MatterUsers - { - get; - set; - } - - /// - /// Gets or sets the emails for users of the projects - /// - /// The list of matter center user emails - public string MatterUserEmails - { - get; - set; - } - - /// - /// Gets or sets the matter roles for the users - /// - /// The matter roles for the users - public string MatterRoles - { - get; - set; - } - - /// - /// Gets or sets the matter permissions - /// - /// The matter permissions - public string MatterPermissions - { - get; - set; - } - - /// - /// Gets or sets the flag for calendar selection on settings page - /// - /// Calendar selected flag - public bool IsCalendarSelected - { - get; - set; - } - - /// - /// Gets or sets the email option selection flag - /// - /// The email option selection flag - public bool IsEmailOptionSelected - { - get; - set; - } - - /// - /// Gets or sets the RSS selection flag - /// - /// The RSS selection flag - public bool IsRSSSelected - { - get; - set; - } - - /// - /// Gets or sets the matter id. - /// - /// The matter id. - public bool IsRestrictedAccessSelected - { - get; - set; - } - - /// - /// Gets or sets the conflict check flag - /// - /// The conflict check visibility flag - public bool IsConflictCheck - { - get; - set; - } - - /// - /// Gets or sets the matter description mandatory flag - /// - /// The matter description mandatory flag - public bool IsMatterDescriptionMandatory - { - get; - set; - } - - /// - /// Gets or sets the matter practice group - /// - /// The matter group - public string MatterPracticeGroup - { - get; - set; - } - - /// - /// Gets or sets the matter area of law - /// - /// The matter area of law - public string MatterAreaofLaw - { - get; - set; - } - - /// - /// Gets or sets the content check property - /// - /// The content check property - public bool IsContentCheck - { - get; - set; - } - - /// - /// Gets or sets the tasks selected property - /// - /// The tasks selected property - public bool IsTaskSelected - { - get; - set; - } - } - - /// - /// Provides the structure required to hold additional matter meta-data for default values from term store. It includes term store information for matter, client, practice group, area of law and sub area of law. - /// - public class MatterMetadata - { - /// - /// Gets or sets the matter property - /// - public Matter Matter - { - get; - set; - } - - /// - /// Gets or sets the client property - /// - public Client Client - { - get; - set; - } - - /// - /// Gets or sets the practice group property - /// - public PracticeGroupTerm PracticeGroupTerm - { - get; - set; - } - - /// - /// Gets or sets the area of law property - /// - public AreaTerm AreaTerm - { - get; - set; - } - - /// - /// Gets or sets the Subarea of law property - /// - public SubareaTerm SubareaTerm - { - get; - set; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj deleted file mode 100644 index 466cbb05..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Debug - AnyCPU - {04B6E5BA-DE44-4E40-9496-EE12F658DE67} - Library - Properties - Microsoft.Legal.MatterCenter.Entity - Microsoft.Legal.MatterCenter.Entity - v4.5 - 512 - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - true - - - true - - - MatterCenterEntity.snk - - - - ..\External\Microsoft.SharePoint.Client.dll - True - - - ..\External\Microsoft.SharePoint.Client.Runtime.dll - True - - - False - ..\External\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj.vspscc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj.vspscc deleted file mode 100644 index b6d32892..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Microsoft.Legal.MatterCenter.Entity.csproj.vspscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Properties/AssemblyInfo.cs deleted file mode 100644 index 3a9b4ee9..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Entity")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Entity")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4ce1c299-756d-4777-be0a-d150e83541a4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/SearchObjects.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/SearchObjects.cs deleted file mode 100644 index 21ca5c0f..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/SearchObjects.cs +++ /dev/null @@ -1,1272 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.Entity -// Author : v-akdigh -// Created : 03-06-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines classes used by Search object. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.Entity -{ - #region using - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - #endregion - - /// - /// Represents a legal matter. Provides the structure required to hold pinned matter meta-data. It includes name, description, created date, URL, practice group, area of law, sub area of law, client ID, and client name. - /// - public class MatterData - { - /// - /// Gets or sets the name of the matter. Represents the name of matter library. - /// - /// The name of the matter. - public string MatterName - { - get; - set; - } - - /// - /// Gets or sets the matter description. Represents the description of matter library. - /// - /// The matter description. - public string MatterDescription - { - get; - set; - } - - /// - /// Gets or sets the matter created date. Represents the matter library creation date. - /// - /// The matter created date. - public string MatterCreatedDate - { - get; - set; - } - - /// - /// Gets or sets the matter URL. Represents the matter library URL present under the client. - /// - /// The matter URL. - public string MatterUrl - { - get; - set; - } - - /// - /// Gets or sets the matter practice group. Represents the practice group associated with the matter. - /// - /// The matter practice group. - public string MatterPracticeGroup - { - get; - set; - } - - /// - /// Gets or sets the matter area of law. Represents the area of law associated with the matter. - /// - /// The matter area of law. - public string MatterAreaOfLaw - { - get; - set; - } - - /// - /// Gets or sets the matter sub area of law. Represents the sub area of law associated with the matter. - /// - /// The matter sub area of law. - public string MatterSubAreaOfLaw - { - get; - set; - } - - /// - /// Gets or sets the matter client URL. Represents the URL of client for the matter. - /// - /// The matter client URL. - public string MatterClientUrl - { - get; - set; - } - - /// - /// Gets or sets the matter client. Represents the name of client for the matter. - /// - /// The matter client. - public string MatterClient - { - get; - set; - } - - /// - /// Gets or sets the matter client identifier. Represents the client ID for the matter. - /// - /// The matter client identifier. - public string MatterClientId - { - get; - set; - } - - /// - /// Gets or sets the HideUpload flag. Represents if the upload icon should be hidden from the user. - /// - /// The hide upload. - public string HideUpload - { - get; - set; - } - - /// - /// Gets or sets the Matter ID. Represents the matter ID under the client. - /// - /// The matter ID. - public string MatterID - { - get; - set; - } - - /// - /// Gets or sets the responsible attorney. Represents the attorney responsible for the matter. - /// - /// The responsible attorney. - public string MatterResponsibleAttorney - { - get; - set; - } - - /// - /// Gets or sets the Modified date. Represents the modified date for the matter. - /// - /// The Modified Date. - public string MatterModifiedDate - { - get; - set; - } - - /// - /// Gets or sets the Matter GUID. Represents the GUID for the matter. - /// - /// The Matter GUID. - public string MatterGuid - { - get; - set; - } - } - - /// - /// Represents a legal document. Provides the structure required to hold pinned document meta-data. It includes document name, version, created date, modified date, matter details for document, and client details for document. - /// - public class DocumentData - { - /// - /// Gets or sets the name of the document. Represents the document under the matter library. - /// - /// The name of the document. - public string DocumentName - { - get; - set; - } - - /// - /// Gets or sets the document version. Represents the document version (minor, major, check out, etc.). - /// - /// The document version. - public string DocumentVersion - { - get; - set; - } - - /// - /// Gets or sets the document client. Represents the client name under which the document is present. - /// - /// The document client. - public string DocumentClient - { - get; - set; - } - - /// - /// Gets or sets the document client identifier. Represents the unique client ID under which the document is present. - /// - /// The document client identifier. - public string DocumentClientId - { - get; - set; - } - - /// - /// Gets or sets the document client URL. Represents the client URL under which the document is present. - /// - /// The document client URL. - public string DocumentClientUrl - { - get; - set; - } - - /// - /// Gets or sets the document matter. Represents the matter library that holds the document. - /// - /// The document matter. - public string DocumentMatter - { - get; - set; - } - - /// - /// Gets or sets the document matter identifier. Represents the matter ID that holds the document. - /// - /// The document matter identifier. - public string DocumentMatterId - { - get; - set; - } - - /// - /// Gets or sets the document owner who has uploaded the document. - /// - /// The document owner. - public string DocumentOwner - { - get; - set; - } - - /// - /// Gets or sets the document URL. - /// - /// The document URL. - public string DocumentUrl - { - get; - set; - } - - /// - /// Gets or sets the document OWA URL. Represents the documents URL supported by OWA or Office online; otherwise the document path. - /// - public string DocumentOWAUrl - { - get; - set; - } - - /// - /// Gets or sets the document extension. - /// - /// The document extension. - public string DocumentExtension - { - get; - set; - } - - /// - /// Gets or sets the document created date. Represents the document uploaded date in matter library. - /// - /// The document created date. - public string DocumentCreatedDate - { - get; - set; - } - - /// - /// Gets or sets the document modified date. Represents the document last modified date in matter library. - /// - /// The document modified date. - public string DocumentModifiedDate - { - get; - set; - } - - /// - /// Gets or sets the document check out user. Represents the check out user of document. - /// - /// The document check out user. - public string DocumentCheckoutUser - { - get; - set; - } - - /// - /// Gets or sets the document matter URL. Represents the URL of matter library where document is present. - /// - /// The document check out user. - public string DocumentMatterUrl - { - get; - set; - } - - /// - /// Gets or sets the document parent URL. Represents the parent URL of document. - /// - /// The document check out user. - public string DocumentParentUrl - { - get; - set; - } - - /// - /// Gets or sets the document ID. Represents the ID of a document. - /// - /// The document ID. - public string DocumentID - { - get; - set; - } - } - - /// - /// Provides the structure required for searching matters/documents. It includes page number, search keyword, filter conditions, sort conditions, and numbers of items to be shown on page. - /// - public class SearchObject - { - /// - /// Gets or sets the page number. Represents the current page number that is displayed on the page. - /// - /// The page number. - - public int PageNumber - { - get; - set; - } - - /// - /// Gets or sets the items per page. Represents number of items to be shown on the page. - /// - /// The items per page. - - public int ItemsPerPage - { - get; - set; - } - - /// - /// Gets or sets the search term. Represents the search keyword/term to retrieve the results. - /// - /// The search term. - - public string SearchTerm - { - get; - set; - } - - /// - /// Gets or sets the filters. Represents the filtering condition. - /// - /// The filters. - - public FilterObject Filters - { - get; - set; - } - - /// - /// Gets or sets the sort. Represents the searching condition. - /// - /// The sort condition. - - public SortObject Sort - { - get; - set; - } - } - - /// - /// Provides the structure required for filtering matters/documents. It includes list of clients, practice group, area of law, sub area of law, from date, to date, and document author. - /// - public class FilterObject - { - /// - /// Gets or sets the clients list. Represents the clients selected for filtering. - /// - /// The clients list. - - public IList ClientsList - { - get; - set; - } - - /// - /// Gets or sets the list of practice group. Represents the practice groups selected for filtering. - /// - /// The PGList. - - public IList PGList - { - get; - set; - } - - /// - /// Gets or sets the list of area of law. Represents the area of law selected for filtering. - /// - /// The AOL list. - - public IList AOLList - { - get; - set; - } - - /// - /// Gets or sets FromDate. Represents the start date for filtering. - /// - /// From date. - - public string FromDate - { - get; - set; - } - - /// - /// Gets or sets ToDate. Represents the end date for filtering. - /// - /// To date. - - public string ToDate - { - get; - set; - } - - /// - /// Gets or sets the FilterByMe flag. Represents filtering on items created by logged-in user. - /// - /// The filter by me. - - public int FilterByMe - { - get; - set; - } - - /// - /// Gets or sets the document author. Represents authors selected for filtering. - /// - /// The document author. - - public string DocumentAuthor - { - get; - set; - } - - /// - /// Gets or sets the document/ matter name. Represents document/ matter name selected for filtering. - /// - public string Name - { - get; - set; - } - - /// - /// Gets or sets the document's/ matter's client name. Represents document's/ matter's client name selected for filtering. - /// - public string ClientName - { - get; - set; - } - - /// - /// Gets or sets the document's checked out user name. Represents the list of check out user names selected for filtering. - /// - public string DocumentCheckoutUsers - { - get; - set; - } - - /// - /// Gets or sets the Date filters. Represents collection of date filters selected for filtering. - /// - public DateFilterObject DateFilters - { - get; - set; - } - - /// - /// Gets or sets the Responsible attorney. Represents the list of Responsible attorneys selected for filtering. - /// - public string ResponsibleAttorneys - { - get; - set; - } - - /// - /// Gets or sets the Sub area of Law. Represents Sub area of Law selected for filtering. - /// - public string SubareaOfLaw - { - get; - set; - } - } - - /// - /// Provides the structure required for storing date filter. - /// - public class DateFilterObject - { - /// - /// Gets or sets the 'From' modified date. Represents 'From' modified date selected for filtering. - /// - public string ModifiedFromDate - { - get; - set; - } - - /// - /// Gets or sets the 'To' modified date. Represents 'To' modified date selected for filtering. - /// - public string ModifiedToDate - { - get; - set; - } - - /// - /// Gets or sets the 'From' created date. Represents 'From' created date selected for filtering. - /// - public string CreatedFromDate - { - get; - set; - } - - /// - /// Gets or sets the 'To' created date. Represents 'To' created date selected for filtering. - /// - public string CreatedToDate - { - get; - set; - } - - /// - /// Gets or sets the 'From' open date. Represents 'From' open date selected for filtering. - /// - public string OpenDateFrom - { - get; - set; - } - - /// - /// Gets or sets the 'To' open date. Represents 'To' open date selected for filtering. - /// - public string OpenDateTo - { - get; - set; - } - } - - /// - /// Provides the structure required for sorting matters/documents. It includes sortable property and sorting direction. - /// - public class SortObject - { - /// - /// Gets or sets the by property. Represents the property selected for sorting. - /// - /// The by property. - - public string ByProperty - { - get; - set; - } - - /// - /// Gets or sets the direction. Represents the order for sorting. - /// - /// The direction. - - public int Direction - { - get; - set; - } - } - - /// - /// Provides the structure for folder hierarchy within matter. - /// - public class FolderData - { - /// - /// Gets or sets the name. Represents the folder under the matter library. - /// - /// The name. - [JsonProperty(PropertyName = "name")] - public string Name - { - get; - set; - } - - /// - /// Gets or sets the URL. Represents the folder URL under the matter library. - /// - /// The URL. - [JsonProperty(PropertyName = "url")] - public string URL - { - get; - set; - } - - /// - /// Gets or sets the parent URL. Represents the parent URL. - /// - /// The parent URL. - [JsonProperty(PropertyName = "parenturl")] - public string ParentURL - { - get; - set; - } - } - - /// - /// Provides the structure of mail/attachment mainly EWS URL, folder location, document library, and flag to overwrite. - /// - public class ServiceRequest - { - /// - /// Gets or sets the attachment token. - /// - /// The attachment token. - public string AttachmentToken - { - get; - set; - } - - /// - /// Gets or sets the Exchange Web Service URL. - /// - /// The EWS URL. - public Uri EwsUrl - { - get; - set; - } - - /// - /// Gets or sets the attachments. Represents the objects selected. - /// - /// The attachments. - public IList Attachments - { - get; - set; - } - - /// - /// Gets or sets the mail identifier. - /// - /// The mail identifier. - public string MailId - { - get; - set; - } - - /// - /// Gets or sets the folder path. Represents the folder path where item needs to be uploaded. - /// - /// The folder path. - public IList FolderPath - { - get; - set; - } - - /// - /// Gets or sets the mail subject. - /// - /// The subject. - public string Subject - { - get; - set; - } - - /// - /// Gets or sets a value indicating whether this has overwrite option. - /// - /// true if overwrite; otherwise, false. - public bool Overwrite - { - get; - set; - } - - /// - /// Gets or sets document library name. - /// - /// Name of document Library - public string DocumentLibraryName - { - get; - set; - } - - /// - /// Gets or sets a value indicating whether to perform content check or not. - /// - /// Name of document Library - public bool PerformContentCheck - { - get; - set; - } - - /// - /// Gets content check flag whether allowed or not - /// - /// Content check enabled or not - public bool AllowContentCheck - { - get; - set; - } - - } - - /// - /// Provides the structure for mail attachment details. It includes MIME type, content type, attachment name, and size. - /// - public class AttachmentDetails - { - /// - /// Gets or sets the type of the attachment. - /// - /// The type of the attachment. - public string attachmentType - { - get; - set; - } - - /// - /// Gets or sets the type of the content. - /// - /// The type of the content. - public string contentType - { - get; - set; - } - - /// - /// Gets or sets the mail identifier. - /// - /// The identifier. - public string id - { - get; - set; - } - - /// - /// Gets or sets a value indicating whether this instance is in-line. - /// - /// true if this instance is in-line; otherwise, false. - public bool isInline - { - get; - set; - } - - /// - /// Gets or sets the attachment name. - /// - /// The name. - public string name - { - get; - set; - } - - /// - /// Gets or sets the attachment size. - /// - /// The size. - public int size - { - get; - set; - } - - /// - /// Gets or sets the original name of attachment - /// - public string originalName - { - get; - set; - } - } - - /// - /// Provides the structure required for SavedSearch meta-data and inherits from class. - /// - public class SavedSearchDetails : FilterObject - { - /// - /// Gets or sets the date time. - /// - /// The date time. - public string DateTime - { - get; - set; - } - - /// - /// Gets or sets the modified date time. - /// - /// The modified date time. - public string ModifiedDate - { - get; - set; - } - - /// - /// Gets or sets the search term. - /// - /// The search term. - public string SearchTerm - { - get; - set; - } - } - - /// - /// Provides the structure required for pin/unpin operation performed on matter/document. Meta-data includes the list name, list column, URL, and matter/document details. - /// - public class PinUnpinDetails - { - /// - /// Gets or sets the name of the list for operation. - /// - /// The name of the list. - public string ListName - { - get; - set; - } - - /// - /// Gets or sets the pinned list column details. - /// - /// The pinned list column details. - public string PinnedListColumnDetails - { - get; - set; - } - - /// - /// Gets or sets the URL of matter/document. - /// - /// The URL. - public string URL - { - get; - set; - } - - /// - /// Gets or sets the user pinned matter data. - /// - /// The user pinned matter data. - public MatterData UserPinnedMatterData - { - get; - set; - } - - /// - /// Gets or sets the user pinned document data. - /// - /// The user pinned document data. - public DocumentData UserPinnedDocumentData - { - get; - set; - } - } - - /// - /// Provides the structure required for mail XML response - /// - public struct MailXPath - { - /// - /// Gets or sets the user who receives the mail. - /// - /// Name of the user who receives the mail - public string mailReceiver { get; set; } - - /// - /// Gets or sets the user who are in CC. - /// - /// Name of the user who are in CC - public string mailCC { get; set; } - - /// - /// Gets or sets the mail received date. - /// - /// Mail received date - public string mailRecieved { get; set; } - - /// - /// Gets or sets the user who sends the mail. - /// - /// Name of the user who sends the mail - public string mailFromName { get; set; } - - /// - /// Gets or sets the address of the mail. - /// - /// Address of the mail - public string mailFromAddress { get; set; } - - /// - /// Gets or sets the importance of the mail. - /// - /// Importance of the mail - public string mailImportance { get; set; } - - /// - /// Gets or sets the subject of the mail. - /// - /// Subject of the mail - public string mailSubject { get; set; } - - /// - /// Gets or sets the conversation id of the mail. - /// - /// Conversation id of the mail - public string mailConversationId { get; set; } - - /// - /// Gets or sets the sensitivity of the mail. - /// - /// Sensitivity of the mail - public string mailSensitivity { get; set; } - - /// - /// Gets or sets the conversation topic of the mail. - /// - /// Conversation topic of the mail - public string mailConversationTopic { get; set; } - - /// - /// Gets or sets the sent date of the mail. - /// - /// Sent date of the mail - public string mailSentDate { get; set; } - - /// - /// Gets or sets the 'Has attachments' of the mail. - /// - /// 'Has attachments' value of the mail - public string mailHasAttachments { get; set; } - - /// - /// Gets or sets the categories of the mail. - /// - /// Categories of the mail - public string mailCategories { get; set; } - } - - /// - /// Provides the structure to hold mail meta data - /// - public struct MailMetaData - { - /// - /// Gets or sets the user who receives the mail. - /// - /// Name of the user who receives the mail - public string mailReceiver { get; set; } - - /// - /// Gets or sets the user who sends the mail. - /// - /// Name of the user who sends the mail - public string mailSender { get; set; } - - /// - /// Gets or sets the mail received date. - /// - /// Mail received date - public string receivedDate { get; set; } - - /// - /// Gets or sets the user who are in CC. - /// - /// Name of the user who are in CC - public string cc { get; set; } - - /// - /// Gets or sets the attachment of the mail. - /// - /// Attachment of the mail - public string attachment { get; set; } - - /// - /// Gets or sets the importance of the mail. - /// - /// Importance of the mail - public string mailImportance { get; set; } - - /// - /// Gets or sets the subject of the mail. - /// - /// Subject of the mail - public string mailSubject { get; set; } - - /// - /// Gets or sets the categories of the mail - /// - /// Category of the mail - public string categories { get; set; } - - /// - /// Gets or sets the sensitivity of the mail - /// - /// Sensitivity of the mail - public string sensitivity { get; set; } - - /// - /// Gets or sets the conversation id of the mail - /// - /// Conversation id of the mail - public string conversationId { get; set; } - - /// - /// Gets or sets the conversation topic of the mail - /// - /// Conversation topic of the mail - public string conversationTopic { get; set; } - - /// - /// Gets or sets the sent date of the mail - /// - /// Sent date of the mail - public string sentDate { get; set; } - - /// - /// Gets or sets the 'Has attachments' of the mail - /// - /// 'Has attachments' of the mail - public string hasAttachments { get; set; } - - /// - /// Gets or sets the original name of the mail - /// - /// Original name of the mail - public string originalName { get; set; } - } - - /// - /// Provides the structure required to store content for contextual help functionality. - /// - public class ContextHelpData - { - /// - /// Gets or sets the structure required to store content for contextual help sections. - /// - /// Provides the structure required to store content for contextual help sections. - public ContextHelpSection ContextSection { get; set; } - /// - /// Gets or sets the link title for operation. - /// - /// Link title of contextual help fly out - public string LinkTitle { get; set; } - /// - /// Gets or sets the Link URL for operation. - /// - /// Link URL of contextual help fly out - public string LinkURL { get; set; } - /// - /// Gets or sets the Link order for operation. - /// - /// Link order of contextual help fly out - public string LinkOrder { get; set; } - } - - /// - /// Provides the structure required to store content for contextual help sections. - /// - public class ContextHelpSection - { - /// - /// Gets or sets the section id for operation. - /// - /// Section id of contextual help fly out - public string SectionID { get; set; } - /// - /// Gets or sets the section title for operation. - /// - /// Section title of contextual help fly out - public string SectionTitle { get; set; } - /// - /// Gets or sets the section order for operation. - /// - /// Section order of contextual help fly out - public string SectionOrder { get; set; } - /// - /// Gets or sets the page name for operation. - /// - /// Page name of contextual help fly out - public string PageName { get; set; } - /// - /// Gets or sets the number of columns for help links. - /// - /// Number of columns to be displayed on the contextual help section - public string NumberOfColumns { get; set; } - } - - /// - /// Provides the structure required for performing content check. - /// - public class ContentCheckDetails - { - /// - /// Gets or sets the name of the file for which content check needs to be performed - /// - public string FileName { get; set; } - - /// - /// Gets or sets the Subject field of the file for which content check needs to be performed. Applicable only for email - /// - public string Subject { get; set; } - - /// - /// Gets or sets the size of the file for which content check needs to be performed - /// - public long FileSize { get; set; } - - /// - /// Gets or sets the From field of the file for which content check needs to be performed. Applicable only for email - /// - public string FromField { get; set; } - - /// - /// Gets or sets the Sent date field of the file for which content check needs to be performed. Applicable only for email - /// - public string SentDate { get; set; } - - /// - /// Two-parameters constructor to initialize object for checking if document exists with the same file name and size - /// - /// Name of the file being uploaded - /// Size of the file being uploaded - public ContentCheckDetails(string fileName, long fileSize) - { - this.FileName = fileName; - this.Subject = string.Empty; - this.FileSize = fileSize; - this.FromField = string.Empty; - this.SentDate = string.Empty; - } - - /// - /// Four-parameters constructor to initialize object for checking if mail exists with the same file name, size, from field and sent date - /// - /// Name of the mail being uploaded - /// Size of the mail being uploaded - /// Value in the From field of the mail being uploaded - /// Sent date of the mail being uploaded - public ContentCheckDetails(string fileName, string subject, long fileSize, string fromField, string sentDate) - { - this.FileName = fileName; - this.Subject = subject; - this.FileSize = fileSize; - this.FromField = fromField; - this.SentDate = sentDate; - } - } - - /// - /// Provides the structure required for checking if document already exists. - /// - public class DuplicateDocument - { - /// - /// Gets or sets a value indicating whether a document with the same name exists or not. - /// - /// true if document with the same name found; otherwise, false - public bool DocumentExists { get; set; } - - /// - /// Gets or sets a value indicating whether a potential duplicate exists, i.e. along with name, other properties also match - /// - /// true if potential duplicate found; otherwise, false - public bool HasPotentialDuplicate { get; set; } - - /// - /// Constructor to initialize the DuplicateDocument object - /// - /// Default value for DocumentExists property - /// Default value for HasPotentialDuplicate property - public DuplicateDocument(bool documentExists, bool hasPotentialDuplicate) - { - this.DocumentExists = documentExists; - this.HasPotentialDuplicate = hasPotentialDuplicate; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/TermStoreHelper.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/TermStoreHelper.cs deleted file mode 100644 index 830ea1e0..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Entity/TermStoreHelper.cs +++ /dev/null @@ -1,357 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.Entity -// Author : v-rijadh -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines classes used by Term Store object. -// *********************************************************************** - -namespace Microsoft.Legal.MatterCenter.Entity -{ - #region using - using System.Collections.Generic; - #endregion - - /// - /// Provides the structure required for client term set. It includes term set name and list of terms under the term set. - /// - public class ClientTermSets - { - /// - /// Gets or sets the term name. - /// - /// The name. - public string Name - { - get; - set; - } - - /// - /// Gets or sets the list of client terms present under the clients term set. - /// - /// The client terms. - public IList ClientTerms - { - get; - set; - } - } - - - /// - /// Provides the structure required for sub area of law term. It includes sub area of law, area of law, folders, folder structure flag, id , wssid and document template. - /// - public class SubareaTerm - { - /// - /// Gets or sets the name of the term (sub area of law). - /// - /// The name of the term. - public string TermName - { - get; - set; - } - - /// - /// Gets or sets the name of the parent term (area of law). - /// - /// The name of the parent term. - public string ParentTermName - { - get; - set; - } - - /// - /// Gets or sets the folder names. This is used for creation of folders when a matter is created. - /// - /// The folder names. - public string FolderNames - { - get; - set; - } - - /// - /// Gets or sets the is no folder structure present. If flag is not set, it will navigate to parent term to get the folder names. - /// - /// The is no folder structure present. - public string IsNoFolderStructurePresent - { - get; - set; - } - - /// - /// Gets or sets the document templates. This will be the default content type associated with the document library. - /// - /// The document templates. - public string DocumentTemplates - { - get; - set; - } - - /// - /// Gets or sets the document template names. It includes all the content types that will be available for a document library. - /// - /// The document template names. - public string DocumentTemplateNames - { - get; - set; - } - - /// - /// Gets or sets the id of the term (sub area of law). This is a GUID value (string representation) and is used as the Id property of the Term. - /// - /// The id of the term. - public string Id - { - get; - set; - } - - /// - /// Gets or sets the WssID of the term (sub area of law). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. - /// - /// The WssID of the term. - public int WssId - { - get; - set; - } - } - - /// - /// Provides the structure required for area of law term. It includes area of law, practice group, id , wssid and list of sub area of law. - /// - public class AreaTerm - { - /// - /// Gets or sets the name of the term (area of law). - /// - /// The name of the term. - public string TermName - { - get; - set; - } - - /// - /// Gets or sets the name of the parent term (practice group). - /// - /// The name of the parent term. - public string ParentTermName - { - get; - set; - } - - /// - /// Gets or sets the folder names. This is used for creation of folders when a matter is created. - /// - /// The folder names. - public string FolderNames - { - get; - set; - } - - /// - /// Gets or sets the sub area terms. It includes the list of sub area of law falling under particular area of law. - /// - /// The sub area terms. - public IList SubareaTerms - { - get; - set; - } - - /// - /// Gets or sets the id of the term (area of law). This is a GUID value (string representation) and is used as the Id property of the Term. - /// - /// The id of the term. - public string Id - { - get; - set; - } - - /// - /// Gets or sets the WssId of the term (area of law). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. - /// - /// The WssId of the term. - public int WssId - { - get; - set; - } - } - - /// - /// Provides the structure required for practice group term set. It includes the practice group, client term set, folders, id , wssid, and list of area team under practice group. - /// - public class PracticeGroupTerm - { - /// - /// Gets or sets the name of the term (practice group). - /// - /// The name of the term. - public string TermName - { - get; - set; - } - - /// - /// Gets or sets the name of the parent term (client term set). - /// - /// The name of the parent term. - public string ParentTermName - { - get; - set; - } - - /// - /// Gets or sets the folder names. This is used for creation of folders when a matter is created. - /// - /// The folder names. - public string FolderNames - { - get; - set; - } - - /// - /// Gets or sets all the area of law under particular practice group. - /// - /// The area terms. - public IList AreaTerms - { - get; - set; - } - - /// - /// Gets or sets the id of the term (practice group). This is a GUID value (string representation) and is used as the Id property of the Term. - /// - /// The id of the term. - public string Id - { - get; - set; - } - - /// - /// Gets or sets the WssId of the term (practice group). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. - /// - /// The WssId of the term. - public int WssId - { - get; - set; - } - } - - /// - /// Provides the structure required for generic term sets. It includes the term set name and list of practice group under that term set. - /// - public class TermSets - { - /// - /// Gets or sets the term set name. - /// - /// The name. - public string Name - { - get; - set; - } - - /// - /// Gets or sets the list of practice group terms. - /// - /// The PG terms. - public IList PGTerms - { - get; - set; - } - } - - /// - /// Provides the structure required for generic term groups. It includes the term group name and the list of term sets under the group. - /// - public class TermGroups - { - /// - /// Gets or sets the term group name. - /// - /// The name. - public string Name - { - get; - set; - } - - /// - /// Gets or sets the list of term sets under the term group. - /// - /// The term sets. - public IList TermSets - { - get; - set; - } - } - - /// - /// Provides the structure required for generic term stores. It includes the term store and the list of term group under the term store. - /// - public class TermStores - { - /// - /// Gets or sets the term store name. - /// - /// The name. - public string Name - { - get; - set; - } - - /// - /// Gets or sets the list of term groups under the term store. - /// - /// The term groups. - public IList TermGroups - { - get; - set; - } - } - - /// - /// Provides the structure required for generic collection of term stores. - /// - public class TermStoreObject - { - /// - /// Gets or sets the list of term stores. - /// - /// The term stores. - public IList TermStores - { - get; - set; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.bowerrc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.bowerrc new file mode 100644 index 00000000..e96f9f2e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "./lib" +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.vs/config/applicationhost.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.vs/config/applicationhost.config new file mode 100644 index 00000000..62066d03 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/.vs/config/applicationhost.config @@ -0,0 +1,1028 @@ + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/JasmineTest.html b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/JasmineTest.html new file mode 100644 index 00000000..0ef729a5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/JasmineTest.html @@ -0,0 +1,105 @@ + + + + Jasmine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Microsoft.Legal.MatterCenter.Jasmine.csproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Microsoft.Legal.MatterCenter.Jasmine.csproj new file mode 100644 index 00000000..d9a12cbb --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Microsoft.Legal.MatterCenter.Jasmine.csproj @@ -0,0 +1,197 @@ + + + + + + + Debug + AnyCPU + + + 2.0 + {D6F8976C-1DC3-4106-B11E-5104B91DD9D5} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Microsoft.Legal.MatterCenter.Jasmine + Microsoft.Legal.MatterCenter.Jasmine + v4.5.2 + true + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + app\app.js + + + app\dashboard\documentdashboard.controller.js + + + app\dashboard\documentdashboard.resources.js + + + app\dashboard\matterdashboard.controller.js + + + app\dashboard\matterdashboard.resources.js + + + app\directives\common.directive.js + + + app\directives\drag.directive.js + + + app\directives\drop.directive.js + + + app\directives\heading.directive.js + + + app\document\document.resources.js + + + app\document\documents.controller.js + + + app\home.controller.js + + + app\home.resources.js + + + app\matter\createMatter.controller.js + + + app\matter\matter.resources.js + + + app\matter\matters.controller.js + + + app\matter\Upload.js + + + app\navigation.controller.js + + + app\services\api.service.js + + + app\services\auth.service.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 43336 + / + http://localhost:43336/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Object/ObjectCollection.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Object/ObjectCollection.js new file mode 100644 index 00000000..fcea7471 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Object/ObjectCollection.js @@ -0,0 +1,396 @@ +var vm, matterResource, $filter, $window, $watch, $http, $stateParams; +var $rootScope = { logEvent: function () { }, setAuthenticatedUserContext: function () { } }; +var rootScope = {}; +var $model = {}; +var $label = { assignedUser: "" }; +var $item = { + email: "", + name: "No results found" +}; +var $state = { go: function () { }, current: { "name": "" } }; +var $interval = { go: function () { } }; +var $animate = { enabled: function () { } }; +var $q = { defer: function () { return { resolve: function () { } } } }; +var $scope = { $watch: function () { }, $apply: function () { }, gridApi: { infiniteScroll: { dataLoaded: function () { } }, selection: { selectAllRows: function () { }, clearSelectedRows: function () { } } } }; +var $location = { + absUrl: function () { + var url = "https://mattermaqdevsite.azurewebsites.net&test=1&attempt=2|jasminetest.html"; + return url; + } +}; + +var adalService = { + "userInfo": { + "userName": "MAQUser@LCADMS.onmicrosoft.com", + "profile": { + "given_name": "MAQ", + "family_name": "LCADMS", + "oid": 786 + }, + "isAuthenticated": true + }, + logOut: function () { vm.status = true; } +}; + +var mockapi = function () { +}; + +var mocknavigationResource = { + 'canCreateMatter': '/api/v1/matter/cancreate' +}; + +var mockMatterDashBoardResource = { + 'get': '/api/v1/matter/get', + 'getPinnedMatters': '/api/v1/matter/getpinned', + 'getMyMatters': '/api/v1/matter/getpinned', + 'getTaxonomyDetails': '/api/v1/taxonomy/gettaxonomy', + 'UnpinMatter': '/api/v1/matter/unpin', + 'PinMatter': '/api/v1/matter/pin', + 'getFolderHierarchy': '/api/v1/matter/getfolderhierarchy', + 'getMatterCounts': '/api/v1/matter/getmattercounts', + 'getDefaultMatterConfigurations': '/api/v1/matter/getconfigurations' +}; + +var mockMatterResource = { + 'get': '/api/v1/matter/get', + 'getPinnedMatters': '/api/v1/matter/getpinned', + 'UnpinMatters': '/api/v1/matter/unpin', + 'PinMatters': '/api/v1/matter/pin', + 'getTaxonomyDetails': '/api/v1/taxonomy/gettaxonomy', + 'checkMatterExists': '/api/v1/matter/checkmatterexists', + 'getDefaultMatterConfigurations': '/api/v1/matter/getconfigurations', + 'getUsers': '/api/v1/user/getusers', + 'getRoles': '/api/v1/user/getroles', + 'getPermissionLevels': '/api/v1/user/getpermissionlevels', + 'checkSecurityGroupExists': '/api/v1/matter/checksecuritygroupexists', + 'getFolderHierarchy': '/api/v1/matter/getfolderhierarchy', + 'createMatter': '/api/v1/matter/create', + 'assignUserPermissions': '/api/v1/matter/assignuserpermissions', + 'assignContentType': '/api/v1/matter/assigncontenttype', + 'createLandingPage': '/api/v1/matter/createlandingpage', + 'updateMatterMetadata': '/api/v1/matter/UpdateMetadata', + 'getStampedProperties': '/api/v1/matter/getstampedproperties', + 'uploadEmail': '/api/v1/document/UploadMail', + 'uploadAttachment': '/api/v1/document/UploadAttachments', + 'uploadfiles': '/api/v1/document/UploadAttachments', + 'getHelp': '/api/v1/shared/help' +}; + +var mockHomeResource = { + 'getHelp': '/api/v1/shared/help', + 'getUserProfilePicture': '/api/v1/user/getuserprofilepicture', + 'canCreateMatter': '/api/v1/matter/cancreate' +}; + +var data = { "name": "" }; + +var mockDocumentDashBoardResource = { + 'get': '/api/v1/document/getdocuments', + 'getPinnedDocuments': '/api/v1/document/getpinneddocuments', + 'getMyDocuments': '/api/v1/document/getdocuments', + 'getTaxonomyDetails': '/api/v1/taxonomy/gettaxonomy', + 'unPinDocument': '/api/v1/document/unpindocument', + 'pinDocument': '/api/v1/document/pindocument', + 'downloadattachmentsasstream': '/api/v1/email/downloadattachmentsasstream', + 'downloadAttachments': '/api/v1/email/downloadattachments', + 'getDocumentCounts': '/api/v1/document/getdocumentcounts' +}; + + +var mockDocumentResource = { + 'get': '/api/v1/document/getdocuments', + 'getPinnedDocuments': '/api/v1/document/getpinneddocuments', + 'unPinDocument': '/api/v1/document/unpindocument', + 'pinDocument': '/api/v1/document/pindocument', + 'getassets': '/api/v1/document/getassets' +}; + + +var mockMatterResourceService = { + 'get': '/api/v1/matter/get', + 'getPinnedMatters': '/api/v1/matter/getpinned', + 'UnpinMatters': '/api/v1/matter/unpin', + 'PinMatters': '/api/v1/matter/pin', + 'getTaxonomyDetails': '/api/v1/taxonomy/gettaxonomy', + 'checkMatterExists': '/api/v1/matter/checkmatterexists', + 'getDefaultMatterConfigurations': '/api/v1/matter/getconfigurations', + 'getUsers': '/api/v1/user/getusers', + 'getRoles': '/api/v1/user/getroles', + 'getPermissionLevels': '/api/v1/user/getpermissionlevels', + 'checkSecurityGroupExists': '/api/v1/matter/checksecuritygroupexists', + 'getFolderHierarchy': '/api/v1/matter/getfolderhierarchy', + 'createMatter': '/api/v1/matter/create', + 'assignUserPermissions': '/api/v1/matter/assignuserpermissions', + 'assignContentType': '/api/v1/matter/assigncontenttype', + 'createLandingPage': '/api/v1/matter/createlandingpage', + 'updateMatterMetadata': '/api/v1/matter/UpdateMetadata', + 'getStampedProperties': '/api/v1/matter/getstampedproperties', + 'uploadEmail': '/api/v1/document/UploadMail', + 'uploadAttachment': '/api/v1/document/UploadAttachments', + 'uploadfiles': '/api/v1/document/UploadAttachments', + 'getHelp': '/api/v1/shared/help' +}; + +var selectedPracticeGroup = { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Practice Groups", + "folderNames": "Email;Lorem;Ipsum", + "areaTerms": [ + { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Advertising, Marketing & Promotions", + "folderNames": "Email;Lorem;Ipsum", + "subareaTerms": [ + { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Advertising, Marketing & Promotions", + "folderNames": "Email;Lorem;Ipsum", + "isNoFolderStructurePresent": "false", + "documentTemplates": "Advertising, Marketing & Promotions", + "documentTemplateNames": "Agribusiness;Aircraft;California Public Utilities Commission (CPUC);Class Action Defense", + "id": "683ec070-7ed0-4e82-b07c-13a1b4485b7b", + "wssId": 0, + "subareaTerms": null, + "$$hashKey": "object:153" + } + ], + "id": "16827aa4-a8b3-4275-920b-184a04bc60ea", + "wssId": 0, + "$$hashKey": "object:149" + } + ], + "id": "a42ab615-0d27-4de2-9f55-144e71219770", + "wssId": 0, + "$$hashKey": "object:122" +} + +var documentTemplateTypeLawTerm = { + "areaoflaw": "Family Business", + "areaoflawId": "584a173b-7686-427d-aadb-62b13a2fd624", + "documentTemplateNames": "Copyright;Copyright Litigation", + "documentTemplates": "Family Business", + "folderNames": "Email;Lorem;Ipsum", + "foldernamesaol": "Email;Lorem;Ipsum", + "foldernamespg": "Email;Lorem;Ipsum", + "id": "578cfafb-59eb-4f4c-b219-47886c61e384", + "isNoFolderStructurePresent": "false", + "parentTermName": "Family Business", + "practicegroup": "Business Transactions", + "practicegroupId": "b36c5722-b6ee-4253-902b-743d63fa80ce", + "primaryMatterType": "true", + "subareaTerms": "null", + "termName": "Family Business", + "wssId": "0" +} + +var subareaTerms = + [{ + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Advertising, Marketing & Promotions", + "folderNames": "Email;Lorem;Ipsum", + "isNoFolderStructurePresent": "false", + "documentTemplates": "Advertising, Marketing & Promotions", + "documentTemplateNames": "Agribusiness;Aircraft;California Public Utilities Commission (CPUC);Class Action Defense", + "id": "578cfafb-59eb-4f4c-b219-47886c61e384", + "primaryMatterType": "true", + "wssId": 0, + "subareaTerms": null, + "$$hashKey": "object:153" + }] + +var item = { + "email": "MAQUser@LCADMS.onmicrosoft.com", + "entityType": "User", + "largePictureUrl": null, + "logOnName": "i:0#.f|membership|maquser@lcadms.onmicrosoft.com", + "name": "MAQ User", +} + +var obj = [{ + "documentName": "SharePoint Online is out of storage space.eml", + "documentVersion": "2.0", + "documentClient": "SubsiteClient", + "documentClientId": "98052", + "documentClientUrl": "https://lcadms.sharepoint.com/sites/subsiteclient", + "documentMatter": "Default Matter", + "documentMatterId": "11111", + "documentOwner": "MAQ User", + "documentUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum/SharePoint Online is out of storage space.eml", + "documentOWAUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum/SharePoint Online is out of storage space.eml", + "documentExtension": "eml", + "documentCreatedDate": "5/17/2016 12:41:06 PM", + "documentModifiedDate": "5/17/2016 12:41:07 PM", + "documentCheckoutUser": "", + "documentMatterUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a", + "documentParentUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum", + "documentID": "425427363", + "checker": true, + "documentIconUrl": "https://lcadms.sharepoint.com/_layouts/15/images/iceml.gif", + "pinType": "Pin", + "$$hashKey": "object:286", + "selected": true +}, +{ + "documentName": "SharePoint Online is out of storage space.eml", + "documentVersion": "2.0", + "documentClient": "SubsiteClient", + "documentClientId": "98052", + "documentClientUrl": "https://lcadms.sharepoint.com/sites/subsiteclient", + "documentMatter": "Default Matter", + "documentMatterId": "11111", + "documentOwner": "MAQ User", + "documentUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum/SharePoint Online is out of storage space.eml", + "documentOWAUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum/SharePoint Online is out of storage space.eml", + "documentExtension": "eml", + "documentCreatedDate": "5/17/2016 12:41:06 PM", + "documentModifiedDate": "5/17/2016 12:41:07 PM", + "documentCheckoutUser": "", + "documentMatterUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a", + "documentParentUrl": "https://lcadms.sharepoint.com/sites/subsiteclient/6cbca4ab447c87302d3a1f0e3c32985a/Ipsum", + "documentID": "425427363", + "checker": true, + "documentIconUrl": "https://lcadms.sharepoint.com/_layouts/15/images/iceml.gif", + "pinType": "Pin", + "$$hashKey": "object:286", + "selected": true +}] + +var clientobj = [{ + "id": "0016765", + "name": "A. Datum Corporation", + "url": "https://lcadms.sharepoint.com/sites/ADatumCorporation", + "$$hashKey": "object:320", + "Selected": true +}, + { + "id": "0016761", + "name": "AdventureWorks Cycles", + "url": "https://lcadms.sharepoint.com/sites/AdventureWorksCycles", + "$$hashKey": "object:321", + "Selected": false + }, + { + "id": "0016762", + "name": "Alpine Ski House", + "url": "https://lcadms.sharepoint.com/sites/AlpineSkiHouse", + "$$hashKey": "object:322", + "Selected": false + }] + +var event = { + preventDefault: function () { this.defaultPrevented = true; }, + isDefaultPrevented: function () { return this.defaultPrevented === true; }, + stopImmediatePropagation: function () { this.immediatePropagationStopped = true; }, + isImmediatePropagationStopped: function () { return this.immediatePropagationStopped === true; }, + stopPropagation: function () { }, + currentTarget: { src: "" } +} + +var practicegroup = [ + { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Practice Groups", + "folderNames": "Email;Lorem;Ipsum", + "areaTerms": [ + { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Advertising, Marketing & Promotions", + "folderNames": "Email;Lorem;Ipsum", + "subareaTerms": [ + { + "termName": "Advertising, Marketing & Promotions", + "parentTermName": "Advertising, Marketing & Promotions", + "folderNames": "Email;Lorem;Ipsum", + "isNoFolderStructurePresent": "false", + "documentTemplates": "Advertising, Marketing & Promotions", + "documentTemplateNames": "Agribusiness;Aircraft;California Public Utilities Commission (CPUC);Class Action Defense", + "id": "683ec070-7ed0-4e82-b07c-13a1b4485b7b", + "wssId": 0, + "subareaTerms": null + } + ], + "id": "16827aa4-a8b3-4275-920b-184a04bc60ea", + "wssId": 0, + "Selected": true + } + ], + "id": "a42ab615-0d27-4de2-9f55-144e71219770", + "wssId": 0, + "$$hashKey": "object:582", + "Selected": true + }, + { + "termName": "Bankruptcy & Creditors Rights", + "parentTermName": "Practice Groups", + "folderNames": "Email;Lorem;Ipsum", + "areaTerms": [ + { + "termName": "Bankruptcy", + "parentTermName": "Bankruptcy & Creditors Rights", + "folderNames": "Email;Lorem;Ipsum", + "subareaTerms": [ + { + "termName": "Personal Bankruptcy", + "parentTermName": "Bankruptcy", + "folderNames": "Email;Bankruptcy", + "isNoFolderStructurePresent": "false", + "documentTemplates": "Bankruptcy & Creditors Rights", + "documentTemplateNames": "California Public Utilities Commission (CPUC);Class Action Defense", + "id": "2aa63c68-bcde-411b-bb0f-dc266de78a46", + "wssId": 0, + "subareaTerms": null + } + ], + "id": "b6678495-0a16-424e-a94e-8a73d326e5bb", + "wssId": 0, + "Selected": false + } + ], + "id": "1a185a92-569a-466e-8c94-e2c31083a821", + "wssId": 0, + "$$hashKey": "object:583", + "Selected": false + }] + +var gridrows = { + "core": { + getVisibleRows: function (data) { return 0; } + } +} + +function getData(objectData, resourceData) { + var sURL = oTestConfiguration.sSiteURL + resourceData[objectData.method]; + var http = new XMLHttpRequest(); + var sPostdata; + + if (!IsJsonString(objectData.data)) { + sPostdata = JSON.stringify(objectData.data); + } else { + sPostdata = objectData.data; + } + http.open("POST", sURL, false); + var accessToken = "Bearer " + sessionStorage.getItem("adal.idtoken"); + // Send the proper header information along with the request + http.setRequestHeader("Content-type", "application/json"); + http.setRequestHeader("Accept", "application/json"); + http.setRequestHeader("Authorization", accessToken); + http.send(sPostdata); + + if (http.status === 200) {// That's HTTP for 'ok' + if (objectData.success) { + objectData.success(JSON.parse(http.responseText)); + } + else { + return JSON.parse(http.responseText); + } + } +} + +function IsJsonString(sValue) { + try { + JSON.parse(sValue); + } catch (exception) { + return false; + } + return true; +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Open Notebook.onetoc2 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Open Notebook.onetoc2 new file mode 100644 index 00000000..8a4e47c6 Binary files /dev/null and b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Open Notebook.onetoc2 differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3767650e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Jasmine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Jasmine")] +[assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d6f8976c-1dc3-4106-b11e-5104b91dd9d5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/TestConfig.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/TestConfig.js new file mode 100644 index 00000000..40fc960f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/TestConfig.js @@ -0,0 +1,65 @@ +var oTestConfiguration = { + sSiteURL: "http://matterwebapp.azurewebsites.net", + sValidMatterName: "Test Matter 112233", + sValidMatterClientURL: "https://lcadms.sharepoint.com/sites/microsoft", + sInvalidMatterName: "Microsoft Test", + sInvalidMatterURL: "https://lcadms.sharepoint.com/sites/microsoft", + sSourceIconURL: "https://lcadms.sharepoint.com/_layouts/15/images/icsourceicon.gif", + sEmailSubject: "CELA Project Center Feedback and Support request", + sLearnMoreLink: "http://www.microsoft.com/mattercenter", + sOverwriteConfigFileName: "testEmail.eml", + sSelectedClient: "A. Datum Corporation", + sSelectedPracticeGroup: "Advertising, Marketing & Promotions", + sSelectedAreaOfLaw: "Advertising, Marketing & Promotions", + sActiveSubAreaOfLawTerm: "Advertising, Marketing & Promotions", + sFolderNames: "Email;Lorem;Ipsum", + nGUIDLength: 32, + sLocationURL: "https://matterwebapp.azurewebsites.net&test=1&attempt=2|jasminetest.html", + nDocumentCheckCount: 2, + oClientObj: { id: 16761, name: "Microsoft", url: "https://lcadms.sharepoint.com/sites/microsoft" }, + oDocumentObject: { + documentCheckoutUser: "MAQ User", + documentClient: "Awesome Computers", + documentClientId: "0016763", + documentClientUrl: "https://lcadms.sharepoint.com/sites/awesomecomputers", + documentCreatedDate: "2/11/2016 10:55:43 AM", + documentExtension: "docx", + documentIconUrl: "https://lcadms.sharepoint.com/_layouts/15/images/icdocx.gif", + documentID: "17592407627949", + documentMatter: "Test GitHub build", + documentMatterId: "TGB001", + documentMatterUrl: "https://lcadms.sharepoint.com/sites/AwesomeComputers/727f57900ca2b473b99b25f9e36506d0/Forms", + documentModifiedDate: "2/8/2016 1:06:00 PM", + documentName: "Test Document.docx", + documentOWAUrl: "https://lcadms.sharepoint.com/sites/AwesomeComputers/_layouts/15/WopiFrame.aspx?sourcedoc={ADF55595-76D7-4131-8FE9-807989BA166D}&file=Test%20Document.docx&action=default&DefaultItemOpen=1", + documentOwner: "MAQ User", + documentParentUrl: "https://lcadms.sharepoint.com/sites/AwesomeComputers/727f57900ca2b473b99b25f9e36506d0/Forms/AllItems.aspx", + documentUrl: "https://lcadms.sharepoint.com/sites/AwesomeComputers/_layouts/15/WopiFrame.aspx?sourcedoc={ADF55595-76D7-4131-8FE9-807989BA166D}&file=Test%20Document.docx&action=default&DefaultItemOpen=1", + documentVersion: "2.0", + pinType: "Pin" + }, + oMatterObject: { + matterName: "Default Matter", + matterDescription: "Test Matter", + matterCreatedDate: "19/08/2016", + matterUrl: "https://lcadms.sharepoint.com/sites/subsiteclient/SitePages/6cbca4ab447c87302d3a1f0e3c32985a.aspx", + matterPracticeGroup: "Business Transactions", + matterAreaOfLaw: "Family Business", + matterSubAreaOfLaw: "Family Business", + matterClientUrl: "https://lcadms.sharepoint.com/sites/subsiteclient", + matterClient: "Microsoft", + matterClientId: "578cfafb-59eb-4f4c-b219-47886c61e384", + hideUpload: true, + matterID: "1516561262162", + matterResponsibleAttorney: "CELA", + matterModifiedDate: "19/08/2016", + matterGuid: "578cfafb-59eb-4f4c-b219-47886c61e384", + pinType: 'unpin' + } +}; + +var oEnvironmentConfiguration = { + tenantID: "9a689192-bfc9-4d08-94b9-64b31bc60540", + clientID: "61394aba-09ba-4e25-ae32-e10805c6841b", + instanceURL: "https://login.microsoftonline.com/" +}; \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/app.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/app.js new file mode 100644 index 00000000..f85d75f5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/app.js @@ -0,0 +1,55 @@ + +(function () { + + // Enter Global Config Values & Instantiate ADAL AuthenticationContext + window.config = { + instance: 'https://login.microsoftonline.com/', + tenant: 'msmatter.onmicrosoft.com', //Enter tenant Name e.g. microsoft.onmicrosoft.com + clientId: 'b94f07df-c825-431f-b9c5-b9499e8e9ac1', //Enter your app Client ID created in Azure Portal + postLogoutRedirectUri: window.location.origin, + //cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost. + }; + + var authContext = new AuthenticationContext(config); + + // Get UI jQuery Objects + //var $panel = $(".panel-body"); + var $userDisplay = $(".app-user"); + var $signInButton = $(".app-login"); + var $signOutButton = $(".app-logout"); + var $errorMessage = $(".app-error"); + var $apiBtn = $("#btnAPI"); + + // Check For & Handle Redirect From AAD After Login + var isCallback = authContext.isCallback(window.location.hash); + authContext.handleWindowCallback(); + $errorMessage.html(authContext.getLoginError()); + + if (isCallback && !authContext.getLoginError()) { + window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST); + } + + // Check Login Status, Update UI + var user = authContext.getCachedUser(); + if (user) { + $userDisplay.html(user.userName); + $userDisplay.show(); + $signInButton.hide(); + $signOutButton.show(); + } else { + $userDisplay.empty(); + $userDisplay.hide(); + $signInButton.show(); + $signOutButton.hide(); + } + + // Register NavBar Click Handlers + $signOutButton.click(function () { + authContext.logOut(); + }); + $(document).ready(function () { + if (null == sessionStorage.getItem('adal.idtoken') || "" === sessionStorage.getItem('adal.idtoken')) { + authContext.login(); + } + }); +}()); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/site.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/site.js new file mode 100644 index 00000000..82ecce7b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/site.js @@ -0,0 +1 @@ +// Write your Javascript code. diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/site.min.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/site.min.js new file mode 100644 index 00000000..e69de29b diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/uiconfig.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/uiconfig.js new file mode 100644 index 00000000..df72a7e4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Scripts/uiconfig.js @@ -0,0 +1,275 @@ +var uiconfigs = +{ + "Navigation": { + "MenuItem1LinkTitle": "Home", + "MenuItem1LinkTitle": "Search matters", + "MenuItem1LinkTitle": "Search documents", + "NameTitle": "Matter", + "HeaderBarLink1Title": "Learn more about matter center", + "HeaderBarLink2Title": "Remove this section", + "MenuImageOpenTitle": "Open App Switcher", + "MenuImageCloseTitle": "Close App Switcher", + "HeaderBarLink1Text": "LearnMore", + "HomeMenuText": "Home", + "Image1Title": "Search matters", + "Image2Title": "Search documents", + "HelpRequesURL": "https://lcadms.sharepoint.com/sites/catalog", + "FooterLabel": "Questions? Contact", + "MenuImageCaption": "menu", + "MenuImageTitle": "Matter center menu", + "MenuItem1LinkText": "Home", + "MenuItem2LinkText": "Matters", + "MenuItem3LinkText": "Documents", + "LogoImageTitle": "Matter center home", + "ContextualHelpImageTitle": "Matter center help", + "ContextualHelpLabel1": "Get to know this view", + "ContextualHelpLink1Text": "Home in Outlook and Word", + "ContextualHelpLink1URL": "https://microsoft.sharepoint.com/teams/celapcconfig/Shared%20Documents/CELA%20Project%20Center%20End%20User%20Guide_24.pdf#Home_in_Outlook_and_Word ", + "ContextualHelpLabel2": "How do I get Project Center on my device?", + "ContextualHelpLink2URL": "https://microsoft.sharepoint.com/teams/celapcconfig/Shared%20Documents/CELA%20Project%20Center%20End%20User%20Guide_24.pdf#Enabling_Project_Center", + "ContextualHelpFooterLink1Label": "Matter Center Aisling Support", + "MatterCenterSupportLink": "mailto:support@supportsite.com", + "ContextualHelpFooterLink1Title": "Write an email to support", + "ContextualHelpHeader": "Matter Center For Outlook", + "ContextualHelpFooterLabel": "Questions? Contact ", + "HeaderBarLabel": "Welcome to Matter Center! Upload, share, and save your documents here.", + "Image1Caption": "Matters", + "Image2Caption": "Documents", + "HeaderBarLink1URL": "http://www.microsoft.com/mattercenter", + "HeaderBarLink2Text": "dismiss", + "Image3Caption": "Upload attachments", + "Image4Caption": "Create a new matter", + "Image5Caption": "Go to Matter Center Home", + "FooterLink1Title": "Matter Center Support", + "FooterLink1Text": "Matter Center Support", + "FooterLink1URL": "mailto:lcaweb2@microsoft.com?subject=CELA Project Center Feedback and Support request", + "Image3Title": "Upload documents to a matter", + "Image4Title": "Create a new matter site", + "Image5Title": "Go to the web home page" + }, + "MatterDashboard": { + "GridColumn1Header": "test1", + "GridColumn2Header": "test2", + "GridColumn3Header": "test3", + "GridColumn4Header": "test4", + "GridColumn5Header": "test5", + "AdvSearchLabel1InternalFuncParamText": "client", + "AdvSearchLabel2InternalFuncParamText": "pg", + "AdvSearchLabel3InternalFuncParamText": "aol" + }, + "CreateMatter": { + "Tab1HeaderTitle": "Step 1: Select a client and provide basic information for your new matter.", + "Tab2HeaderTitle": "Step 2: Confirm that a conflict check was conducted and specify who should be conflicted from or given access to this matter.", + "Tab3HeaderTitle": "Step 3: When you've entered all relevant information for your new matter, create the matter and notify your team.", + "ButtonNextText": "Next", + "ButtonPreviousText": "Previous", + "ButtonCreateText": "Create", + "Tab2NoSearchResultText": "No Results Found", + "Tab1Type1Header1Label1": "Select a Practice Group", + "Tab1Type1Footer1Label1": "Please select primary matter type before you save.", + "Tab1SiteColumn1Caption": "Area of Law", + "Tab1SiteColumn2Caption": "Sub Area of Law (select matter type)", + "Tab1SiteColumn3Caption": "Matter Type", + "Tab1Type1Label1": "select primary matter type", + "Tab1ButtonAddTitle": "Add", + "Tab1ButtonRemoveTitle": "Remove", + "MenuImageTitle": "Matter Center menu", + "MenuImageCaption": "menu", + "Tab1ButtonCloseTitle": "Close", + "Tab1ButtonSelectType": "Select Type", + "Tab1ImageLoadingAltText": "Loading...", + "MenuItem1LinkTitle": "Home", + "MenuItem2LinkTitle": "Search matters", + "MenuItem3LinkTitle": "Search documents", + "MenuItem1LinkText": "Home", + "MenuItem2LinkText": "Matters", + "MenuItem3LinkText": "Documents", + "ButtonSaveText": "Save", + "MenuImageOpenTitle": "Open App Switcher", + "MenuImageCloseTitle": "Close App Switcher", + "ButtonDeleteText": "Delete", + "Tab1LeftButtonAltText": "Left", + "Tab1RighttButtonAltText": "Right", + "Tab3SectionText": "You have entered all of the necessary information to create this matter. After you click Create and Notify, the matter will be created and all team members will receive an email containing a link to this matter's location. ", + "Tab1Dropdown1Label": "Client Name", + "Tab1Header": "Open Matter", + "Tab2Header": "Assign Permission", + "Tab3Header": "Create and Notify", + "Tab2Checkbox1Lebal": "Conflict check conducted (must be complete prior to provisioning matter)", + "Tab2Textbox1Label": "Who conducted the conflict check?", + "Tab2DateLabel": "Date Conducted", + "Tab2RadioButton1Label": "Conflict Identified?", + "Tab2RadioButton1Option1": "Yes", + "Tab2RadioButton1Option2": "No", + "Tab2Textbox2Label": "Conflicted Users", + "Tab1Textbox1Label": "Client ID", + "Tab2Textbox2PlaceHolder": "Enter and select names", + "Tab2RadioButton2Label": "Would you like this matter to be secured only to the assigned team?", + "Tab2RadioButton2Option1": "Yes", + "Tab2RadioButton2Option2": "No", + "Tab2TeamHeader": "Assign Team", + "Tab2Textbox3Label": "Name", + "Tab2Textbox3PlaceHolder": "Enter and select names", + "Tab2Deopdown1Label": "Role", + "Tab2Deopdown2Label": "Permission Level", + "Tab2AddMoreHeaderLabel": "Add More Names", + "Tab1Textbox2Label": "Matter Name", + "Tab3CheckBox1Text": "Include calendar", + "Tab3CheckBox2Text": "Include RSS Feeds", + "Tab3CheckBox3Text": "Include email notification", + "Tab3CheckBox4Text": "Include Tasks", + "Tab3ButtonText": "Create and Notify", + "Tab1Textbox2PlaceholderText": "Enter a name for this matter", + "Tab1Textbox3Label": "Matter ID", + "Tab1Textbox3PlaceholderText": "Enter a matter ID", + "Tab1Textbox4Label": "Matter Description", + "Tab1Textbox4PlaceholderText": "Enter a brief description of the matter", + "Tab1Textbox5Label": "Matter Type (click Select to define the practice group and area of law)" + }, + "Header": { + "MenuImage1Title": "Matter center menu", + "MenuImage1Caption": "menu", + "MenuImage1OpenTitle": "Open App Switcher", + "MenuImage1CloseTitle": "Close App Switcher", + "Menu1Option1Title": "Home", + "Menu1Option2Title": "Search matters", + "Menu1Option3Title": "Search documents", + "Menu1Option1Text": "Home", + "Menu1Option2Text": "Matters", + "Menu1Option3Text": "Documents", + "ContextualHelpImageTitle": "Matter center help", + "ContextualHelpHeader": "Matter Center For Outlook", + "ContextualHelpNoLinkText": "There are no help links available.", + "ContextualHelpFooterLink1Label": "Matter Center Aisling Support", + "LogoImageTitle": "Matter center home", + "ContextualHelpLabel1": "Get to know this view", + "ContextualHelpLabel2": "How do I get Project Center on my device?", + "MatterCenterSupportLink": "mailto:support@supportsite.com", + "ContextualHelpFooterLink1Title": "Write an email to support", + "ContextualHelpFooterLabel": "Questions? Contact ", + "ContextualHelpAltText": "Contextual Help", + "ContextualHelpFlyoutAltText": "Close flyout", + "CloseTitle": "Close" + }, + "Documents": { + "EllipsisLink4Text": "Unpin this Document", + "StartDatePlaceHolder": "Start mm/dd/yyyy", + "EndDatePlaceHolder": "End mm/dd/yyyy", + "ImageWarningTitle": "Warning", + "ImageWarningAltText": "Warning icon", + "AttachmentSuccessfullyMsgText": "Documents successfully attached.", + "AttachmentProgressingText": "Attaching", + "AttachmentProgressingWarningText": "Do not close Matter Center until all documents are attached.", + "AttachmentLoadingText": "Loading...", + "ButtonOkText": "Ok", + "ImageClearTitle": "Clear", + "LabelCloseText": "Close", + "ClearFilterFromLabelText": "Clear filters from ", + "NoFilterMatchMsgTitle": "There are no items that match this filter", + "NoFilterMatchMsgText": "There are no items that match this filter", + "LabelDocumentText": "documents...", + "LabelOfText": "of", + "ImageClearAltText": "Clear filters", + "FilterSearchPlaceholderText": "Search", + "EllipsisDocTypeIconAltText": "Document type icon", + "GridColumn8Header": "Created Date", + "Dropdown1Item1": "All Documents", + "Dropdown1Item2": "My Documents", + "Dropdown1Item3": "Pinned Documents", + "SearchPlaceholderText": "Search by ID, or document or client name", + "NoDataSearchText": "Nothing matches your search term or the filter you selected. Please try again.
If you applied a filter, remove it to get back to your list.
Search suggestions:
  • Make sure all words are spelled correctly
  • Try different keywords
  • Try searching by the matter name or client name
  • Try more general search terms
", + "GridColumn1Header": "Document", + "GridColumn2Header": "Client", + "GridColumn3Header": "Client.MatterID", + "GridColumn4Header": "Modified Date", + "GridColumn5Header": "Author", + "GridColumn6Header": "Document Version", + "GridColumn7Header": "Checked out to", + "HeaderText": "All Documents", + "EllipsisLink1Text": "Open this Document", + "EllipsisLink2Text": "View Matter Details", + "EllipsisLink3Text": "Pin this Document", + "FlyoutButton1Text": "Open document", + "FlyoutButton2Text": "View document details" + }, + "Matters": { + "EllipsisLink5Text": "Unpin this matter", + "AttachmentEditImageTitle": "Edit attachment name", + "AttachmentEditImageAltText": "Edit", + "AttachmentSaveImageTitle": "Save attachment name", + "AttachmentSaveImageText": "Save", + "AttachmentUploadSuccessfullyImageAltText": "Uploaded successfully", + "AttachmentIconImageAltText": "attachment icon", + "AttachmentTestTitle": "Test attachments", + "AttachmentEmptyText": "No files uploaded", + "AttachmentBreadcrumAltText": "Root", + "AttachmentFolderAltText": "Documents", + "FilterSearchPlaceholderText": "Search", + "ClearFilterText": "Clear filters from ", + "NoFilterMatchMsgTitle": "There are no items that match this filter", + "NoFilterMatchMsgText": "There are no items that match this filter", + "ImageCloseText": "Close", + "ImageClearTitle": "Clear", + "ImageClearAltText": "Clear filters", + "ClearFilterFromLabelText": "Clear filters from ", + "ImageWarningAltText": "Warning Message", + "Button1DuplicateContentTitle": "Matter Center will compare all content and data associated with the two documents. Navigating away from this screen will cancel the content check.", + "Button1DuplicateContentText": "Perform content check", + "Button2SaveLatestVersionTitle": "The file will be saved as the latest version of the existing document that has same title. Matter Center will retain all prior versions of the document.", + "Button2SaveLatestVersionText": "Save as latest version", + "Button3AppendDateTitle": "The file will be saved as new, separate document with the current date and time added to the end of the file name.", + "Button3AppendDateText": "Append date to file name and save", + "Button4CancelUploadTitle": "This document will not be uploaded and you will return to the previous screen.", + "Button4CancelUploadText": "Cancel upload", + "Button5OkTitle": "This document will not be uploaded and you will return to the previous screen.", + "Button5OkText": "Ok", + "Image1ContentCheckText": "Checking content ", + "Button6CancelText": "Cancel", + "UploadCompleteLabel1Text": "Upload complete.", + "CloseIconText": "x", + "StartDatePlaceHolder": "Start mm/dd/yyyy", + "EndDatePlaceHolder": "End mm/dd/yyyy", + "GridColumn8Header": "Area of Law", + "AttachmentLoadingText": "Loading...", + "GridColumn5Header": "Responsible Attorney", + "GridColumn6Header": "Sub Area of Law", + "GridColumn7Header": "Open Date", + "Dropdown1Item1": "All Matters", + "Dropdown1Item2": "My Matters", + "Dropdown1Item3": "Pinned Matters", + "SearchPlaceholderText": "Search by ID, or matter or client name", + "NoDataSearchText": "Nothing matches your search term or the filter you selected. Please try again.
If you applied a filter, remove it to get back to your list.
Search suggestions:
  • Make sure all words are spelled correctly
  • Try different keywords
  • Try searching by the matter name or client name
  • Try more general search terms
", + "GridColumn1Header": "Matter", + "GridColumn2Header": "Client", + "GridColumn3Header": "Client.MatterID", + "GridColumn4Header": "Modified Date", + "HeaderText": "All Matters", + "EllipsisLink1Text": "Upload to this Matter", + "EllipsisLink2Text": "View Matter Details", + "EllipsisLink3Text": "Go to Matter OneNote", + "EllipsisLink4Text": "Pin this matter", + "FlyoutButton1Text": "View matter details", + "FlyoutButton2Text": "Upload to a matter", + "AttachmentPopupHeaderText": "Drag and drop items to folders on the right", + "AttachmentPopupFooterImageCapetion": "You can also drag and drop files from your desktop.", + "AttachmentPopupHeaderItem1Text": "Items", + "AttachmentPopupHeaderItem2Text": "Folders", + "AttachmentPopupHeaderText": "Upload to a matter" + }, + "MatterUsers": { + "StampedPropertiesURL": "https://lcadms.sharepoint.com/sites/microsoft", + "SearchUsersURL": "https://lcadms.sharepoint.com/sites/client" + }, + "DocumentDashboard": { + "GridColumn1Header": "test1", + "GridColumn2Header": "test2", + "GridColumn3Header": "test3", + "GridColumn4Header": "test4", + "GridColumn5Header": "test5", + "GridColumn6Header": "test6", + "AdvSearchLabel1InternalFuncParamText": "client", + "AdvSearchLabel2InternalFuncParamText": "pg", + "AdvSearchLabel3InternalFuncParamText": "aol" + } + +}; diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterController.spec.js new file mode 100644 index 00000000..fd45b70c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterController.spec.js @@ -0,0 +1,336 @@ +/// JS2074, JS3058 +// Test suite +describe("CreateMatter Controller test suite", function () { + "use strict"; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("matterResource", ["$resource", "auth", mockMatterResourceService]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $injector, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("createMatterController as vm", { $scope: $scope, $rootScope: rootScope, $state: $state, $stateParams: $stateParams, matterResource: mockMatterResourceService, api: mockapi }); + })); + + describe("Verification of clearpopup function", function () { + it("It should set an errorPopUpBlock to false", function () { + vm.clearPopUp(); + expect(vm.errorPopUpBlock).toBe(false); + }); + + it("It should not define errorPopUpBlock", function () { + expect(vm.errorPopUpBlock).toBeUndefined(); + }); + }); + + describe("Verification of getMatterGUID function", function () { + it("It should return the GUID for matter with length of 32 alphanumeric characters", function () { + expect(vm.matterGUID.length).toBe(oTestConfiguration.nGUIDLength); + }); + + it("It should not return null value", function () { + expect(vm.matterGUID).not.toBe(null); + }); + + it("It should return the GUID for matter with defined value", function () { + expect(vm.matterGUID).toBeDefined(); + }); + }); + + describe("Verification of selectMatterTypePopUpClose function", function () { + it("It should hide popupContainerBackground and popupContainer", function () { + vm.popupContainer = "Show"; + vm.selectMatterTypePopUpClose(); + expect(vm.popupContainerBackground).toBe("hide"); + expect(vm.popupContainer).toBe("hide"); + }); + + it("It should show popupContainerBackground and should hide popupContainer", function () { + vm.popupContainer = "hide"; + vm.selectMatterTypePopUpClose(); + expect(vm.popupContainerBackground).toBe("Show"); + expect(vm.popupContainer).toBe("hide"); + }); + }); + + //describe("Verification of getSelectedPracticeGroupValue function", function () { + // it("It should return the selected PracticeGroup Value for all AOL and SAOL terms)", function () { + // vm.selectedPracticeGroup = selectedPracticeGroup; + // vm.getSelectedPracticeGroupValue(); + // expect(vm.areaOfLawTerms).not.toBe(null); + // expect(vm.subAreaOfLawTerms).not.toBe(null); + // expect(vm.activeSubAOLTerm.termName).toBe(oTestConfiguration.sActiveSubAreaOfLawTerm); + // expect(vm.activeAOLTerm.folderNames).toBe(oTestConfiguration.sFolderNames); + // expect(vm.errorPopUp).toBe(false); + // }); + + // it("It should return the null value for selected PracticeGroup for AOL and SAOL terms", function () { + // vm.selectedPracticeGroup = null; + // vm.getSelectedPracticeGroupValue(); + // expect(vm.areaOfLawTerms).toBe(null); + // expect(vm.subAreaOfLawTerms).toBe(null); + // }); + //}); + + //describe("Verification of selectAreaOfLawTerm function", function () { + // it("It should return the sub area of law term on selection of area of law term", function () { + // vm.selectAreaOfLawTerm(selectedPracticeGroup.areaTerms[0]); + // expect(vm.subAreaOfLawTerms).not.toBe(null); + // expect(vm.activeSubAOLTerm.termName).toBe(oTestConfiguration.sActiveSubAreaOfLawTerm); + // expect(vm.errorPopUp).toBe(false); + // expect(vm.activeAOLTerm).toBe(selectedPracticeGroup.areaTerms[0]); + // }); + + // it("It should defined sub area of law term on selection of area of law term", function () { + // vm.selectAreaOfLawTerm(selectedPracticeGroup.areaTerms[0]); + // expect(vm.subAreaOfLawTerms).not.toBeUndefined(); + // expect(vm.activeSubAOLTerm).not.toBeUndefined(); + // expect(vm.errorPopUp).not.toBeUndefined(); + // expect(vm.activeAOLTerm).not.toBeUndefined(); + // }); + //}); + + //describe("Verification of selectSubAreaOfLawTerm function", function () { + // it("It should return the sub area of law items", function () { + // vm.selectSubAreaOfLawTerm(selectedPracticeGroup.areaTerms[0].subareaTerms[0]); + // expect(vm.activeSubAOLTerm).toBe(selectedPracticeGroup.areaTerms[0].subareaTerms[0]); + // expect(vm.errorPopUp).toBe(false); + // }); + + // it("It should not return undefined value for sub area of law items", function () { + // vm.selectSubAreaOfLawTerm(selectedPracticeGroup.areaTerms[0].subareaTerms[0]); + // expect(vm.activeSubAOLTerm).not.toBeUndefined(); + // expect(vm.errorPopUp).not.toBeUndefined(); + // }); + //}); + + describe("Verification of selectDocumentTemplateTypeLawTerm function", function () { + it("It should not return null value for the document template type term", function () { + vm.selectDocumentTemplateTypeLawTerm(documentTemplateTypeLawTerm); + expect(vm.removeDTItem).toBe(true); + expect(vm.errorPopUp).toBe(false); + expect(vm.activeDocumentTypeLawTerm).toBe(documentTemplateTypeLawTerm); + expect(vm.primaryMatterType).toBe(true); + }); + + it("It should return correct value for document template type term", function () { + vm.selectDocumentTemplateTypeLawTerm(documentTemplateTypeLawTerm); + expect(vm.removeDTItem).not.toBe(false); + expect(vm.errorPopUp).not.toBe(true); + expect(vm.activeDocumentTypeLawTerm).not.toBe(null); + expect(vm.primaryMatterType).not.toBe(false); + }); + }); + + describe("Verification of addToDocumentTemplate function", function () { + it("It should return the document template type law terms", function () { + vm.activeSubAOLTerm = documentTemplateTypeLawTerm; + vm.documentTypeLawTerms = subareaTerms; + vm.addToDocumentTemplate(); + expect(vm.documentTypeLawTerms).not.toBeUndefined(); + }); + + it("It should not return null value for activeDocumentTypeLawTerm", function () { + vm.activeSubAOLTerm = documentTemplateTypeLawTerm; + vm.documentTypeLawTerms = subareaTerms; + vm.addToDocumentTemplate(); + expect(vm.activeDocumentTypeLawTerm).not.toBe("null"); + }); + }); + + describe("Verification of removeFromDocumentTemplate function", function () { + it("It should not return document template type law terms while removing", function () { + vm.removeDTItem = false; + vm.removeFromDocumentTemplate(); + expect(vm.removeDTItem).not.toBe(true); + expect(vm.primaryMatterType).not.toBe(true); + }); + + it("It should return the document template type law terms while removing", function () { + vm.removeDTItem = true; + vm.removeFromDocumentTemplate(); + expect(vm.removeDTItem).toBe(false); + expect(vm.primaryMatterType).toBe(false); + }); + }); + + describe("Verification of onSelect function", function () { + + it("It should return the conflicted user", function () { + vm.onSelect(item, $model, $label, "conflictcheckuser", "on-blurr", event, item.name); + expect(vm.oSiteUsers).toBeDefined(); + expect(vm.selectedConflictCheckUser).toBe("MAQ User(MAQUser@LCADMS.onmicrosoft.com)"); + }); + + it("It should return the blocked user", function () { + vm.onSelect(item, $model, $label, "blockuser", "on-blurr", event, item.name); + expect(vm.oSiteUsers).toBeDefined(); + expect(vm.blockedUserName).toBe("MAQ User(MAQUser@LCADMS.onmicrosoft.com)"); + }); + + it("It should return the team member", function () { + vm.onSelect(item, $model, $label, "team", "on-blurr", event, item.name); + expect(vm.oSiteUsers).toBeDefined(); + expect(vm.typehead).toBe(false); + expect(vm.notificationPopUpBlock).toBe(false); + expect($label.assignedUser).toBe("MAQ User(MAQUser@LCADMS.onmicrosoft.com)"); + }); + + it("It should return the assigned user", function () { + vm.onSelect($item, $model, $label, "team", "on-blurr", event, item.name); + expect(vm.user).toBe("MAQ User"); + }); + }); + + describe("Verification of saveDocumentTemplates function", function () { + it("It should return the saved document Templates", function () { + vm.primaryMatterType = true; + vm.activeDocumentTypeLawTerm = documentTemplateTypeLawTerm; + vm.documentTypeLawTerms = subareaTerms; + vm.saveDocumentTemplates(); + expect(vm.selectedDocumentTypeLawTerms).toBe(vm.documentTypeLawTerms); + expect(vm.popupContainerBackground).toBe("hide"); + expect(vm.popupContainer).toBe("hide"); + }); + + it("It should not return saved document Templates and should prompt error popup", function () { + vm.primaryMatterType = false; + vm.saveDocumentTemplates(); + expect(vm.errorPopUp).toBe(true); + }); + }); + + describe("Verification of open1 function", function () { + it("It should open the date picker", function () { + vm.open1(); + expect(vm.opened).toBe(true); + }); + }); + + describe("Verification of conflictRadioChange function", function () { + it("It should enable the secureMatterRadioEnabled option", function () { + vm.conflictRadioChange(true); + expect(vm.secureMatterRadioEnabled).toBe(true); + expect(vm.secureMatterCheck).toBe(true); + }); + + it("It should disable the secureMatterRadioEnabled option", function () { + vm.conflictRadioChange(false); + expect(vm.secureMatterRadioEnabled).toBe(false); + }); + }); + + describe("Verification of addNewAssignPermissions function", function () { + it("It should return the data for assignPermissionTeams", function () { + vm.addNewAssignPermissions(); + expect(vm.assignPermissionTeams).not.toBeUndefined(); + }); + }); + + describe("Verification of removeAssignPermissionsRow function", function () { + it("It should return the remaining users", function () { + vm.assignPermissionTeams.length = Math.floor(Math.random() * 5) + 2; + var rows = vm.assignPermissionTeams.length; + vm.removeAssignPermissionsRow(0); + expect(rows).toBe(vm.assignPermissionTeams.length + 1); + }); + + it("It should not return any data", function () { + vm.assignPermissionTeams.length = 0; + vm.removeAssignPermissionsRow(0); + expect(vm.assignPermissionTeams.length).toBe(0); + }); + }); + + describe("Verification of createAndNotify function", function () { + it("It should display the Create and Notify button", function () { + vm.createAndNotify(true); + expect(vm.createButton).toBe("Create and Notify"); + }); + + it("It should display the Create button", function () { + vm.createAndNotify(false); + expect(vm.createButton).toBe("Create"); + }); + }); + + describe("Verification of CheckPopUp function", function () { + it("It should display the Check PopUp", function () { + vm.CheckPopUp(true); + expect(vm.errorPopUpBlock).toBe(false); + expect(vm.errorBorder).toBe(""); + }); + }); + + describe("Verification of closesuccessbanner function", function () { + it("It should close the successbanner", function () { + vm.closesuccessbanner(); + expect(vm.successMsg).toBe(""); + expect(vm.successBanner).toBe(false); + }); + }); + + describe('Verification of createMatterButton function', function () { + it('Successfully create matter button', function () { + vm.validateCurrentPage = function (id) { return true; }; + var validateCurrentPage = function (id) { return true; }; + vm.chkConfilctCheck = true; + vm.conflictDate = "8/1/2016"; + vm.createMatterButton(event); + expect(vm.sectionName).toBe("snConflictCheck"); + expect(vm.iCurrentPage).toBe(2); + }); + }); + + describe('Verification of navigateToSecondSection function', function () { + it('it should navigateToSecondSection', function () { + vm.iCurrentPage = 5; + vm.navigateToSecondSection("snOpenMatter"); + expect(vm.sectionName).toBe("snOpenMatter"); + expect(vm.iCurrentPage).toBe(1); + expect(localStorage.getItem('iLivePage')).toBe("1"); + expect(vm.prevButtonDisabled).toBe(true); + expect(vm.nextButtonDisabled).toBe(false); + }); + }); + + + //describe('Verification of NextClick function', function () { + // it('it should NextClick', function () { + // vm.iCurrentPage = 1; + // vm.NextClick(event) + // expect(vm.NextClick(event)).not.toThrow(Error); + // }); + // it('it should perform NextClick', function () { + // vm.iCurrentPage = 2; + // vm.NextClick(event) + // expect(vm.NextClick(event)).not.toThrow(Error); + // }); + //}); + + describe('Verification of PreviousClick function', function () { + it('it should PreviousClick', function () { + vm.iCurrentPage = 2; + vm.PreviousClick(event) + expect(vm.iCurrentPage).toBe(1); + expect(localStorage.getItem('iLivePage')).toBe("1"); + expect(vm.prevButtonDisabled).toBe(true); + expect(vm.nextButtonDisabled).toBe(false); + }); + //it('it should perform PreviousClick', function () { + // vm.iCurrentPage = 3; + // vm.PreviousClick(event) + // expect(vm.NextClick(event)).not.toThrow(Error); + //}); + }); + +}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterControllerservicecall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterControllerservicecall.spec.js new file mode 100644 index 00000000..9a96ae4e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/CreateMatterControllerservicecall.spec.js @@ -0,0 +1,83 @@ +/// JS2074, JS3058 +// Test suite +describe("CreateMatter Controller test suite", function () { + "use strict"; + + var mockapi = function (matterResource, callback) { + getData(matterResource, mockMatterResourceService); + }; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("matterResource", ["$resource", "auth", mockMatterResourceService]); + })); + + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $injector, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("createMatterController as vm", { $scope: $scope, $rootScope: rootScope, $state: $state, $stateParams: $stateParams, matterResource: mockMatterResourceService, api: mockapi }); + })); + + describe("Verification of Check valid matter function", function () { + it("Should return true for new matter", function () { + vm.matterName = oTestConfiguration.sValidMatterName; + vm.clientUrl = oTestConfiguration.sValidMatterClientURL; + vm.checkValidMatterName(); + expect(vm.checkValidMatterName).toBe(true); + }); + + it("It should return false for new matter", function () { + vm.matterName = oTestConfiguration.sInvalidMatterName; + vm.clientUrl = oTestConfiguration.sInvalidMatterURL; + vm.checkValidMatterName(); + expect(vm.checkValidMatterName).toBe(false); + }); + }); + + describe("Verification of selectMatterType function", function () { + it("Successfully get Practice Group, Area of law and SubArea of law", function () { + vm.selectMatterType(); + //expect(vm.selectedPracticeGroup).toBe(vm.pracitceGroupList[0]); + //expect(vm.areaOfLawTerms).toBe(vm.pracitceGroupList[0].areaTerms); + //expect(vm.subAreaOfLawTerms).toBe(vm.pracitceGroupList[0].areaTerms[0].subareaTerms); + //expect(vm.activeAOLTerm).toBe(vm.pracitceGroupList[0].areaTerms[0]); + //expect(vm.activeSubAOLTerm).toBe(vm.pracitceGroupList[0].areaTerms[0].subareaTerms[0]); + expect(vm.popupContainerBackground).toBe("Show"); + expect(vm.popupContainer).toBe("Show"); + }); + }); + + describe("Verification of getSelectedClientValue function", function () { + it("Successfully get data from matter configuration list", function () { + vm.getSelectedClientValue(oTestConfiguration.oClientObj); + expect(vm.secureMatterCheck).toBe(true); + expect(vm.includeCalendar).toBe(true); + expect(vm.includeEmail).toBe(true); + expect(vm.includeRssFeeds).toBe(true); + expect(vm.defaultConfilctCheck).toBe(true); + expect(vm.isMatterDescriptionMandatory).toBe(true); + expect(vm.includeTasks).toBe(true); + }); + }); + + ////describe("Verification of createMatterButton function", function () { + //// it("Successfully create matter button", function () { + //// vm.chkConfilctCheck = true; + //// vm.conflictDate = "8/1/2016"; + //// vm.createMatterButton(event); + //// expect(localStorage.getItem("IsRestrictedAccessSelected")).toBe("true"); + //// expect(localStorage.getItem("IsCalendarSelected")).toBe("true"); + //// expect(localStorage.getItem("IsRSSSelected")).toBe("true"); + //// expect(localStorage.getItem("IsEmailOptionSelected")).toBe("true"); + //// expect(localStorage.getItem("IsConflictCheck")).toBe("true"); + //// expect(localStorage.getItem("IsMatterDescriptionMandatory")).toBe("false"); + //// expect(localStorage.getItem("IsTaskSelected")).toBe("true"); + //// }); + ////}); +}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentController.spec.js new file mode 100644 index 00000000..7f98708a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentController.spec.js @@ -0,0 +1,128 @@ +/// JS2074, JS3058 +// Test suite +describe("documents Controller test suite", function () { + "use strict"; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("documentResource", ["$resource", "auth", mockDocumentResource]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("documentsController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, documentResource: mockDocumentResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q, $animate: $animate }); + })); + + describe("Verification of showdocdrop function", function () { + it("It should display document drop inner menu", function () { + vm.docdropinner = true; + vm.showdocdrop(event); + expect(vm.documentsdrop).toBe(true); + expect(vm.docdropinner).toBe(false); + }); + it("It should hide document drop inner menu", function () { + vm.docdropinner = false; + vm.showdocdrop(event); + expect(vm.documentsdrop).toBe(false); + expect(vm.docdropinner).toBe(true); + }); + }); + + describe("Verification of closealldrops function", function () { + it("It should close all dropdown menu", function () { + vm.closealldrops(); + expect(vm.documentsdrop).toBe(false); + expect(vm.docdropinner).toBe(true); + expect(vm.documentheader).toBe(true); + expect(vm.documentdateheader).toBe(true); + }); + }); + + describe("Verification of getTableHeight function", function () { + it("It should set dynamic height of the grid", function () { + vm.isOutlook = true; + var oTableHeight = vm.getTableHeight(); + expect(oTableHeight).toBeDefined(); + expect(oTableHeight).not.toBe(null); + }); + it("It should not set dynamic height of the grid", function () { + vm.isOutlook = false; + var oTableHeight = vm.getTableHeight(); + expect(oTableHeight).toBeDefined(); + expect(oTableHeight).not.toBe(null); + }); + }); + describe("Verification of isOutlookAsAttachment function", function () { + it("It should show outlook as an attachment", function () { + vm.isOutlookAsAttachment(true); + expect(vm.showAttachment).not.toBe(true); + expect(vm.showAttachment).toBeDefined(); + expect(vm.enableAttachment).toBe(false); + }); + }); + describe("Verification of closeNotification function", function () { + it("It should close all the notifications", function () { + vm.closeNotification(); + expect(vm.showPopUpHolder).toBe(false); + expect(vm.showSuccessAttachments).toBe(false); + }); + }); + + describe("Verification of search function", function () { + it("It should perform the text search in all documents", function () { + vm.selected = ""; + vm.search(); + expect(vm.pagenumber).toBe(1); + expect(vm.documentname).toBe("All Documents"); + expect(vm.documentid).toBe(1); + expect(vm.lazyloader).toBe(false); + expect(vm.responseNull).toBe(false); + expect(vm.divuigrid).toBe(false); + }); + }); + + describe("Verification of disabled function", function () { + it("It should set the status", function () { + var oDate = new Date(); + var bStatus = vm.disabled(oDate, "day"); + expect(bStatus).toBe(true); + }); + }); + + describe("Verification of showSortExp function", function () { + it("It should sort the data in ascending order", function () { + vm.sortexp = "test"; + vm.sortby = "asc"; + vm.showSortExp(); + expect(angular.element()).toBeDefined(); + }); + }); + + // Test suite to execute test cases. + describe("Verification of toggleCheckerAll function", function () { + // Test case to validate function. + it("It should check all the checkboxes inside grid", function () { + vm.gridOptions.data = obj; + vm.toggleCheckerAll(true); + expect(vm.gridOptions.data[0].checker).toBe(true); + expect(vm.documentsCheckedCount).toBe(oTestConfiguration.nDocumentCheckCount); + expect(vm.selectedRows).toBe(obj); + }); + it("It should uncheck all the checkboxes inside grid", function () { + vm.gridOptions.data = obj; + vm.toggleCheckerAll(false); + expect(vm.gridOptions.data[0].checker).toBe(false); + expect(vm.documentsCheckedCount).toBe(0); + expect(vm.selectedRows).not.toBe(null); + expect(vm.showErrorAttachmentInfo).toBe(false); + }); + }); +}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentControllerservicecall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentControllerservicecall.spec.js new file mode 100644 index 00000000..5ffda527 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentControllerservicecall.spec.js @@ -0,0 +1,156 @@ +// Test suite +describe('documents Controller service call test suite', function () { + + var documentapi = function (documentDashBoardResource) { + getData(documentDashBoardResource, mockDocumentResource); + }; + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("documentResource", ['$resource', 'auth', mockDocumentResource]); + })); + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("api", ['matterResource', 'documentResource', 'documentDashBoardResource', 'matterDashBoardResource', 'homeResource', documentapi]); + })); + + beforeEach(module('ui.router')); + beforeEach(module('ui.bootstrap')); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller('documentsController as vm', { $scope: $scope, $state: $state, $stateParams: $stateParams, documentResource: mockDocumentResource, api: documentapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q, $animate: $animate }); + })); + + describe('Verification of watchFunc function', function () { + it('It should get all grid data', function () { + $scope.gridApi = { infiniteScroll: { dataLoaded: function () { } } }; + // $scope.gridApi.infiniteScroll.dataLoaded(); + var promise = vm.watchFunc(); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + expect(vm.lazyloader).toBe(true); + }); + + }); + + describe('Verification of documentsearch function', function () { + it('It should search related document', function () { + var term = "FileName:Test*(* OR FileName:* OR dlcDocIdOWSText:* OR MCDocumentClientName:*)"; + var property = "FileName"; + vm.documentsearch(term, property, false); + expect(vm.divuigrid).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.lazyloader).toBe(true); + expect(vm.filternodata).toBe(false); + expect(vm.details.length).toBeGreaterThan(0); + expect(vm.details).not.toBe(null); + //vm.documentsearch(term, property, true); + + }); + + }); + + describe('Verification of FilterModifiedDate function', function () { + it('Data should be filtered based on modified date', function () { + vm.modstartdate = new Date("08/01/2016"); + vm.modenddate = new Date("08/10/2016"); + vm.FilterModifiedDate("Modified Date"); + expect(vm.moddatefilter).toBe(true); + }); + + }); + + describe('Verification of SetDocuments function', function () { + it('document name should be added in dropdown', function () { + $scope.gridApi = { infiniteScroll: { dataLoaded: function () { } } }; + vm.SetDocuments(1, "All Documents"); + expect(true).toBe(true); + expect(vm.divuigrid).toBe(true); + expect(vm.responseNull).toBe(false); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + }); + }); + + describe('Verification of GetDocuments function', function () { + it('document name should be added in dropdown', function () { + $scope.gridApi = { infiniteScroll: { dataLoaded: function () { } } }; + vm.GetDocuments(3); + expect(true).toBe(true); + expect(vm.divuigrid).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + }); + }); + + describe('Verification of PinMatter function', function () { + it('It should be added in pinned list', function () { + var pinObject = { + entity: oTestConfiguration.oDocumentObject + }; + vm.PinMatter(pinObject); + vm.documentid = 1; + vm.documentname = "All Documents"; + expect(vm.divuigrid).toBe(true); + expect(vm.responseNull).toBe(false); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + + }); + }); + + describe('Verification of UnpinDocument function', function () { + it('It should be removed from pinned list', function () { + var pinObject = { + entity: oTestConfiguration.oDocumentObject + }; + vm.UnpinDocument(pinObject); + vm.documentid = 1; + vm.documentname = "All Documents"; + expect(vm.divuigrid).toBe(true); + expect(vm.responseNull).toBe(false); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + + }); + }); + + describe('Verification of FilterByType function', function () { + it('document count should be greater than 0', function () { + vm.FilterByType(); + expect(vm.divuigrid).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + }); + }); + + describe('Verification of sortChangedDocument function', function () { + it('documents should be sort based on document name', function () { + $scope.gridApi = { infiniteScroll: { dataLoaded: function () { }, resetScroll: function () { } } }; + var sortColumns = [{ "field": "documentName", "name": "documentName", "sort": "asc" }]; + vm.gridOptions.columnDefs[1] = { "field": "documentName", "displayName": "Document", "width": "278", "enableHiding": false, "cellTemplate": "../app/document/DocumentTemplates/DocumentCellTemplate.html", "headerCellTemplate": "../app/document/DocumentTemplates/DocumentHeaderTemplate.html", "name": "documentName", "type": "string" }; + $scope.sortChangedDocument(null, sortColumns); + expect(vm.FileNameSort).toBe("desc"); + expect(vm.sortby).toBe("asc"); + expect(vm.sortexp).toBe("documentName"); + + }); + }); + + describe('Verification of typeheadselect function', function () { + it('selected document result should be displayed', function () { + $scope.gridApi = { infiniteScroll: { dataLoaded: function () { }, resetScroll: function () { } } }; + var selected = "All Attachments - image test.eml (280620050)"; + vm.typeheadselect(null, selected); + expect(selected).toContain(vm.gridOptions.data[0].documentName); + }); + }); + +}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardController.spec.js new file mode 100644 index 00000000..4d2ad7ec --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardController.spec.js @@ -0,0 +1,153 @@ +/// JS2074, JS3058 +// Test suite +describe("DocumentDashboard Controller test suite", function () { + "use strict"; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("documentDashBoardResource", ["$resource", "auth", mockDocumentDashBoardResource]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $injector, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("DocumentDashBoardController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, documentDashBoardResource: mockDocumentDashBoardResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location }); + })); + + //describe("Verification of closealldrops function", function () { + // it("It should close all dropdowns on click of page", function () { + // vm.x = 5; + // vm.y = 2; + // vm.sum(); + // expect(vm.z).toBe(7); + + // }); + //}); + + describe("Verification of closealldrops function", function () { + it("It should close all dropdowns on click of page", function () { + vm.closealldrops(event); + expect(vm.searchdrop).toBe(false); + expect(vm.downwarddrop).toBe(true); + expect(vm.upwarddrop).toBe(false); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.sortbydrop).toBe(false); + expect(vm.sortbydropvisible).toBe(false); + }); + }); + + describe("Verification of hideinnerdashboarddrop function", function () { + it("It should close and hide inner dropdowns of search box", function () { + vm.hideinnerdashboarddrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + }); + }); + + describe("Verification of toggleChecker function", function () { + it("It should enable toggle to check all documents", function () { + vm.documentsCheckedCount = 2; + vm.toggleChecker(true, obj); + expect(vm.documentsCheckedCount).toBe(3); + expect(vm.cartelements).toBeDefined(); + }); + it("It should disable toggle to check all documents", function () { + vm.documentsCheckedCount = 2; + vm.gridApi = {}; + vm.gridApi.grid = 1; + vm.gridApi = gridrows; + vm.toggleChecker(false, obj); + expect(vm.documentsCheckedCount).toBe(1); + }); + }); + + describe("Verification of removeAttachment function", function () { + it("It should add an elements to the cart", function () { + vm.cartelements = obj; + vm.documentsCheckedCount = 3; + vm.removeAttachment(obj[0]); + expect(vm.cartelements.length).toBe(1); + expect(vm.documentsCheckedCount).toBe(2); + }); + it("It should remove all the elements from the cart", function () { + vm.cartelements = {}; + vm.cartelements.length = 0; + vm.removeAttachment(obj[0]); + expect(vm.cartelements.length).toBe(0); + expect(vm.documentsCheckedCount).not.toBeLessThan(0); + }); + }); + + describe("Verification of toggleCheckerAll function", function () { + it("It should select all the document inside grid simultaneously", function () { + vm.documentGridOptions.data = obj; + vm.documentsCheckedCount = 3; + vm.toggleCheckerAll(true); + expect(vm.cartelements.length).toBeDefined(); + expect(vm.documentsCheckedCount).toBe(1); + }); + it("It should deselect the documents inside grid ", function () { + vm.documentGridOptions.data = obj; + vm.documentsCheckedCount = 3; + vm.toggleCheckerAll(false); + expect(vm.cartelements.length).toBe(0); + expect(vm.documentsCheckedCount).toBe(0); + }); + }); + + describe("Verification of showupward function", function () { + it("It should display upward dropdown box", function () { + vm.showupward(event); + expect(vm.searchdrop).toBe(true); + expect(vm.downwarddrop).toBe(false); + expect(vm.upwarddrop).toBe(true); + }); + }); + + describe("Verification of showdownward function", function () { + it("It should display downward dropdown box", function () { + vm.showdownward(event); + expect(vm.searchdrop).toBe(false); + expect(vm.upwarddrop).toBe(false); + expect(vm.downwarddrop).toBe(true); + }); + }); + + describe("Verification of showsortby function", function () { + it("It should show sortby dropdown box", function () { + vm.sortbydropvisible = false; + vm.showsortby(event); + expect(vm.sortbydrop).toBe(true); + expect(vm.sortbydropvisible).toBe(true); + }); + it("It should hide show sortby dropdown box", function () { + vm.sortbydropvisible = true; + vm.showsortby(event); + expect(vm.sortbydrop).toBe(false); + expect(vm.sortbydropvisible).toBe(false); + }); + }); + + describe("Verification of pagination function", function () { + it("It should disable pagination on the page", function () { + vm.totalrecords = 0; + vm.pagination(); + expect(vm.fromtopage).toBe("1 - 0"); + expect(vm.displaypagination).toBe(false); + }); + it("It should display pagination on the page", function () { + vm.totalrecords = 16; + vm.pagination(); + expect(vm.fromtopage).toBe("1 - 16"); + expect(vm.displaypagination).toBe(true); + }); + }); +}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardControllerServiceCall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardControllerServiceCall.spec.js new file mode 100644 index 00000000..19a79fa9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/DocumentDashboardControllerServiceCall.spec.js @@ -0,0 +1,179 @@ + +/// JS2074,JS3058,JS2085,JS3056,JS3116,JS3054,JS2064,JS2043,JS2073,JS2038 +// Test suite + +describe('DocumentDashboard Controller service call test suite', function () { + var mockDocumentapi = function (documentDashBoardResource) { + getData(documentDashBoardResource, mockDocumentDashBoardResource); + }; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("documentDashBoardResource", ["$resource", "auth", mockDocumentDashBoardResource]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockDocumentapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $injector, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("DocumentDashBoardController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, documentDashBoardResource: mockDocumentDashBoardResource, api: mockDocumentapi, $rootScope: rootScope, $http: $http, $location: $location }); + })); + + describe("Verification of getDocumentCounts function", function () { + it("Documents count should be greater than or equal to 0", function () { + vm.getDocumentCounts(); + expect(vm.allDocumentCount).not.toBeLessThan(0); + expect(vm.myDocumentCount).not.toBeLessThan(0); + expect(vm.pinDocumentCount).not.toBeLessThan(0); + expect(vm.totalrecords).not.toBeLessThan(0); + }); + }); + + describe("Verification of getPinnedDocuments function", function () { + it("It should return the all pinned documents", function () { + vm.getPinnedDocuments(); + expect(vm.documentGridOptions.data).not.toBe(null); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(1); + expect(vm.totalrecords).toBe(0); + expect(vm.lazyloaderdashboard).toBe(true); + expect(vm.divuigrid).toBe(true); + }); + }); + + describe("Verification of getMyDocuments function", function () { + it("It should return the My documents", function () { + vm.getMyDocuments(); + expect(vm.lazyloaderdashboard).toBe(false); + expect(vm.displaypagination).toBe(false); + expect(vm.divuigrid).toBe(false); + expect(vm.nodata).toBe(false); + }); + }); + + describe("Verification of getDocuments function", function () { + it("It should get the Documents", function () { + vm.getDocuments(); + expect(vm.lazyloaderdashboard).toBe(true); + expect(vm.displaypagination).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.pinDocumentCount).toBeGreaterThan(0); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(1); + expect(vm.totalrecords).toBe(0); + expect(vm.pinDocumentCount).toBeGreaterThan(0); + expect(vm.nodata).toBe(false); + + }); + }); + + describe("Verification of showclientdrop function", function () { + it("It should show clientdrop", function () { + vm.clientdropvisible = false; + vm.clients = undefined; + vm.showclientdrop(event); + expect(vm.clients).toBeDefined(); + expect(vm.clientdrop).toBe(true); + expect(vm.clientdropvisible).toBe(true); + expect(vm.lazyloaderdocumentclient).toBe(true); + + }); + + it("It should not show clientdrop", function () { + vm.clientdropvisible = true; + vm.showclientdrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.lazyloaderdocumentclient).toBe(true); + + }); + }); + + + describe("Verification of FilterByType function", function () { + it("It should show FilterByType", function () { + vm.FilterByType(); + expect(vm.totalrecords).toBeGreaterThan(0); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(0); + expect(vm.lazyloader).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe("Verification of sortyby function", function () { + it("It should show sortyby", function () { + var sortexp = "AlphabeticalUp"; + vm.sortyby(sortexp, "Searchkeyword"); + expect(vm.totalrecords).toBeGreaterThan(0); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(0); + expect(vm.lazyloader).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe("Verification of next function", function () { + it("It should show next", function () { + vm.last = 5; + vm.totalrecords = 30; + vm.next(); + expect(vm.first).toBeGreaterThan(0); + expect(vm.last).toBeGreaterThan(0); + expect(vm.total).toBeGreaterThan(0); + expect(vm.pagenumber).toBeGreaterThan(0); + expect(vm.fromtopage).toBe(vm.first + " - " + vm.totalrecords); + expect(vm.lazyloader).toBe(true); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(0); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe("Verification of prev function", function () { + it("It should show prev", function () { + vm.last = 50; + vm.first = 50; + vm.prev(); + expect(vm.first).toBeGreaterThan(0); + expect(vm.last).toBeGreaterThan(0); + expect(vm.pagenumber).toBe(0); + expect(vm.documentGridOptions.data.length).toBeGreaterThan(0); + expect(vm.fromtopage).toBe(vm.first + " - " + vm.last); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + //// describe('Verification of downloadEmailAsAttachment function', function () { + //// it('It should download email with attachment', function () { + //// vm.cartelements = [{ documentClientUrl: "https://lcadms.sharepoint.com/sites/skype", selected: true, documentName: "Skype Litigation.txt", documentUrl: "https://lcadms.sharepoint.com/sites/skype/9694be04f87b22e8d238d69df9e29ff2/Skype Litigation.txt" }]; + //// vm.downloadEmailAsAttachment(true); + //// }); + //// }); + + describe('Verification of pinorunpin function', function () { + it('It should be added in pinned list and removed from pinned list', function () { + var iCount = vm.pinDocumentCount; + event.currentTarget.src = "../images/pin-666.png"; + vm.pinorunpin(event, oTestConfiguration.oDocumentObject); + iCount = iCount + 1; + expect(iCount).toBe(vm.pinDocumentCount); + event.currentTarget.src = "../images/unpin-666.png"; + iCount = iCount - 1; + vm.documentGridOptions.data = []; + vm.documentGridOptions.data[0] = oTestConfiguration.oDocumentObject; + vm.pinorunpin(event, oTestConfiguration.oDocumentObject); + expect(iCount).toBe(vm.pinDocumentCount); + }); + }); +}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeController.spec.js new file mode 100644 index 00000000..ea509835 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeController.spec.js @@ -0,0 +1,25 @@ +//Test suite +describe('Home Controller test suite', function () { + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("homeResource", ['$resource', 'auth', mockhomeResource]); + })); + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("api", ['matterResource', 'documentResource', 'documentDashBoardResource', 'matterDashBoardResource', 'homeResource', mockapi]); + })); + + beforeEach(module('ui.router')); + beforeEach(module('ui.bootstrap')); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + dm = $controller('homeController as dm', { $scope: $scope, $state: $state, $stateParams: $stateParams, homeResource: mockhomeResource, api: mockapi, $rootScope: rootScope, $location: $location, adalAuthenticationService: adalService }); + })); + + +}); + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeControllerservicecall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeControllerservicecall.spec.js new file mode 100644 index 00000000..8e05c185 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/HomeControllerservicecall.spec.js @@ -0,0 +1,54 @@ +//Test suite +describe('Home Controller service call test suite', function () { + + var mockapi = function (homeResource) { + getData(homeResource, mockHomeResource); + + }; + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("homeResource", ['$resource', 'auth', mockHomeResource]); + })); + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("api", ['matterResource', 'documentResource', 'documentDashBoardResource', 'matterDashBoardResource', 'homeResource', mockapi]); + })); + + beforeEach(module('ui.router')); + beforeEach(module('ui.bootstrap')); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller('homeController as vm', { $scope: $scope, $state: $state, $stateParams: $stateParams, homeResource: mockHomeResource, api: mockapi, $rootScope: rootScope, $location: $location, adalAuthenticationService: adalService }); + })); + + describe('Verification of getUserProfilePicture function', function () { + it('It should get User ProfilePicture', function () { + vm.getUserProfilePicture(); + expect(vm.smallPictureUrl).toBe("https://lcadms-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/maquser_lcadms_onmicrosoft_com_SThumb.jpg"); + expect(vm.largePictureUrl).toBe("https://lcadms-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/maquser_lcadms_onmicrosoft_com_MThumb.jpg"); + + }); + }); + + describe('Verification of help function', function () { + it('It should set help', function () { + vm.help(); + expect(vm.helpData.length).toBeGreaterThan(0); + expect(vm.helpData).toBeDefined(); + + }); + }); + + + describe('Verification of signOut function', function () { + it('It should signOut', function () { + vm.signOut(); + expect(vm.status).toBe(true); + }); + }); +}); + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterController.spec.js new file mode 100644 index 00000000..ed07759e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterController.spec.js @@ -0,0 +1,151 @@ +/// JS2074, JS3058 +// Test suite +describe("Matters Controller test suite", function () { + "use strict"; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("matterResource", ["$resource", "auth", mockMatterResource]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("mattersController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, matterResource: mockMatterResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q, $animate: $animate }); + })); + + + describe("Verification of closeNotificationDialog function", function () { + it("It should close the notification dialog box", function () { + vm.closeNotificationDialog(); + expect(vm.IsDupliacteDocument).toBe(false); + expect(vm.IsNonIdenticalContent).toBe(false); + expect(vm.showLoading).toBe(false); + }); + }); + + describe("Verification of attachmentTokenCallbackEmailClient function", function () { + it("It should attach the token along with EmailClient-Need to call createMailPopup", function () { + var asyncResult = { status: "succeeded", value: "testtoken" }; + vm.createMailPopup = function () { return 1; }; + vm.attachmentTokenCallbackEmailClient(asyncResult, obj); + expect(vm.attachmentToken).toBe("testtoken"); + expect(vm.mailUpLoadSuccess).toBe(false); + expect(vm.mailUploadedFolder).toBe(null); + expect(vm.loadingAttachments).toBe(false); + expect(vm.mailUploadedFile).toBe(null); + }); + }); + + describe("Verification of getIconSource function", function () { + it("It should return the source of icon", function () { + var source = vm.getIconSource("sourceicon"); + expect(source).toBe(oTestConfiguration.sSourceIconURL); + }); + }); + + describe("Verification of closealldrops function", function () { + it("It should close all the dropdowns", function () { + vm.closealldrops(); + expect(vm.mattersdrop).toBe(false); + expect(vm.mattersdropinner).toBe(true); + expect(vm.matterheader).toBe(true); + expect(vm.matterdateheader).toBe(true); + }); + }); + + describe("Verification of checkEmptyorWhitespace function", function () { + it("It should check empty or whitespace in the input", function () { + var data = vm.checkEmptyorWhitespace("test"); + expect(data).toBe("test"); + }); + }); + + describe("Verification of hideBreadCrumb function", function () { + it("It should hide the bread crumb", function () { + vm.hideBreadCrumb(); + expect(rootScope.breadcrumb).toBe(true); + expect(rootScope.foldercontent).toBe(false); + }); + }); + + describe("Verification of disabled function", function () { + it("It should set the status based on current date.", function () { + var oDate = new Date(); + var status = vm.disabled(oDate, "day"); + expect(status).toBe(true); + }); + }); + + describe("Verification of showSortExp function", function () { + it("It should sort the elements in ascending order", function () { + vm.sortexp = "test"; + vm.sortby = "asc"; + $scope.$apply = function () { }; + vm.showSortExp(); + expect(angular.element()).toBeDefined(); + }); + }); + + describe("Verification of showmatterdrop function", function () { + it("It should show matter dropdown if matter is pinned", function () { + vm.mattersdropinner = true; + vm.showmatterdrop(event); + expect(vm.mattersdrop).toBe(true); + expect(vm.mattersdropinner).toBe(false); + }); + + it("It should hide matter dropdown if matter is not pinned", function () { + vm.mattersdropinner = false; + vm.showmatterdrop(event); + expect(vm.mattersdrop).toBe(false); + expect(vm.mattersdropinner).toBe(true); + }); + }); + + describe("Verification of overwriteConfiguration function", function () { + it("It should return overwrite configuration for the file", function () { + var bAppendEnabled = vm.overwriteConfiguration(oTestConfiguration.sOverwriteConfigFileName); + expect(bAppendEnabled).toBe(true); + }); + }); + + describe("Verification of contentCheckNotification function", function () { + it("It should set upload file configurations to perform content check", function () { + var file = { contentCheck: "", saveLatestVersion: "", cancel: "", append: true }; + vm.contentCheckNotification(file, true); + expect(file.contentCheck).toBe("contentCheck"); + expect(file.saveLatestVersion).toBe("False"); + expect(file.cancel).toBe("False"); + expect(file.append).toBe(false); + }); + }); + + describe("Verification of abortContentCheck function", function () { + it("It should set upload file configuration to abort content check", function () { + vm.file = {}; + vm.file.value = "This"; + vm.abortContentCheck(vm.file, false); + expect(vm.file.contentCheck).toBe(null); + expect(vm.file.saveLatestVersion).toBe("True"); + expect(vm.file.value).toBe("This
Content check has been aborted.
"); + expect(vm.file.cancel).toBe("True"); + }); + }); + + describe("Verification of closeSuccessBanner function", function () { + it("It should close the success banner", function () { + vm.closeSuccessBanner(); + expect(vm.oUploadGlobal.successBanner).toBe(false); + }); + }); +}); + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterControllerservicecall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterControllerservicecall.spec.js new file mode 100644 index 00000000..eff8fbb5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterControllerservicecall.spec.js @@ -0,0 +1,231 @@ +//Test suite +describe('MattersController Controller test suite', function () { + + var mockapi = function (matterResource) { + getData(matterResource, mockMatterResource); + + }; + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("matterResource", ['$resource', 'auth', mockMatterResource]); + })); + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("api", ['matterResource', 'documentResource', 'documentDashBoardResource', 'matterDashBoardResource', 'homeResource', mockapi]); + })); + + beforeEach(module('ui.router')); + beforeEach(module('ui.bootstrap')); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller('mattersController as vm', { $scope: $scope, $state: $state, $stateParams: $stateParams, matterResource: mockMatterResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q, $animate: $animate }); + })); + + //describe('Verification of SetMatters function', function () { + // it('matter name should be added in dropdown', function () { + // vm.SetMatters(1, "All Matters"); + // expect(vm.divuigrid).toBe(false); + // expect(vm.responseNull).toBe(false); + // expect(vm.nodata).toBe(false); + // expect(vm.gridOptions.data.length).toBeGreaterThan(0); + // expect(vm.gridOptions.data).not.toBe(null); + // }); + //}); + + //describe('Verification of GetMatters function', function () { + // it('matter name should be added in dropdown', function () { + // vm.GetMatters(3); + // expect(vm.divuigrid).toBe(true); + // expect(vm.nodata).toBe(false); + // expect(vm.gridOptions.data.length).toBeGreaterThan(0); + // expect(vm.gridOptions.data).not.toBe(null); + // }); + //}); + + //describe('Verification of mattersearch function', function () { + // it('It should search related matter', function () { + // var term = "MCMatterName:Test*(MCMatterName:* OR MCMatterID:* OR MCClientName:*)"; + // var property = "MCMatterName"; + // vm.mattersearch(term, property, false); + // expect(vm.divuigrid).toBe(true); + // expect(vm.nodata).toBe(false); + // expect(vm.lazyloader).toBe(true); + // expect(vm.filternodata).toBe(false); + // expect(vm.details.length).toBeGreaterThan(0); + // expect(vm.details).not.toBe(null); + + // }); + + //}); + + //describe('Verification of FilterModifiedDate function', function () { + // it('Data should be filtered based on modified date', function () { + // vm.modstartdate = new Date("08/01/2016"); + // vm.modenddate = new Date("08/10/2016"); + // vm.FilterModifiedDate("Modified Date"); + // expect(vm.moddatefilter).toBe(true); + // }); + + //}); + + describe('Verification of PinMatter function', function () { + it('It should be added in pinned list', function () { + var currentRowData = { + entity: oTestConfiguration.oMatterObject + }; + vm.PinMatter(currentRowData); + expect(vm.divuigrid).toBe(false); + expect(vm.responseNull).toBe(false); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).not.toBeLessThan(0); + expect(vm.gridOptions.data).not.toBe(null); + + }); + }); + + describe('Verification of UnpinMatter function', function () { + it('It should be removed from pinned list', function () { + var pinObject = { + entity: oTestConfiguration.oMatterObject + }; + vm.UnpinMatter(pinObject);; + expect(vm.divuigrid).toBe(false); + expect(vm.responseNull).toBe(false); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).not.toBeLessThan(0); + expect(vm.gridOptions.data).not.toBe(null); + + }); + }); + + describe('Verification of sortChanged function', function () { + it('documents should be sort based on matter name', function () { + var sortColumns = [{ "field": "matterName", "name": "matterName", "sort": "asc" }]; + vm.gridOptions.columnDefs[0] = { "field": "matterName", "displayName": "Matter", "enableHiding": false, "width": "275", "cellTemplate": "../app/matter/MatterTemplates/MatterCellTemplate.html", "headerCellTemplate": "../app/matter/MatterTemplates/MatterHeaderTemplate.html", "name": "matterName", "type": "string" }; + $scope.sortChanged(null, sortColumns); + expect(vm.MatterNameSort).toBe("desc"); + expect(vm.sortby).toBe("asc"); + expect(vm.sortexp).toBe("matterName"); + }); + }); + + + describe('Verification of typeheadselect function', function () { + it('selected document result should be displayed', function () { + var selected = "Default Matter (11111)"; + vm.typeheadselect(null, selected); + expect(selected).toContain(vm.gridOptions.data[0].matterName); + }); + }); + + + describe('Verification of watchFunc function', function () { + it('It should watchFunc', function () { + vm.responseNull = false; + vm.watchFunc(); + expect(vm.lazyloader).toBe(true); + expect(vm.pagenumber).toBeGreaterThan(0); + expect(vm.lazyloader).toBe(true); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + }); + }); + + describe('Verification of getFolderHierarchy function', function () { + it('It should show getFolderHierarchy', function () { + vm.getFolderHierarchy("Default Matter", "https://lcadms.sharepoint.com/sites/subsiteclient", "6cbca4ab447c87302d3a1f0e3c32985a"); + expect(vm.oUploadGlobal.bAllowContentCheck).toBe(true); + expect(vm.foldersList.length).toBeGreaterThan(0); + expect(vm.showSelectedFolderTree).not.toBe(null); + expect(vm.lazyloader).toBe(true); + }); + }); + + describe('Verification of search function', function () { + it('It should search related matter', function () { + vm.selected = "Test Matter"; + vm.search(); + expect(vm.divuigrid).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.gridOptions.data).not.toBe(null); + }); + }); + + describe('Verification of FilterByType function', function () { + it('It should show FilterByType', function () { + vm.FilterByType(); + expect(vm.gridOptions.data.length).toBeGreaterThan(0); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + }); + }); + + describe('Verification of Openuploadmodal function', function () { + it('It should show Openuploadmodal', function () { + vm.Openuploadmodal("Default Matter", "https://lcadms.sharepoint.com/sites/subsiteclient", "6cbca4ab447c87302d3a1f0e3c32985a"); + expect(vm.oUploadGlobal.successBanner).toBe(false); + expect(vm.isLoadingFromDesktopStarted).toBe(false); + }); + }); + + describe('Verification of localOverWriteDocument function', function () { + it('It should show localOverWriteDocument', function () { + vm.ducplicateSourceFile = { + pop: function () + { return true; }, + filter: function () { + return true; + } + } + vm.oUploadGlobal = { + "arrFiles": { + pop: function () + { return obj; } + } + }; + vm.ducplicateSourceFile.length = 1; + var duplicateFile = { "cancel": null, "fileType": "remotefile" }; + vm.localOverWriteDocument(duplicateFile, "ignore"); + expect(vm.files).toBeDefined(); + }); + + it('It should show localOverWriteDocument', function () { + vm.ducplicateSourceFile = { + pop: function () + { return true; }, + filter: function () { + return true; + } + } + + var duplicateFile = { "cancel": null, "fileType": "" }; + vm.localOverWriteDocument(duplicateFile, "overwrite"); + expect(vm.ducplicateSourceFile).toBe(true); + }); + + }); + + + describe('Verification of showSelectedFolderTree function', function () { + it('It should show showSelectedFolderTree', function () { + var folder = { + "parentURL": "https://lcadms.sharepoint.com/sites/subsiteclient", + "active": true, + "children": { "child": { "active": true } } + }; + vm.showSelectedFolderTree(folder); + expect(vm.showSelectedFolderTree).not.toThrow(Error); + }); + }); + + describe('Verification of getContentCheckConfigurations function', function () { + it('It should show getContentCheckConfigurations', function () { + + vm.getContentCheckConfigurations("https://lcadms.sharepoint.com/sites/subsiteclient"); + expect(vm.oUploadGlobal.bAllowContentCheck).toBe(true); + }); + }); +}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardController.spec.js new file mode 100644 index 00000000..c9cfca73 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardController.spec.js @@ -0,0 +1,183 @@ +/// JS2074, JS3058 +// Test suite +describe("MatterDashBoard Controller test suite", function () { + "use strict"; + + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("matterDashBoardResource", ["$resource", "auth", mockMatterDashBoardResource]); + })); + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("MatterDashBoardController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, matterDashBoardResource: mockMatterDashBoardResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q }); + })); + + describe("Verification of closealldrops function", function () { + it("It should close all dropdowns on click of the page", function () { + vm.closealldrops(); + expect(vm.searchdrop).toBe(false); + expect(vm.downwarddrop).toBe(true); + expect(vm.upwarddrop).toBe(false); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + expect(vm.sortbydrop).toBe(false); + expect(vm.sortbydropvisible).toBe(false); + }); + }); + + describe("Verification of hideinnerdrop function", function () { + it("It should hide all inner dropdownns", function () { + vm.hideinnerdrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + }); + }); + + describe("Verification of filterSearchOK function", function () { + it("It should return selected client", function () { + vm.selectedClients = ""; + vm.clients = clientobj; + vm.filterSearchOK("client"); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.selectedClientsForCancel).toBe(oTestConfiguration.sSelectedClient); + expect(vm.selectedClients).toBe(oTestConfiguration.sSelectedClient); + }); + + it("It should return selected practice group", function () { + vm.selectedPGs = ""; + vm.practiceGroups = practicegroup; + vm.filterSearchOK("pg"); + expect(vm.pgdropvisible).toBe(false); + expect(vm.pgdrop).toBe(false); + expect(vm.selectedPGsForCancel).toBe(oTestConfiguration.sSelectedPracticeGroup); + expect(vm.selectedPGs).toBe(oTestConfiguration.sSelectedPracticeGroup); + + }); + it("It should return selected AOL", function () { + vm.selectedAOLs = ""; + vm.aolTerms = practicegroup; + vm.filterSearchOK("aol"); + expect(vm.aoldropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.selectedAOLsForCancel).toBe(oTestConfiguration.sSelectedAreaOfLaw); + expect(vm.selectedAOLs).toBe(oTestConfiguration.sSelectedAreaOfLaw); + }); + }); + + describe("Verification of filterSearchCancel function", function () { + it("It should trigger when the user clicks on 'Cancel' button in the filter panel", function () { + vm.filterSearchCancel("client"); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + }); + + }); + + describe("Verification of showupward function", function () { + it("It should show upward dropdown box", function () { + vm.showupward(event); + expect(vm.searchdrop).toBe(true); + expect(vm.downwarddrop).toBe(false); + expect(vm.upwarddrop).toBe(true); + }); + }); + + describe("Verification of showdownward function", function () { + it("It should show downward dropdown box", function () { + vm.showdownward(event); + expect(vm.searchdrop).toBe(false); + expect(vm.upwarddrop).toBe(false); + expect(vm.downwarddrop).toBe(true); + }); + }); + + describe("Verification of showsortby function", function () { + it("It should show sortby box", function () { + vm.sortbydropvisible = false; + vm.showsortby(event); + expect(vm.sortbydrop).toBe(true); + expect(vm.sortbydropvisible).toBe(true); + }); + it("It should hide sortby box", function () { + vm.sortbydropvisible = true; + vm.showsortby(event); + expect(vm.sortbydrop).toBe(false); + expect(vm.sortbydropvisible).toBe(false); + }); + }); + + describe("Verification of pagination function", function () { + it("It should disable pagination on the page", function () { + vm.totalrecords = 0; + vm.pagination(); + expect(vm.fromtopage).toBe("1 - 0"); + expect(vm.displaypagination).toBe(false); + }); + it("It should enable pagination on the page", function () { + vm.totalrecords = 16; + vm.pagination(); + expect(vm.fromtopage).toBe("1 - 16"); + expect(vm.displaypagination).toBe(true); + + }); + }); + + describe("Verification of overwriteConfiguration function", function () { + it("It should return overwrite configuration for the file", function () { + var bAppendEnabled = vm.overwriteConfiguration("TestEmail.msg"); + expect(bAppendEnabled).toBe(true); + }); + }); + + describe("Verification of contentCheckNotification function", function () { + it("It should set upload file configurations to perform content check", function () { + vm.file = {}; + vm.contentCheckNotification(vm.file, true); + expect(vm.file.contentCheck).toBe("contentCheck"); + expect(vm.file.saveLatestVersion).toBe("False"); + expect(vm.file.cancel).toBe("False"); + }); + }); + + describe("Verification of abortContentCheck function", function () { + it("It should set upload file configuration to abort content check", function () { + vm.file = {}; + vm.file.value = "This"; + vm.abortContentCheck(vm.file, false); + expect(vm.file.contentCheck).toBe(null); + expect(vm.file.saveLatestVersion).toBe("True"); + expect(vm.file.value).toBe("This
Content check has been aborted.
"); + expect(vm.file.cancel).toBe("True"); + }); + }); + + describe("Verification of closeSuccessBanner function", function () { + it("It should close success banner", function () { + vm.closeSuccessBanner(); + expect(vm.oUploadGlobal.successBanner).toBe(false); + }); + }); +}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardControllerservicecall.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardControllerservicecall.spec.js new file mode 100644 index 00000000..dd40e668 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/MatterDashboardControllerservicecall.spec.js @@ -0,0 +1,352 @@ +//Test suite +describe('MatterDashBoard Controller test suite', function () { + + var mockapi = function (matterDashBoardResource) { + getData(matterDashBoardResource, mockMatterDashBoardResource); + }; + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("matterDashBoardResource", ['$resource', 'auth', mockMatterDashBoardResource]); + })); + + beforeEach(module('matterMain')); + beforeEach(module('matterMain', function ($provide) { + $provide.factory("api", ['matterResource', 'documentResource', 'documentDashBoardResource', 'matterDashBoardResource', 'homeResource', mockapi]); + })); + + beforeEach(module('ui.router')); + beforeEach(module('ui.bootstrap')); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller('MatterDashBoardController as vm', { $scope: $scope, $state: $state, $stateParams: $stateParams, matterDashBoardResource: mockMatterDashBoardResource, api: mockapi, $rootScope: rootScope, $http: $http, $location: $location, $q: $q }); + })); + + + describe('Verification of getMatterCounts function', function () { + it('It should show MatterCounts', function () { + vm.getMatterCounts(); + expect(vm.allMatterCount).toBeGreaterThan(0); + expect(vm.myMatterCount).toBeGreaterThan(0); + expect(vm.pinMatterCount).toBeGreaterThan(0); + expect(vm.totalrecords).toBeGreaterThan(0); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe('Verification of getMatterPinned function', function () { + it('It should get MatterPinned', function () { + vm.getMatterPinned(); + expect(vm.pinnedResponse).not.toBe(null); + expect(vm.Pinnedobj.length).toBeDefined(); + expect(vm.matterGridOptions.data).toBeDefined(); + expect(vm.pinMatterCount).toBeDefined(); + expect(vm.totalrecords).toBeDefined(); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + expect(vm.displaypagination).toBe(true); + }); + + }); + + //describe('Verification of searchMatters function', function () { + // it('It should get searchMatters', function () { + // vm.searchMatters("test"); + // expect(vm.pagenumber).toBe(1); + + // }); + + //}); + + + describe('Verification of myMatters function', function () { + it('It should get myMatters', function () { + vm.searchText = "test"; + vm.myMatterCount = 5; + vm.myMatters(); + expect(vm.matterGridOptions.data.length).toBeGreaterThan(0); + expect(vm.totalrecords).toBeGreaterThan(1); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + + }); + + }); + + + describe('Verification of showClientDrop function', function () { + it('It should show clientdrop', function () { + vm.clientdropvisible = false; + vm.clients = undefined; + vm.showClientDrop(event); + expect(vm.clients).toBeDefined(); + expect(vm.clientdrop).toBe(true); + expect(vm.clientdropvisible).toBe(true); + expect(vm.lazyloaderclient).toBe(true); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + + }); + + it('It should not show clientdrop', function () { + vm.clientdropvisible = true; + vm.showClientDrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.lazyloaderclient).toBe(true); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + + }); + }); + + + + describe('Verification of myMatters function', function () { + it('It should get myMatters', function () { + vm.searchText = "test"; + vm.myMatterCount = 5; + vm.myMatters(); + expect(vm.matterGridOptions.data.length).toBeGreaterThan(0); + expect(vm.totalrecords).toBeGreaterThan(1); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + + }); + + }); + + + describe('Verification of FilterByType function', function () { + it('It should show FilterByType', function () { + vm.FilterByType(); + expect(vm.totalrecords).toBeGreaterThan(0); + expect(vm.matterGridOptions.data.length).toBeGreaterThan(0); + expect(vm.lazyloader).toBe(true); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe('Verification of sortyby function', function () { + it('It should show sortyby', function () { + var sortexp = "AlphabeticalUp"; + vm.sortyby(sortexp, "Searchkeyword"); + expect(vm.nodata).toBe(true); + expect(vm.divuigrid).toBe(false); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe('Verification of next function', function () { + it('It should show next', function () { + vm.last = 5; + vm.totalrecords = 30; + + vm.next(); + expect(vm.first).toBeGreaterThan(0); + expect(vm.last).toBeGreaterThan(0); + expect(vm.total).toBeGreaterThan(0); + expect(vm.pagenumber).toBeGreaterThan(0); + expect(vm.fromtopage).toBe(vm.first + " - " + vm.totalrecords); + expect(vm.displaypagination).toBe(true); + expect(vm.matterGridOptions.data.length).toBeGreaterThan(0); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + describe('Verification of prev function', function () { + it('It should show prev', function () { + vm.last = 50; + vm.first = 50; + vm.prev(); + expect(vm.first).toBeGreaterThan(0); + expect(vm.last).toBeGreaterThan(0); + expect(vm.pagenumber).toBe(0); + expect(vm.matterGridOptions.data.length).toBeGreaterThan(0); + expect(vm.fromtopage).toBe(vm.first + " - " + vm.last); + expect(vm.nodata).toBe(false); + expect(vm.divuigrid).toBe(true); + expect(vm.lazyloaderdashboard).toBe(true); + }); + }); + + + describe('verification of showPracticegroupDrop function', function () { + it('It should show PracticegroupDrop', function () { + vm.pgdropvisible = false; + vm.practiceGroups = undefined; + vm.aolTerms = undefined; + + vm.showPracticegroupDrop(event); + expect(vm.lazyloaderpg).toBe(true); + expect(vm.pgdrop).toBe(true); + expect(vm.pgdropvisible).toBe(true); + + }); + + it('It should not show PracticegroupDrop', function () { + vm.pgdropvisible = false; + vm.practiceGroups = "data"; + vm.aolTerms = "test"; + + vm.showPracticegroupDrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.pgdrop).toBe(true); + expect(vm.pgdropvisible).toBe(true); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + + }); + + it('It should not showPracticegroupDrop', function () { + vm.clientdropvisible = true; + vm.showClientDrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.lazyloaderpg).toBe(true); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + + }); + + }); + + + describe('Verification of getFolderHierarchy function', function () { + it('It should show getFolderHierarchy', function () { + + vm.getFolderHierarchy("Default Matter", "https://lcadms.sharepoint.com/sites/subsiteclient", "6cbca4ab447c87302d3a1f0e3c32985a"); + expect(vm.oUploadGlobal.bAllowContentCheck).toBe(true); + expect(vm.foldersList.length).toBeGreaterThan(0); + expect(vm.showSelectedFolderTree).not.toBe(null); + expect(vm.lazyloader).toBe(true); + }); + }); + + describe('Verification of Openuploadmodal function', function () { + it('It should show Openuploadmodal', function () { + + vm.Openuploadmodal("Default Matter", "https://lcadms.sharepoint.com/sites/subsiteclient", "6cbca4ab447c87302d3a1f0e3c32985a"); + expect(vm.oUploadGlobal.successBanner).toBe(false); + expect(vm.isLoadingFromDesktopStarted).toBe(false); + }); + }); + + describe('Verification of showclients function', function () { + it('It should show showclients', function () { + vm.client = undefined; + vm.showclients(event); + expect(vm.clients).toBeDefined(); + expect(vm.clientdrop).toBe(true); + expect(vm.clientdropvisible).toBe(true); + }); + }); + + describe('Verification of getContentCheckConfigurations function', function () { + it('It should show getContentCheckConfigurations', function () { + + vm.getContentCheckConfigurations("https://lcadms.sharepoint.com/sites/subsiteclient"); + expect(vm.oUploadGlobal.bAllowContentCheck).toBe(true); + }); + }); + + describe('Verification of showSelectedFolderTree function', function () { + it('It should show showSelectedFolderTree', function () { + var folder = { + "parentURL": "https://lcadms.sharepoint.com/sites/subsiteclient", + "active": true, + "children": { "active": true } + }; + vm.showSelectedFolderTree(folder); + expect(vm.showSelectedFolderTree).not.toThrow(Error); + }); + }); + + describe('Verification of localOverWriteDocument function', function () { + it('It should show localOverWriteDocument', function () { + vm.ducplicateSourceFile = { + pop: function () + { return true; } + } + vm.oUploadGlobal = { + "arrFiles": { + pop: function () + { return obj; } + } + }; + vm.ducplicateSourceFile.length = 1; + var duplicateFile = { "cancel": null }; + vm.localOverWriteDocument(duplicateFile, "ignore"); + expect(vm.files).toBeDefined(); + }); + }); + + describe('Verification of search function', function () { + it('It should show search', function () { + vm.search("Test"); + expect(vm.Pinnedobj).toBeDefined(); + expect(vm.pinMatterCount).toBeGreaterThan(0); + expect(vm.matterGridOptions.data).toBeDefined(); + expect(vm.totalrecords).toBe(0); + expect(vm.lazyloaderdashboard).toBe(true); + expect(vm.divuigrid).toBe(true); + + }); + }); + + describe('Verification of showAreaofLawDrop function', function () { + it('It should show showAreaofLawDrop', function () { + vm.aoldropvisible = false; + vm.practiceGroups = undefined; + vm.aolTerms = undefined; + vm.showAreaofLawDrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.lazyloaderaol).toBe(true); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + }); + + it('It should not show showAreaofLawDrop', function () { + vm.clientdropvisible = true; + vm.showClientDrop(event); + expect(vm.clientdrop).toBe(false); + expect(vm.clientdropvisible).toBe(false); + expect(vm.lazyloaderaol).toBe(true); + expect(vm.pgdrop).toBe(false); + expect(vm.pgdropvisible).toBe(false); + expect(vm.aoldrop).toBe(false); + expect(vm.aoldropvisible).toBe(false); + + }); + }); + + describe('Verification of pinorunpin function', function () { + it('It should be added in pinned list and removed from pinned list', function () { + + var count = vm.pinMatterCount; + count = count + 1; + event.currentTarget.src = "../images/pin-666.png"; + vm.pinorunpin(event, oTestConfiguration.oMatterObject); + expect(count).toBeGreaterThan(0); + expect(vm.lazyloaderdashboard).toBe(true); + + }); + }); + +}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/NavigationController.spec.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/NavigationController.spec.js new file mode 100644 index 00000000..d5149a81 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/NavigationController.spec.js @@ -0,0 +1,30 @@ +/// JS2074, JS3058 +// Test suite +describe("Navigation Controller test suite", function () { + + var mockapi = function (navigationResource, callback) { + getData(navigationResource, mocknavigationResource); + }; + + beforeEach(module("matterMain")); + beforeEach(module("matterMain", function ($provide) { + $provide.factory("api", ["matterResource", "documentResource", "documentDashBoardResource", "matterDashBoardResource", "homeResource", mockapi]); + })); + + beforeEach(module("ui.router")); + beforeEach(module("ui.bootstrap")); + + beforeEach(inject(function ($controller, $rootScope) { + rootScope = $rootScope.$new(); + vm = $controller("navigationController as vm", { $scope: $scope, $state: $state, $stateParams: $stateParams, api: mockapi, $rootScope: rootScope }); + })); + + describe("Verification of canCreateMatter function", function () { + it("It should display the navigation content", function () { + vm.canCreateMatter(); + expect(vm.canLoginUserCreateMatter).toBe(true); + }); + }); +}); + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/UploadVerification.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/UploadVerification.js new file mode 100644 index 00000000..c0712c5a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Specs/UploadVerification.js @@ -0,0 +1,13 @@ +// Test suite +describe("Upload Controller test suite", function () { + "use strict"; + var upload = matter.upload.uploadManager; + + describe("Verification of closeNotificationDialog function", function () { + it("Should close notification dialog box", function () { + ////cm.closeNotificationDialog(); + ////expect(cm.IsDupliacteDocument).toBe(false); + }); + }); +}); + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Debug.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Debug.config new file mode 100644 index 00000000..2e302f9f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Release.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Release.config new file mode 100644 index 00000000..c3584446 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.config new file mode 100644 index 00000000..b976e206 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/Web.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/bower.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/bower.json new file mode 100644 index 00000000..a77b4358 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/bower.json @@ -0,0 +1,22 @@ +{ + "name": "asp.net", + "private": true, + "dependencies": { + "jasmine": "2.4.1", + "bootstrap": "3.3.5", + "jquery": "2.1.4", + "jquery-validation": "1.14.0", + "jquery-validation-unobtrusive": "3.2.4", + "angularjs": "1.5.2", + "angular-route": "1.5.2", + "angular-resource": "1.5.2", + "angular-sanitize": "1.5.2", + "adal-angular": "1.0.11", + "angular-ui-grid": "3.1.1", + "angular-bootstrap": "1.3.2", + "jasmine-core": "2.4.1" + }, + "resolutions": { + "angular": "1.5.2" + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/Open Notebook.onetoc2 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/Open Notebook.onetoc2 new file mode 100644 index 00000000..44ed7e34 Binary files /dev/null and b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/Open Notebook.onetoc2 differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/angulartics-azure.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/angulartics-azure.js new file mode 100644 index 00000000..8b40594b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/angulartics-azure.js @@ -0,0 +1,47 @@ +/** + * @license Angulartics v0.17.2 + * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics + * Microsoft Azure Application Insights plugin contributed by https://github.com/anthonychu + * License: MIT + */ +(function (angular) { + 'use strict'; + + /** + * @ngdoc overview + * @name angulartics.azure + * Enables analytics support for Microsoft Azure Application Insights (http://azure.microsoft.com/en-us/services/application-insights/) + */ + angular.module('angulartics.azure', ['angulartics']) + .config(['$analyticsProvider', function ($analyticsProvider, $locationProvider) { + + $analyticsProvider.registerPageTrack(function (path, $location) { + appInsights.trackPageView(path, $location.absUrl(), { "App Type" : configs.appInsights.appType}); + }); + + /** + * Numeric properties are sent as metric (measurement) properties. + * Everything else is sent as normal properties. + */ + $analyticsProvider.registerEventTrack(function (eventName, eventProperties) { + var properties = {}; + var measurements = {}; + + angular.forEach(eventProperties, function (value, key) { + if (isNumeric(value)) { + measurements[key] = parseFloat(value); + } else { + properties[key] = value; + } + }); + + appInsights.trackEvent(eventName, properties, measurements); + + }); + + }]); + + function isNumeric(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } +})(angular); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.js new file mode 100644 index 00000000..82ecce7b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.js @@ -0,0 +1 @@ +// Write your Javascript code. diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.min.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.min.js new file mode 100644 index 00000000..254cf5cd --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/js/site.min.js @@ -0,0 +1 @@ +!function(a){"use strict";function n(a){return!isNaN(parseFloat(a))&&isFinite(a)}a.module("angulartics.azure",["angulartics"]).config(["$analyticsProvider",function(t,i){t.registerPageTrack(function(a,n){appInsights.trackPageView(a,n.absUrl(),{"App Type":configs.appInsights.appType})}),t.registerEventTrack(function(t,i){var r={},e={};a.forEach(i,function(a,t){n(a)?e[t]=parseFloat(a):r[t]=a}),appInsights.trackEvent(t,r,e)})}])}(angular); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/packages.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/packages.config new file mode 100644 index 00000000..13064640 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Jasmine/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.Designer.cs deleted file mode 100644 index 66c39710..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.Designer.cs +++ /dev/null @@ -1,2800 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.ProviderService.App_GlobalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Constants { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Constants() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.ProviderService.App_GlobalResources.Constants", typeof(Constants).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to <View Scope='RecursiveAll'><Query><OrderBy><FieldRef Name='FileLeafRef' /></OrderBy><Where><And><Neq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Neq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query><ViewFields><FieldRef Name='FolderChildCount' /><FieldRef Name='FileDirRef' /><FieldRef Name='FileLeafRef' /></ViewFields></View>. - /// - internal static string All_Folders_Query { - get { - return ResourceManager.GetString("All_Folders_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Already Checked Out. - /// - internal static string Already_Check_Out_Message { - get { - return ResourceManager.GetString("Already_Check_Out_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FolderNames. - /// - internal static string Area_CustomProperty_FolderNames { - get { - return ResourceManager.GetString("Area_CustomProperty_FolderNames", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Calendar. - /// - internal static string Calendar_Name_Suffix { - get { - return ResourceManager.GetString("Calendar_Name_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the central repository where all the common lists are stored, e.g. https://[TENANT].sharepoint.com/sites/catalog]. - /// - internal static string Central_Repository_Url { - get { - return ResourceManager.GetString("Central_Repository_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientID, ClientURL. - /// - internal static string Client_Custom_Properties { - get { - return ResourceManager.GetString("Client_Custom_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientID. - /// - internal static string Client_Custom_Properties_Id { - get { - return ResourceManager.GetString("Client_Custom_Properties_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientUrl. - /// - internal static string Client_Custom_Properties_Url { - get { - return ResourceManager.GetString("Client_Custom_Properties_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} Owners. - /// - internal static string Client_Owner_Group_Title { - get { - return ResourceManager.GetString("Client_Owner_Group_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Clients. - /// - internal static string Client_Term_Set_Name { - get { - return ResourceManager.GetString("Client_Term_Set_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileDirRef. - /// - internal static string Column_Name_File_Dir_Ref { - get { - return ResourceManager.GetString("Column_Name_File_Dir_Ref", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileLeafRef. - /// - internal static string Column_Name_File_Leaf_Ref { - get { - return ResourceManager.GetString("Column_Name_File_Leaf_Ref", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileRef. - /// - internal static string Column_Name_File_Ref { - get { - return ResourceManager.GetString("Column_Name_File_Ref", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to GUID. - /// - internal static string Column_Name_Guid { - get { - return ResourceManager.GetString("Column_Name_Guid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Modified. - /// - internal static string Column_Name_Modified { - get { - return ResourceManager.GetString("Column_Name_Modified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SavedDocumentsDetails. - /// - internal static string Column_Name_Saved_Documents_Details { - get { - return ResourceManager.GetString("Column_Name_Saved_Documents_Details", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SavedMattersDetails. - /// - internal static string Column_Name_Saved_Matters_Details { - get { - return ResourceManager.GetString("Column_Name_Saved_Matters_Details", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserAlias. - /// - internal static string Column_Name_User_Alias { - get { - return ResourceManager.GetString("Column_Name_User_Alias", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/catalog/SiteAssets/{0}/Styles/spCommon.css. - /// - internal static string Common_CSS_File_Location { - get { - return ResourceManager.GetString("Common_CSS_File_Location", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Assets/Common Assets. - /// - internal static string Common_Folder { - get { - return ResourceManager.GetString("Common_Folder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/catalog/SiteAssets/{0}/Scripts/spCommon.js. - /// - internal static string Common_JS_File_Location { - get { - return ResourceManager.GetString("Common_JS_File_Location", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterTerms. - /// - internal static string Common_Term_Set_Group_Name { - get { - return ResourceManager.GetString("Common_Term_Set_Group_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Configurations. - /// - internal static string Configurations_Title_Value { - get { - return ResourceManager.GetString("Configurations_Title_Value", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to AreaOfLaw. - /// - internal static string Content_Type_Column_Area_Of_Law { - get { - return ResourceManager.GetString("Content_Type_Column_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Client_Id. - /// - internal static string Content_Type_Column_Client_Id { - get { - return ResourceManager.GetString("Content_Type_Column_Client_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Client_Name. - /// - internal static string Content_Type_Column_Client_Name { - get { - return ResourceManager.GetString("Content_Type_Column_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter_Id. - /// - internal static string Content_Type_Column_Matter_Id { - get { - return ResourceManager.GetString("Content_Type_Column_Matter_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter_Name. - /// - internal static string Content_Type_Column_Matter_Name { - get { - return ResourceManager.GetString("Content_Type_Column_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to PracticeGroup. - /// - internal static string Content_Type_Column_Practice_Group { - get { - return ResourceManager.GetString("Content_Type_Column_Practice_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SubareaOfLaw. - /// - internal static string Content_Type_Column_Subarea_Of_Law { - get { - return ResourceManager.GetString("Content_Type_Column_Subarea_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 128. - /// - internal static string Content_Type_Length { - get { - return ResourceManager.GetString("Content_Type_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LinkOrder. - /// - internal static string Contextual_Help_Links_Column_LinkOrder { - get { - return ResourceManager.GetString("Contextual_Help_Links_Column_LinkOrder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LinkTitle0. - /// - internal static string Contextual_Help_Links_Column_LinkTitle { - get { - return ResourceManager.GetString("Contextual_Help_Links_Column_LinkTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LinkURL. - /// - internal static string Contextual_Help_Links_Column_LinkURL { - get { - return ResourceManager.GetString("Contextual_Help_Links_Column_LinkURL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SectionID. - /// - internal static string Contextual_Help_Links_Column_SectionID { - get { - return ResourceManager.GetString("Contextual_Help_Links_Column_SectionID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <Eq><FieldRef Name='{0}' /><Value Type='Lookup'>{1}</Value></Eq>;<Or>{0}</Or>. - /// - internal static string Contextual_Help_Query_Include_Or_Condition { - get { - return ResourceManager.GetString("Contextual_Help_Query_Include_Or_Condition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NumberOfColumns. - /// - internal static string Contextual_Help_Section_Column_NumberOfColumns { - get { - return ResourceManager.GetString("Contextual_Help_Section_Column_NumberOfColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to PageName. - /// - internal static string Contextual_Help_Section_Column_PageName { - get { - return ResourceManager.GetString("Contextual_Help_Section_Column_PageName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SectionID. - /// - internal static string Contextual_Help_Section_Column_SectionID { - get { - return ResourceManager.GetString("Contextual_Help_Section_Column_SectionID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SectionOrder. - /// - internal static string Contextual_Help_Section_Column_SectionOrder { - get { - return ResourceManager.GetString("Contextual_Help_Section_Column_SectionOrder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SectionTitle. - /// - internal static string Contextual_Help_Section_Column_SectionTitle { - get { - return ResourceManager.GetString("Contextual_Help_Section_Column_SectionTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DelegationIssuance1.0. - /// - internal static string Delegation_Issuance { - get { - return ResourceManager.GetString("Delegation_Issuance", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 0. - /// - internal static string DeleteMatterCode { - get { - return ResourceManager.GetString("DeleteMatterCode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterMatters. - /// - internal static string DMS_Matter_List_Name { - get { - return ResourceManager.GetString("DMS_Matter_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterRoles. - /// - internal static string DMS_Role_List_Name { - get { - return ResourceManager.GetString("DMS_Role_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View><Query><OrderBy><FieldRef Name = "RoleName" Ascending = "TRUE"/></OrderBy></Query></View>. - /// - internal static string DMS_Role_Query { - get { - return ResourceManager.GetString("DMS_Role_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Email. - /// - internal static string Email_Folder_Name { - get { - return ResourceManager.GetString("Email_Folder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ^[\s]*\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*[\s]*$. - /// - internal static string Email_Validation_Regex { - get { - return ResourceManager.GetString("Email_Validation_Regex", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} library for this Matter is already created. Kindly delete the library or please enter a different Matter name.. - /// - internal static string Error_Duplicate_Matter { - get { - return ResourceManager.GetString("Error_Duplicate_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Landing page of this Matter is already created. Kindly delete existing landing page or please enter a different Matter name.. - /// - internal static string Error_Duplicate_MatterLandingPage { - get { - return ResourceManager.GetString("Error_Duplicate_MatterLandingPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please provide at least one user who has Full Control permission on this matter.. - /// - internal static string Error_Edit_Matter_Mandatory_Permission { - get { - return ResourceManager.GetString("Error_Edit_Matter_Mandatory_Permission", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000004. - /// - internal static string ErrorCodeAddCalendarList { - get { - return ResourceManager.GetString("ErrorCodeAddCalendarList", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000006. - /// - internal static string ErrorCodeAddTaskList { - get { - return ResourceManager.GetString("ErrorCodeAddTaskList", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000009. - /// - internal static string ErrorCodeAssignDefaultContentType { - get { - return ResourceManager.GetString("ErrorCodeAssignDefaultContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000003. - /// - internal static string ErrorCodeCalendarCreation { - get { - return ResourceManager.GetString("ErrorCodeCalendarCreation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000001. - /// - internal static string ErrorCodeContentType { - get { - return ResourceManager.GetString("ErrorCodeContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000007. - /// - internal static string ErrorCodeCreateSiteColumn { - get { - return ResourceManager.GetString("ErrorCodeCreateSiteColumn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000008. - /// - internal static string ErrorCodeCreateSiteContentType { - get { - return ResourceManager.GetString("ErrorCodeCreateSiteContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000002. - /// - internal static string ErrorCodeMatterLandingPage { - get { - return ResourceManager.GetString("ErrorCodeMatterLandingPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000005. - /// - internal static string ErrorCodeMatterLandingPageExists { - get { - return ResourceManager.GetString("ErrorCodeMatterLandingPageExists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000010. - /// - internal static string ErrorCodeOneDriveNotConfigured { - get { - return ResourceManager.GetString("ErrorCodeOneDriveNotConfigured", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while creating calendar list. - /// - internal static string ErrorMessageAddCalendarList { - get { - return ResourceManager.GetString("ErrorMessageAddCalendarList", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while creating task list. - /// - internal static string ErrorMessageAddTaskList { - get { - return ResourceManager.GetString("ErrorMessageAddTaskList", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while assigning default content type to library while sending documents to OneDrive. - /// - internal static string ErrorMessageAssignDefaultContentType { - get { - return ResourceManager.GetString("ErrorMessageAssignDefaultContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while assigning permissions to calendar list. - /// - internal static string ErrorMessageCalendarCreation { - get { - return ResourceManager.GetString("ErrorMessageCalendarCreation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The selected Content Type is not present in the collection. - /// - internal static string ErrorMessageContentType { - get { - return ResourceManager.GetString("ErrorMessageContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while creating site column while sending documents to OneDrive. - /// - internal static string ErrorMessageCreateSiteColumn { - get { - return ResourceManager.GetString("ErrorMessageCreateSiteColumn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while creating site content type while sending documents to OneDrive. - /// - internal static string ErrorMessageCreateSiteContentType { - get { - return ResourceManager.GetString("ErrorMessageCreateSiteContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while creating matter landing page. - /// - internal static string ErrorMessageMatterLandingPage { - get { - return ResourceManager.GetString("ErrorMessageMatterLandingPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while assigning permission to task list. - /// - internal static string ErrorMessageTaskCreation { - get { - return ResourceManager.GetString("ErrorMessageTaskCreation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to https://outlook.office365.com/ews/Exchange.asmx. - /// - internal static string Exchange_Service_URL { - get { - return ResourceManager.GetString("Exchange_Service_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to unavailable. - /// - internal static string File_Not_Available_Message { - get { - return ResourceManager.GetString("File_Not_Available_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to aspx,html,htm,css,js,mht,one,onetoc2,onepkg,onetoc,svc,asmx,exe,dll,config,cer,pfx,ps1,xml,xslt. - /// - internal static string Find_Document_Invalid_Extensions { - get { - return ResourceManager.GetString("Find_Document_Invalid_Extensions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Title,ServerRelativeURL,FileExtension,SiteName,MCModifiedDate,UIVersionStringOWSTEXT,SiteTitle,FileName. - /// - internal static string Find_Document_Select_Search_Properties { - get { - return ResourceManager.GetString("Find_Document_Select_Search_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Title,Name,Description,SiteName,LastModifiedTime,MatterCenterPracticeGroup,MatterCenterAreaOfLaw,MatterCenterSubAreaOfLaw,MatterCenterMatterID,RefinableString10,Path. - /// - internal static string Find_Matter_Select_Search_Properties { - get { - return ResourceManager.GetString("Find_Matter_Select_Search_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View Scope='RecursiveAll'><Query><Where><And><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq><Eq><FieldRef Name='ID' /><Value Type='Integer'>{0}</Value></Eq></And></Where></Query></View>. - /// - internal static string Get_Briefcase_Items_Query { - get { - return ResourceManager.GetString("Get_Briefcase_Items_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View Scope='RecursiveAll'><Query> <Where><And><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq></And></Where> </Query></View>. - /// - internal static string Get_Item_By_Name { - get { - return ResourceManager.GetString("Get_Item_By_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>{0}</Value></Eq></Where></Query></View>. - /// - internal static string Get_Item_By_Name_Query { - get { - return ResourceManager.GetString("Get_Item_By_Name_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View><Query><Where><And><Eq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query></View>. - /// - internal static string Get_Legal_Briefcase_Folder_Contents { - get { - return ResourceManager.GetString("Get_Legal_Briefcase_Folder_Contents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View><Query><Where><And><Eq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query></View>. - /// - internal static string Get_Legal_Briefcase_Folder_Query { - get { - return ResourceManager.GetString("Get_Legal_Briefcase_Folder_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Folder. - /// - internal static string Hidden_Content_Type { - get { - return ResourceManager.GetString("Hidden_Content_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 105. - /// - internal static string Incorrect_Input_Area_Of_Law_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Area_Of_Law_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Area_Of_Law_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Area_Of_Law_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 118. - /// - internal static string Incorrect_Input_Block_User_Names_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Block_User_Names_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Block_User_Names_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Block_User_Names_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 102. - /// - internal static string Incorrect_Input_Client_Id_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Id_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Client_Id_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Id_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 103. - /// - internal static string Incorrect_Input_Client_Name_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Name_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Client_Name_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Name_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 101. - /// - internal static string Incorrect_Input_Client_Url_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Url_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Client_Url_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Client_Url_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 117. - /// - internal static string Incorrect_Input_Conflict_Check_By_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Check_By_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Conflict_Check_By_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Check_By_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 114. - /// - internal static string Incorrect_Input_Conflict_Date_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Date_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Conflict_Date_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Date_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 115. - /// - internal static string Incorrect_Input_Conflict_Identified_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Identified_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Conflict_Identified_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Conflict_Identified_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 112. - /// - internal static string Incorrect_Input_Content_Type_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Content_Type_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Content_Type_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Content_Type_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 123. - /// - internal static string Incorrect_Input_Current_Search_Name_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Current_Search_Name_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Current_Search_Name_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Current_Search_Name_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 122. - /// - internal static string Incorrect_Input_Existing_Search_Name_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Existing_Search_Name_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Existing_Search_Name_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Existing_Search_Name_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 113. - /// - internal static string Incorrect_Input_Matter_Description_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Description_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Matter_Description_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Description_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 109. - /// - internal static string Incorrect_Input_Matter_Id_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Id_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Matter_Id_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Id_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 108. - /// - internal static string Incorrect_Input_Matter_Name_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Name_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Matter_Name_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Matter_Name_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 104. - /// - internal static string Incorrect_Input_Practice_Group_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Practice_Group_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Practice_Group_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Practice_Group_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 100. - /// - internal static string Incorrect_Input_Request_Object_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Request_Object_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Request_Object_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Request_Object_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 107. - /// - internal static string Incorrect_Input_Responsible_Attorney_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Responsible_Attorney_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Responsible_Attorney_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Responsible_Attorney_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 120. - /// - internal static string Incorrect_Input_Save_Search_Name_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Save_Search_Name_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Save_Search_Name_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Save_Search_Name_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 125. - /// - internal static string Incorrect_Input_Security_Group_Exists_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Security_Group_Exists_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Security Groups are not allowed for matters where conflicts are identified. Remove all Security Groups to proceed.. - /// - internal static string Incorrect_Input_Security_Group_Exists_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Security_Group_Exists_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 124. - /// - internal static string Incorrect_Input_Self_Permission_Removal_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Self_Permission_Removal_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 106. - /// - internal static string Incorrect_Input_Subarea_Of_Law_Code { - get { - return ResourceManager.GetString("Incorrect_Input_Subarea_Of_Law_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_Subarea_Of_Law_Message { - get { - return ResourceManager.GetString("Incorrect_Input_Subarea_Of_Law_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 127. - /// - internal static string Incorrect_Input_User_Access_Code { - get { - return ResourceManager.GetString("Incorrect_Input_User_Access_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_User_Access_Message { - get { - return ResourceManager.GetString("Incorrect_Input_User_Access_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 110. - /// - internal static string Incorrect_Input_User_Names_Code { - get { - return ResourceManager.GetString("Incorrect_Input_User_Names_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_User_Names_Message { - get { - return ResourceManager.GetString("Incorrect_Input_User_Names_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 111. - /// - internal static string Incorrect_Input_User_Permissions_Code { - get { - return ResourceManager.GetString("Incorrect_Input_User_Permissions_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_User_Permissions_Message { - get { - return ResourceManager.GetString("Incorrect_Input_User_Permissions_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 116. - /// - internal static string Incorrect_Input_User_Roles_Code { - get { - return ResourceManager.GetString("Incorrect_Input_User_Roles_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect Inputs. - /// - internal static string Incorrect_Input_User_Roles_Message { - get { - return ResourceManager.GetString("Incorrect_Input_User_Roles_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 126. - /// - internal static string Incorrect_Team_Members_Code { - get { - return ResourceManager.GetString("Incorrect_Team_Members_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter valid team members.. - /// - internal static string Incorrect_Team_Members_Message { - get { - return ResourceManager.GetString("Incorrect_Team_Members_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to true. - /// - internal static string Is_Content_Check { - get { - return ResourceManager.GetString("Is_Content_Check", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to IsReadOnlyUser. - /// - internal static string Is_Read_Only_User { - get { - return ResourceManager.GetString("Is_Read_Only_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to True. - /// - internal static string IsCreateCalendarEnabled { - get { - return ResourceManager.GetString("IsCreateCalendarEnabled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to False. - /// - internal static string IsForceCheckOut { - get { - return ResourceManager.GetString("IsForceCheckOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to True. - /// - internal static string IsMajorVersionEnable { - get { - return ResourceManager.GetString("IsMajorVersionEnable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to False. - /// - internal static string IsMinorVersionEnable { - get { - return ResourceManager.GetString("IsMinorVersionEnable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to True. - /// - internal static string IsTenantDeployment { - get { - return ResourceManager.GetString("IsTenantDeployment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Briefcase. - /// - internal static string Legal_Briefcase_Folder_Name { - get { - return ResourceManager.GetString("Legal_Briefcase_Folder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [[[Enter name of the table on Azure storage where all error/exception log, e.g. MatterCenterLogStorage]]]. - /// - internal static string LogTableName { - get { - return ResourceManager.GetString("LogTableName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please find requested files attached to this email.. - /// - internal static string Mail_Cart_Mail_Body { - get { - return ResourceManager.GetString("Mail_Cart_Mail_Body", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Document(s). - /// - internal static string Mail_Cart_Mail_Subject { - get { - return ResourceManager.GetString("Mail_Cart_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCAreaofLaw. - /// - internal static string Managed_Property_Area_Of_Law { - get { - return ResourceManager.GetString("Managed_Property_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MSITOfficeAuthor. - /// - internal static string Managed_Property_Author { - get { - return ResourceManager.GetString("Managed_Property_Author", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCBlockedUploadUser. - /// - internal static string Managed_Property_Blocked_Upload_Users { - get { - return ResourceManager.GetString("Managed_Property_Blocked_Upload_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckoutUserOWSUSER. - /// - internal static string Managed_Property_CheckOut_By_User { - get { - return ResourceManager.GetString("Managed_Property_CheckOut_By_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientID. - /// - internal static string Managed_Property_Client_Id { - get { - return ResourceManager.GetString("Managed_Property_Client_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientName. - /// - internal static string Managed_Property_Client_Name { - get { - return ResourceManager.GetString("Managed_Property_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Created. - /// - internal static string Managed_Property_Created { - get { - return ResourceManager.GetString("Managed_Property_Created", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString10. - /// - internal static string Managed_Property_Custom_Title { - get { - return ResourceManager.GetString("Managed_Property_Custom_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Description. - /// - internal static string Managed_Property_Description { - get { - return ResourceManager.GetString("Managed_Property_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCCheckoutUser. - /// - internal static string Managed_Property_Document_CheckOutUser { - get { - return ResourceManager.GetString("Managed_Property_Document_CheckOutUser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCDocumentClientID. - /// - internal static string Managed_Property_Document_Client_Id { - get { - return ResourceManager.GetString("Managed_Property_Document_Client_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCDocumentClientName. - /// - internal static string Managed_Property_Document_Client_Name { - get { - return ResourceManager.GetString("Managed_Property_Document_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to dlcDocIdOWSText. - /// - internal static string Managed_Property_Document_Id { - get { - return ResourceManager.GetString("Managed_Property_Document_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCModifiedDate. - /// - internal static string Managed_Property_Document_Last_Modified_Time { - get { - return ResourceManager.GetString("Managed_Property_Document_Last_Modified_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString12. - /// - internal static string Managed_Property_Document_Matter_Id { - get { - return ResourceManager.GetString("Managed_Property_Document_Matter_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString13. - /// - internal static string Managed_Property_Document_Matter_Name { - get { - return ResourceManager.GetString("Managed_Property_Document_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCVersionNumber. - /// - internal static string Managed_Property_Document_Version { - get { - return ResourceManager.GetString("Managed_Property_Document_Version", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileExtension. - /// - internal static string Managed_Property_File_Extension { - get { - return ResourceManager.GetString("Managed_Property_File_Extension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileName. - /// - internal static string Managed_Property_File_Name { - get { - return ResourceManager.GetString("Managed_Property_File_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to IsDocument. - /// - internal static string Managed_Property_Is_Document { - get { - return ResourceManager.GetString("Managed_Property_Is_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCIsMatter. - /// - internal static string Managed_Property_Is_Matter { - get { - return ResourceManager.GetString("Managed_Property_Is_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LastModifiedTime. - /// - internal static string Managed_Property_Last_Modified_Time { - get { - return ResourceManager.GetString("Managed_Property_Last_Modified_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterID. - /// - internal static string Managed_Property_Matter_Id { - get { - return ResourceManager.GetString("Managed_Property_Matter_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName. - /// - internal static string Managed_Property_Matter_Name { - get { - return ResourceManager.GetString("Managed_Property_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name. - /// - internal static string Managed_Property_Name { - get { - return ResourceManager.GetString("Managed_Property_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCOpenDate. - /// - internal static string Managed_Property_Open_Date { - get { - return ResourceManager.GetString("Managed_Property_Open_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Path. - /// - internal static string Managed_Property_Path { - get { - return ResourceManager.GetString("Managed_Property_Path", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCPracticeGroup. - /// - internal static string Managed_Property_Practice_Group { - get { - return ResourceManager.GetString("Managed_Property_Practice_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCResponsibleAttorney. - /// - internal static string Managed_Property_Responsible_Attorney { - get { - return ResourceManager.GetString("Managed_Property_Responsible_Attorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ServerRelativeURL. - /// - internal static string Managed_Property_Server_Relative_Url { - get { - return ResourceManager.GetString("Managed_Property_Server_Relative_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SiteName. - /// - internal static string Managed_Property_Site_Name { - get { - return ResourceManager.GetString("Managed_Property_Site_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SiteTitle. - /// - internal static string Managed_Property_Site_Title { - get { - return ResourceManager.GetString("Managed_Property_Site_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SPWebUrl. - /// - internal static string Managed_Property_SPWeb_Url { - get { - return ResourceManager.GetString("Managed_Property_SPWeb_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCSubAreaofLaw. - /// - internal static string Managed_Property_Sub_Area_Of_Law { - get { - return ResourceManager.GetString("Managed_Property_Sub_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCTeamMembers. - /// - internal static string Managed_Property_Team_Members { - get { - return ResourceManager.GetString("Managed_Property_Team_Members", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Title. - /// - internal static string Managed_Property_Title { - get { - return ResourceManager.GetString("Managed_Property_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UIVersionStringOWSTEXT. - /// - internal static string Managed_Property_UI_Version_String_OWSTEXT { - get { - return ResourceManager.GetString("Managed_Property_UI_Version_String_OWSTEXT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MMM dd, yyyy. - /// - internal static string Matter_Center_Date_Format { - get { - return ResourceManager.GetString("Matter_Center_Date_Format", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterHelpLinks. - /// - internal static string Matter_Center_Help_Links_List_Name { - get { - return ResourceManager.GetString("Matter_Center_Help_Links_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterHelpSection. - /// - internal static string Matter_Center_Help_Section_List_Name { - get { - return ResourceManager.GetString("Matter_Center_Help_Section_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to AppLandingPage;SearchMatter;SearchDocument;WebDashboard;ProvisionMatter. - /// - internal static string Matter_Center_Pages { - get { - return ResourceManager.GetString("Matter_Center_Pages", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ConfigurationValue. - /// - internal static string Matter_Configuration_List_Column_Name { - get { - return ResourceManager.GetString("Matter_Configuration_List_Column_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Configurations. - /// - internal static string Matter_Configurations_List { - get { - return ResourceManager.GetString("Matter_Configurations_List", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View><Query><Where><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq></Where></Query><ViewFields><FieldRef Name='Modified'/><FieldRef Name='ConfigurationValue'/></ViewFields></View>. - /// - internal static string Matter_Configurations_List_Query { - get { - return ResourceManager.GetString("Matter_Configurations_List_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter is deleted successfully. - /// - internal static string Matter_Deletion_Message { - get { - return ResourceManager.GetString("Matter_Deletion_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 255. - /// - internal static string Matter_Description_Length { - get { - return ResourceManager.GetString("Matter_Description_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterMatterGUID. - /// - internal static string Matter_GUID { - get { - return ResourceManager.GetString("Matter_GUID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 75. - /// - internal static string Matter_Id_Length { - get { - return ResourceManager.GetString("Matter_Id_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Assets/Matter Landing Assets. - /// - internal static string Matter_Landing_Folder { - get { - return ResourceManager.GetString("Matter_Landing_Folder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/catalog/SiteAssets/{0}/Styles/MatterLanding.css. - /// - internal static string Matter_Landing_Page_CSS_File_Name { - get { - return ResourceManager.GetString("Matter_Landing_Page_CSS_File_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/catalog/SiteAssets/{0}/Scripts/jquery-1.11.1.min.js. - /// - internal static string Matter_Landing_Page_jQuery_File_Name { - get { - return ResourceManager.GetString("Matter_Landing_Page_jQuery_File_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Site Pages. - /// - internal static string Matter_Landing_Page_Repository_Name { - get { - return ResourceManager.GetString("Matter_Landing_Page_Repository_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/catalog/SiteAssets/{0}/Scripts/MatterLanding.js. - /// - internal static string Matter_Landing_Page_Script_File_Name { - get { - return ResourceManager.GetString("Matter_Landing_Page_Script_File_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to taskPane,calendarPane,matterCenterFooter,matterInfo,matterCenterHeader,rssPane,oneNotePane. - /// - internal static string Matter_Landing_Page_Sections { - get { - return ResourceManager.GetString("Matter_Landing_Page_Sections", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Conflicted User. - /// - internal static string Matter_Mail_Body_Block_User { - get { - return ResourceManager.GetString("Matter_Mail_Body_Block_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><div style="font-weight: 600;">Conflict Check:</div><div style="margin-left: 15px;"><div>Conducted: {0}</div><div>Conducted by: {1}</div><div>Date: {2}</div><div>Conflict Identified: {3}</div></div></div>. - /// - internal static string Matter_Mail_Body_Conflict_Check { - get { - return ResourceManager.GetString("Matter_Mail_Body_Conflict_Check", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><span style="font-weight: 600;">Matter Information:</span><div style="margin-left: 15px;"><div>Client Name: {0}</div><div>Client ID: {1}</div><div>Matter Name: {2}</div><div>Matter ID: {3}</div><div>Matter Description: {4}</div><div style="margin-bottom: 10px">Matter Type: {5}</div></div></div>. - /// - internal static string Matter_Mail_Body_Matter_Information { - get { - return ResourceManager.GetString("Matter_Mail_Body_Matter_Information", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><div style="margin-left: 15px;"><div>Is Matter secured only to the assigned team: {0}</div></div><div style="font-weight: 600;margin-top: 10px;">Team Members: </div><div style="margin-left: 15px;">{1}{2}</div></div><div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;margin-top: 10px;">You can now access OneNote <span><a href='{3}/_layouts/WopiFrame.aspx?sourcedoc={4}.onetoc2'>{5}</a> [rest of string was truncated]";. - /// - internal static string Matter_Mail_Body_Team_Members { - get { - return ResourceManager.GetString("Matter_Mail_Body_Team_Members", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <span style='font-weight: 600;'>{0}</span>. - /// - internal static string Matter_Mail_Default_Content_Type_Html_Chunk { - get { - return ResourceManager.GetString("Matter_Mail_Default_Content_Type_Html_Chunk", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to New Matter: {0} | {1} is provisioned by {2}. - /// - internal static string Matter_Mail_Subject { - get { - return ResourceManager.GetString("Matter_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 75. - /// - internal static string Matter_Name_Length { - get { - return ResourceManager.GetString("Matter_Name_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter library not found while deleting. - /// - internal static string Matter_Not_Present { - get { - return ResourceManager.GetString("Matter_Not_Present", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 202. - /// - internal static string MatterLandingExistsCode { - get { - return ResourceManager.GetString("MatterLandingExistsCode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 201. - /// - internal static string MatterLibraryExistsCode { - get { - return ResourceManager.GetString("MatterLibraryExistsCode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to BlockUsers. - /// - internal static string Matters_List_Column_Block_Users { - get { - return ResourceManager.GetString("Matters_List_Column_Block_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientID. - /// - internal static string Matters_List_Column_Client_ID { - get { - return ResourceManager.GetString("Matters_List_Column_Client_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientName. - /// - internal static string Matters_List_Column_Client_Name { - get { - return ResourceManager.GetString("Matters_List_Column_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ConflictCheckBy. - /// - internal static string Matters_List_Column_Conflict_Check_By { - get { - return ResourceManager.GetString("Matters_List_Column_Conflict_Check_By", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ConflictCheckOn. - /// - internal static string Matters_List_Column_Conflict_Check_On { - get { - return ResourceManager.GetString("Matters_List_Column_Conflict_Check_On", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ConflictIdentified. - /// - internal static string Matters_List_Column_Conflict_Identified { - get { - return ResourceManager.GetString("Matters_List_Column_Conflict_Identified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ManagingAttorney. - /// - internal static string Matters_List_Column_Managing_Attorney { - get { - return ResourceManager.GetString("Matters_List_Column_Managing_Attorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterID. - /// - internal static string Matters_List_Column_Matter_ID { - get { - return ResourceManager.GetString("Matters_List_Column_Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName. - /// - internal static string Matters_List_Column_Matter_Name { - get { - return ResourceManager.GetString("Matters_List_Column_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Support. - /// - internal static string Matters_List_Column_Support { - get { - return ResourceManager.GetString("Matters_List_Column_Support", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Title. - /// - internal static string Matters_List_Column_Title { - get { - return ResourceManager.GetString("Matters_List_Column_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Inputs. - /// - internal static string Message_No_Inputs { - get { - return ResourceManager.GetString("Message_No_Inputs", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Untitled. - /// - internal static string No_Mail_Subject { - get { - return ResourceManager.GetString("No_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NA. - /// - internal static string Not_Applicable { - get { - return ResourceManager.GetString("Not_Applicable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center for OneDrive. - /// - internal static string One_Drive_Content_Type { - get { - return ResourceManager.GetString("One_Drive_Content_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _MatterCenter. - /// - internal static string One_Drive_Content_Type_Group { - get { - return ResourceManager.GetString("One_Drive_Content_Type_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents. - /// - internal static string One_Drive_Document_Library_Title { - get { - return ResourceManager.GetString("One_Drive_Document_Library_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Document. - /// - internal static string One_Drive_Parent_Content_Type { - get { - return ResourceManager.GetString("One_Drive_Parent_Content_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DMSSourceUrl. - /// - internal static string One_Drive_Site_Column { - get { - return ResourceManager.GetString("One_Drive_Site_Column", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <Field Type="Text" DisplayName="{0}" Description="This is the source url" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="{1}" StaticName="{0}" Name="{0}" Hidden="FALSE" Customization="" ReadOnly="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Aggregation="" Node="" ColName="nvarchar13" RowOrdinal="0" ShowInDisplayForm="TRUE"> - /// </Field>. - /// - internal static string One_Drive_Site_Column_Schema { - get { - return ResourceManager.GetString("One_Drive_Site_Column_Schema", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Text. - /// - internal static string One_Drive_Site_Column_Type { - get { - return ResourceManager.GetString("One_Drive_Site_Column_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Person.aspx. - /// - internal static string OneDriveNotSetupUrl { - get { - return ResourceManager.GetString("OneDriveNotSetupUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _OneNote. - /// - internal static string OneNoteLibrary_Name_Suffix { - get { - return ResourceManager.GetString("OneNoteLibrary_Name_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid Parameters. - /// - internal static string Parameter_Invalid_Message { - get { - return ResourceManager.GetString("Parameter_Invalid_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Some Parameters are missing. - /// - internal static string Parameter_Missing_Message { - get { - return ResourceManager.GetString("Parameter_Missing_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to false. - /// - internal static string People_Picker_Allow_Multiple_Entities { - get { - return ResourceManager.GetString("People_Picker_Allow_Multiple_Entities", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 500. - /// - internal static string People_Picker_Max_Entity_Suggestions { - get { - return ResourceManager.GetString("People_Picker_Max_Entity_Suggestions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 30. - /// - internal static string People_Picker_Max_Records { - get { - return ResourceManager.GetString("People_Picker_Max_Records", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results found. - /// - internal static string People_Picker_No_Results_Found { - get { - return ResourceManager.GetString("People_Picker_No_Results_Found", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserPinDocumentDetails. - /// - internal static string Pinned_List_Column_Document_Details { - get { - return ResourceManager.GetString("Pinned_List_Column_Document_Details", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserPinDetails. - /// - internal static string Pinned_List_Column_Matter_Details { - get { - return ResourceManager.GetString("Pinned_List_Column_Matter_Details", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserAlias. - /// - internal static string Pinned_List_Column_User_Alias { - get { - return ResourceManager.GetString("Pinned_List_Column_User_Alias", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ContentTypeName. - /// - internal static string Practice_Group_Custom_Properties { - get { - return ResourceManager.GetString("Practice_Group_Custom_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FolderNames. - /// - internal static string Practice_Group_CustomProperty_FolderNames { - get { - return ResourceManager.GetString("Practice_Group_CustomProperty_FolderNames", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Practice Groups. - /// - internal static string Practice_Group_Term_Set_Name { - get { - return ResourceManager.GetString("Practice_Group_Term_Set_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to vti_indexedpropertykeys. - /// - internal static string Property_Name_Vti_Indexed_Property_Keys { - get { - return ResourceManager.GetString("Property_Name_Vti_Indexed_Property_Keys", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <GetListItems><Query><Where>{0}</Where></Query><ViewFields><FieldRef Name='SectionID' /><FieldRef Name='LinkTitle0' /><FieldRef Name='LinkURL' /><FieldRef Name='LinkOrder' /></ViewFields><QueryOptions /></GetListItems>. - /// - internal static string Retrieve_Contextual_Help_Links_Query { - get { - return ResourceManager.GetString("Retrieve_Contextual_Help_Links_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <GetListItems><Query><Where><Eq><FieldRef Name='PageName' /><Value Type='Choice'>{0}</Value></Eq></Where></Query><ViewFields><FieldRef Name='SectionID' /><FieldRef Name='SectionTitle' /><FieldRef Name='PageName' /><FieldRef Name='NumberOfColumns' /><FieldRef Name='SectionOrder' /></ViewFields><QueryOptions /></GetListItems>. - /// - internal static string Retrieve_Contextual_Help_Sections_Query { - get { - return ResourceManager.GetString("Retrieve_Contextual_Help_Sections_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Mandatory. - /// - internal static string Role_List_Column_Is_Role_Mandatory { - get { - return ResourceManager.GetString("Role_List_Column_Is_Role_Mandatory", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RoleName. - /// - internal static string Role_List_Column_Role_Name { - get { - return ResourceManager.GetString("Role_List_Column_Role_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter Result source ID which retrieves results from Matter Center specific site collection only, e.g. 334fbf-40a4aa-ba-d34e-4274ca46553ada]. - /// - internal static string Search_Result_Source_ID { - get { - return ResourceManager.GetString("Search_Result_Source_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div style='font-family:Calibri;font-size:12pt'>{0}</div>. - /// - internal static string Send_As_Email_Font_Style { - get { - return ResourceManager.GetString("Send_As_Email_Font_Style", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} ) {1} : <a href=" {2}" >{2} </a><br />. - /// - internal static string Send_As_Email_Format { - get { - return ResourceManager.GetString("Send_As_Email_Format", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View Scope='RecursiveAll'><Query><Where><And><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq><Eq><FieldRef Name='ID' /><Value Type='Integer'>{1}</Value></Eq></And></Where></Query><ViewFields><FieldRef Name='Title' /><FieldRef Name='{0}' /></ViewFields></View>. - /// - internal static string Send_To_Matter_Query { - get { - return ResourceManager.GetString("Send_To_Matter_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MailBody. - /// - internal static string Share_List_Column_Mail_Body { - get { - return ResourceManager.GetString("Share_List_Column_Mail_Body", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MailList. - /// - internal static string Share_List_Column_Mail_List { - get { - return ResourceManager.GetString("Share_List_Column_Mail_List", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MailSubject. - /// - internal static string Share_List_Column_Mail_Subject { - get { - return ResourceManager.GetString("Share_List_Column_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterPath. - /// - internal static string Share_List_Column_Matter_Path { - get { - return ResourceManager.GetString("Share_List_Column_Matter_Path", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the SharePoint site, e.g. https://[TENANTNAME].sharepoint.com]. - /// - internal static string Site_Url { - get { - return ResourceManager.GetString("Site_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to AreaOfLaw. - /// - internal static string Stamped_Property_Area_Of_Law { - get { - return ResourceManager.GetString("Stamped_Property_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to BlockedUploadUsers. - /// - internal static string Stamped_Property_Blocked_Upload_Users { - get { - return ResourceManager.GetString("Stamped_Property_Blocked_Upload_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to BlockedUsers. - /// - internal static string Stamped_Property_Blocked_Users { - get { - return ResourceManager.GetString("Stamped_Property_Blocked_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientID. - /// - internal static string Stamped_Property_Client_ID { - get { - return ResourceManager.GetString("Stamped_Property_Client_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientName. - /// - internal static string Stamped_Property_Client_Name { - get { - return ResourceManager.GetString("Stamped_Property_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterConflictCheckBy. - /// - internal static string Stamped_Property_Conflict_Check_By { - get { - return ResourceManager.GetString("Stamped_Property_Conflict_Check_By", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterConflictCheckDate. - /// - internal static string Stamped_Property_Conflict_Check_Date { - get { - return ResourceManager.GetString("Stamped_Property_Conflict_Check_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterDefaultContentType. - /// - internal static string Stamped_Property_DefaultContentType { - get { - return ResourceManager.GetString("Stamped_Property_DefaultContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentTemplateCount. - /// - internal static string Stamped_Property_DocumentTempateCount { - get { - return ResourceManager.GetString("Stamped_Property_DocumentTempateCount", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to IsMatter. - /// - internal static string Stamped_Property_Is_Matter { - get { - return ResourceManager.GetString("Stamped_Property_Is_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to IsConflictIdentified. - /// - internal static string Stamped_Property_IsConflictIdentified { - get { - return ResourceManager.GetString("Stamped_Property_IsConflictIdentified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterDescription. - /// - internal static string Stamped_Property_Matter_Description { - get { - return ResourceManager.GetString("Stamped_Property_Matter_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterGUID. - /// - internal static string Stamped_Property_Matter_GUID { - get { - return ResourceManager.GetString("Stamped_Property_Matter_GUID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterID. - /// - internal static string Stamped_Property_Matter_ID { - get { - return ResourceManager.GetString("Stamped_Property_Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName. - /// - internal static string Stamped_Property_Matter_Name { - get { - return ResourceManager.GetString("Stamped_Property_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterPermissions. - /// - internal static string Stamped_Property_MatterCenter_Permissions { - get { - return ResourceManager.GetString("Stamped_Property_MatterCenter_Permissions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterRoles. - /// - internal static string Stamped_Property_MatterCenter_Roles { - get { - return ResourceManager.GetString("Stamped_Property_MatterCenter_Roles", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterUserEmails. - /// - internal static string Stamped_Property_MatterCenter_User_Emails { - get { - return ResourceManager.GetString("Stamped_Property_MatterCenter_User_Emails", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterUsers. - /// - internal static string Stamped_Property_MatterCenter_Users { - get { - return ResourceManager.GetString("Stamped_Property_MatterCenter_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OpenDate. - /// - internal static string Stamped_Property_Open_Date { - get { - return ResourceManager.GetString("Stamped_Property_Open_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to PracticeGroup. - /// - internal static string Stamped_Property_Practice_Group { - get { - return ResourceManager.GetString("Stamped_Property_Practice_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ResponsibleAttorney. - /// - internal static string Stamped_Property_Responsible_Attorney { - get { - return ResourceManager.GetString("Stamped_Property_Responsible_Attorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ResponsibleAttorneyEmail. - /// - internal static string Stamped_Property_Responsible_Attorney_Email { - get { - return ResourceManager.GetString("Stamped_Property_Responsible_Attorney_Email", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SecureMatter. - /// - internal static string Stamped_Property_Secure_Matter { - get { - return ResourceManager.GetString("Stamped_Property_Secure_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SubAreaOfLaw. - /// - internal static string Stamped_Property_Sub_Area_Of_Law { - get { - return ResourceManager.GetString("Stamped_Property_Sub_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Success. - /// - internal static string Stamped_Property_Success { - get { - return ResourceManager.GetString("Stamped_Property_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to TeamMembers. - /// - internal static string Stamped_Property_Team_Members { - get { - return ResourceManager.GetString("Stamped_Property_Team_Members", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FolderNames. - /// - internal static string Sub_Area_CustomProperty_FolderNames { - get { - return ResourceManager.GetString("Sub_Area_CustomProperty_FolderNames", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to isNoFolderStructurePresent. - /// - internal static string Sub_Area_CustomProperty_isNoFolderStructurePresent { - get { - return ResourceManager.GetString("Sub_Area_CustomProperty_isNoFolderStructurePresent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentTemplates. - /// - internal static string Sub_Area_Of_Law_Document_Templates { - get { - return ResourceManager.GetString("Sub_Area_Of_Law_Document_Templates", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Task. - /// - internal static string Task_Name_Suffix { - get { - return ResourceManager.GetString("Task_Name_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenter. - /// - internal static string Temp_Email_Name { - get { - return ResourceManager.GetString("Temp_Email_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/contentTypeHub/templates/Forms/AllItems.aspx. - /// - internal static string Template_Document_Library_Link { - get { - return ResourceManager.GetString("Template_Document_Library_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/MatterCenterHome.aspx. - /// - internal static string Tenant_WebDashboard_Link { - get { - return ResourceManager.GetString("Tenant_WebDashboard_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Lists/. - /// - internal static string Title_Lists_Path { - get { - return ResourceManager.GetString("Title_Lists_Path", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OneDrive is not configured. - /// - internal static string User_My_Site_Not_Present { - get { - return ResourceManager.GetString("User_My_Site_Not_Present", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 128. - /// - internal static string User_Not_Site_Owner_Code { - get { - return ResourceManager.GetString("User_Not_Site_Owner_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You do not have permission to create matter for this client. - /// - internal static string User_Not_Site_Owner_Message { - get { - return ResourceManager.GetString("User_Not_Site_Owner_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Contribute,Full Control,Read. - /// - internal static string User_Permissions { - get { - return ResourceManager.GetString("User_Permissions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <View><Query><Where><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq></Where></Query><ViewFields><FieldRef Name='{2}' /></ViewFields></View>. - /// - internal static string User_Pinned_Details_Query { - get { - return ResourceManager.GetString("User_Pinned_Details_Query", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserPinnedDetails. - /// - internal static string User_Pinned_Document_List_Name { - get { - return ResourceManager.GetString("User_Pinned_Document_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserPinnedMatter. - /// - internal static string User_Pinned_Matter_List_Name { - get { - return ResourceManager.GetString("User_Pinned_Matter_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to UserSavedSearch. - /// - internal static string User_Saved_Search_List_Name { - get { - return ResourceManager.GetString("User_Saved_Search_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to yyyy-MM-ddTHH:mm:ssZ. - /// - internal static string Valid_Date_Format { - get { - return ResourceManager.GetString("Valid_Date_Format", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type;DMS_Mail_Importance;DMS_From;DMS_Subject;ReceivedDate;DMS_To;DMS_Cc;DMS_From_MailBox;Sensitivity;EmailCategories;ConversationId;ConversationTopic;HasAttachments;SentDate;LinkFilename;OriginalName. - /// - internal static string View_Column_List { - get { - return ResourceManager.GetString("View_Column_List", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Outlook View. - /// - internal static string View_Name { - get { - return ResourceManager.GetString("View_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ReceivedDate. - /// - internal static string View_OrderBy_Column { - get { - return ResourceManager.GetString("View_OrderBy_Column", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <OrderBy><FieldRef Name='{0}' Ascending='False' /></OrderBy>. - /// - internal static string View_OrderBy_Query { - get { - return ResourceManager.GetString("View_OrderBy_Query", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.resx deleted file mode 100644 index ca7fa2d9..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/App_GlobalResources/Constants.resx +++ /dev/null @@ -1,1336 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - <View Scope='RecursiveAll'><Query><OrderBy><FieldRef Name='FileLeafRef' /></OrderBy><Where><And><Neq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Neq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query><ViewFields><FieldRef Name='FolderChildCount' /><FieldRef Name='FileDirRef' /><FieldRef Name='FileLeafRef' /></ViewFields></View> - Query to get complete folder hierarchy within the specified library - - - [Enter URL of the central repository where all the common lists are stored, e.g. https://[TENANT].sharepoint.com/sites/catalog] - URL of the central repository where all the common lists are stored - - - ClientID, ClientURL - ',' separated custom property names that are stamped on client terms - - - ClientID - Custom property Client Id that is stamped on the client terms - - - ClientUrl - Custom property Client URL that is stamped on the client terms - - - Clients - Name of the term set which holds names of all the available clients with additional details - - - FileDirRef - SharePoint's internal field storing parent directory path/reference of each item - - - FileLeafRef - SharePoint's internal field storing name/title of each item - - - FileRef - SharePoint's internal field storing path/reference of each item - - - GUID - SharePoint's internal field storing GUID of each item - - - MatterCenterTerms - Name of the term set group which holds all the taxonomy configurations - - - Client_Id - Name of the column for Client Id in base DMS content type - - - Client_Name - Name of the column for Client Name in base DMS content type - - - Matter_Id - Name of the column for Matter Id in base DMS content type - - - Matter_Name - Name of the column for Matter Name in base DMS content type - - - DelegationIssuance1.0 - Delegation issuance version - - - MatterCenterMatters - Name of the list where details for each matter are stored - - - MatterCenterRoles - Name of the list where details for each role are stored - - - <View><Query><OrderBy><FieldRef Name = "RoleName" Ascending = "TRUE"/></OrderBy></Query></View> - Query to get roles from Roles list - - - Email - Name of the folder to be created for saving e-mails in matter libraries - - - Title,ServerRelativeURL,FileExtension,SiteName,MCModifiedDate,UIVersionStringOWSTEXT,SiteTitle,FileName - ',' separated list of search properties to be consumed in Find Document service - - - Title,Name,Description,SiteName,LastModifiedTime,MatterCenterPracticeGroup,MatterCenterAreaOfLaw,MatterCenterSubAreaOfLaw,MatterCenterMatterID,RefinableString10,Path - ',' separated list of search properties to be consumed in Find Matter service - - - [[[Enter name of the table on Azure storage where all error/exception log, e.g. MatterCenterLogStorage]]] - Name of the table on Azure storage where all error/exception log - - - Please find requested files attached to this email. - Body of the mail required as part of mail cart feature - - - Matter Center Document(s) - Subject of the mail required as part of mail cart feature - - - MCAreaofLaw - Name of managed property to retrieve Area of Law - - - MSITOfficeAuthor - Name of managed property to retrieve Author - - - MCClientID - Name of managed property to retrieve Client Id - - - MCClientName - Name of managed property to retrieve Client Name - - - Created - Name of managed property to retrieve Created Date - - - RefinableString10 - Name of managed property to retrieve custom Title - - - Description - Name of managed property to retrieve Description - - - MCDocumentClientID - Name of managed property to retrieve document’s Client Id - - - MCDocumentClientName - Name of managed property to retrieve document’s Client Name - - - dlcDocIdOWSText - Name of managed property to retrieve Document Id - - - RefinableString12 - Name of managed property to retrieve document’s Matter Id - - - RefinableString13 - Name of managed property to retrieve document’s Matter Name - - - FileExtension - Name of managed property to retrieve File Extension - - - IsDocument - Name of managed property to retrieve Is Document flag - - - MCIsMatter - Name of managed property to retrieve Is Matter flag - - - LastModifiedTime - Name of managed property to retrieve Last Modified Time - - - MCMatterID - Name of managed property to retrieve Matter Id - - - MCMatterName - Name of managed property to retrieve Matter Name - - - Name - Name of managed property to retrieve Name - - - MCOpenDate - Name of managed property to retrieve Open Date of matter - - - Path - Name of managed property to retrieve Path - - - MCPracticeGroup - Name of managed property to retrieve Practice Group - - - MCResponsibleAttorney - Name of managed property to retrieve Responsible Attorney names - - - ServerRelativeURL - Name of managed property to retrieve Server Relative URL - - - SiteName - Name of managed property to retrieve Site Name - - - SiteTitle - Name of managed property to retrieve Site Title - - - MCSubAreaofLaw - Name of managed property to retrieve Sub Area of Law - - - MCTeamMembers - Name of managed property to retrieve Team Member names - - - Title - Name of managed property to retrieve Title - - - UIVersionStringOWSTEXT - Name of managed property to retrieve UI Version string - - - BlockUsers - Name of the column storing Blocked User Names - - - ClientID - Name of the column storing Client Id - - - ClientName - Name of the column storing Client Name - - - ConflictCheckBy - Name of the column storing User Name who preformed Conflict Check - - - ConflictCheckOn - Name of the column storing Date when Conflict Check was performed - - - ConflictIdentified - Name of the column storing flag if Conflict was Identified - - - ManagingAttorney - Name of the column storing User Names who are assigned Managing/Responsible Attorney role - - - MatterID - Name of the column storing Matter Id - - - MatterName - Name of the column storing Matter Name - - - Support - Name of the column storing User Names who are assigned other roles - - - Title - Name of the column storing Title - - - No Inputs - Error message saying no inputs specified - - - UserPinDocumentDetails - Name of the column storing pinned document details in pinned details list - - - UserPinDetails - Name of the column storing pinned matter details in pinned details list - - - UserAlias - Name of the column storing user alias in pinned details list - - - ContentTypeName - ',' separated custom property names that are stamped on practice group terms/sub-terms - - - Mandatory - Name of the column storing flag to specify mandatory roles - - - RoleName - Name of the column storing role names - - - MailList - Name of the column storing list of users to whom mail is to be sent - - - MatterPath - Name of the column storing path of the matter - - - [Enter URL of the SharePoint site, e.g. https://[TENANTNAME].sharepoint.com] - URL of the SharePoint site - - - AreaOfLaw - Name of the stamped property to store Area of Law - - - ClientID - Name of the stamped property to store Client ID - - - ClientName - Name of the stamped property to store Client Name - - - IsMatter - Name of the stamped property to store Is Matter flag - - - MatterID - Name of the stamped property to store Matter ID - - - MatterName - Name of the stamped property to store Matter Name - - - OpenDate - Name of the stamped property to store Open Date - - - PracticeGroup - Name of the stamped property to store Practice Group - - - ResponsibleAttorney - Name of the stamped property to store Responsible Attorney - - - SubAreaOfLaw - Name of the stamped property to store Sub Area of Law - - - TeamMembers - Name of the stamped property to store Team Members - - - <View><Query><Where><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq></Where></Query><ViewFields><FieldRef Name='{2}' /></ViewFields></View> - Query to get pinned details for the specified user alias - - - UserPinnedDetails - Name of the list where pinned document details for each user are stored - - - UserPinnedMatter - Name of the list where pinned matter details for each user are stored - - - vti_indexedpropertykeys - Name of the indexed property - - - Practice Groups - Name of the term set which holds hierarchy with details of Practice Groups, Area of Laws, Sub Area of Laws and Content Types - - - FolderNames - Name of the Custom Property present in the Area of Law Term for Folder Hierarchy - - - FolderNames - Name of the Custom Property present in the Practice Group Term for Folder Hierarchy - - - FolderNames - Name of the Custom Property present in the Sub Area of Law Term for Folder Hierarchy - - - isNoFolderStructurePresent - Name of the Custom Property present in the Sub Area of Law Term for Folder Hierarchy - - - DocumentTemplates - Name of the Custom Property present in the Sub Area of Law Term for Document Templates - - - Folder - Name of the hidden content type for default content type functionality - - - Untitled - Default value if subject name is blank - - - True - Flag to differentiate whether the deployment is carried out on Tenant level or site collection level - - - SecureMatter - Name of the stamped property to store Secure Matter flag - - - CheckoutUserOWSUSER - Name of managed property to retrieve Check out by user name - - - False - Name of the property to enable force checkout on document library - - - True - Name of the property to enable major version on document library - - - False - Name of the property to enable minor version on document library - - - SavedDocumentsDetails - SharePoint's internal field storing Search results for Documents - - - SavedMattersDetails - SharePoint's internal field storing Search results for Matters - - - UserSavedSearch - Name of the list where Saved Search details for each user are stored - - - UserAlias - SharePoint's internal field storing User Names for Saved Search - - - Already Checked Out - Message to be displayed when document is already checked out - - - <View Scope='RecursiveAll'><Query><Where><And><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq><Eq><FieldRef Name='ID' /><Value Type='Integer'>{0}</Value></Eq></And></Where></Query></View> - Query to get all the list item from the briefcase - - - <View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>{0}</Value></Eq></Where></Query></View> - Query to get item by name - - - <View><Query><Where><And><Eq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query></View> - Query to get Legal Briefcase folder contents - - - <View><Query><Where><And><Eq><FieldRef Name='FileLeafRef'/><Value Type='Text'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></And></Where></Query></View> - Query to get Legal Briefcase folder from OneDrive - - - Matter Center Briefcase - Folder name where all files will be sent in OneDrive - - - Matter Center for OneDrive - OneDrive Content type name - - - Invalid Parameters - Message to be displayed when invalid parameters are provided to service - - - Some Parameters are missing - Message to be displayed when some parameters are not passed to service - - - <View Scope='RecursiveAll'><Query><Where><And><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq><Eq><FieldRef Name='ID' /><Value Type='Integer'>{1}</Value></Eq></And></Where></Query><ViewFields><FieldRef Name='Title' /><FieldRef Name='{0}' /></ViewFields></View> - Query to be used for retrieving specific items from Briefcase folder in OneDrive - - - OneDrive is not configured - OneDrive not configured message - - - _MatterCenter - Name of the content type group for OneDrive content type - - - Document - Name of the parent content type of OneDrive content type - - - DMSSourceUrl - Name of the Site Column to be associated with the OneDrive content type - - - <Field Type="Text" DisplayName="{0}" Description="This is the source url" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="{1}" StaticName="{0}" Name="{0}" Hidden="FALSE" Customization="" ReadOnly="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Aggregation="" Node="" ColName="nvarchar13" RowOrdinal="0" ShowInDisplayForm="TRUE"> - </Field> - Schema XML of SourceUrl site column for OneDrive - - - Text - Type of the site column for OneDrive content type - - - https://outlook.office365.com/ews/Exchange.asmx - Exchange server URL - - - BlockedUploadUsers - Name of the stamped property for the users who are not allowed to perform the upload operation - - - MCBlockedUploadUser - Name of managed property to retrieve users having read only access on the matter library - - - aspx,html,htm,css,js,mht,one,onetoc2,onepkg,onetoc,svc,asmx,exe,dll,config,cer,pfx,ps1,xml,xslt - ',' separated list of valid file extensions for find document - - - Contribute,Full Control,Read - These are the permissions that a user will have on the created matter library - - - /sites/catalog/SiteAssets/{0}/Scripts/jquery-1.11.1.min.js - Name of the jquery file to be used on Matter Landing page - - - /sites/catalog/SiteAssets/{0}/Scripts/MatterLanding.js - Name of the file which contains of all the JavaScript functions on Matter Landing page - - - /sites/catalog/SiteAssets/{0}/Styles/MatterLanding.css - CSS file name of the Matter Landing page - - - <View Scope='RecursiveAll'><Query> <Where><And><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>{0}</Value></Eq><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>0</Value></Eq></And></Where> </Query></View> - Query to get items by name, used for Share functionality - - - MailBody - Body column in SendMail list - - - MailSubject - Subject column in SendMail list - - - New Matter: {0} | {1} is provisioned by {2} - Subject of the matter creation mail - - - yyyy-MM-ddTHH:mm:ssZ - Default UTC date format to store dates - - - Matter Center Assets/Matter Landing Assets - Folder name for matter landing page assets on SharePoint - - - /SitePages/MatterCenterHome.aspx - Tenant level web dashboard link - - - /sites/contentTypeHub/templates/Forms/AllItems.aspx - Templates document library link that is present on Content Type Hub - - - FileName - Name of managed property to retrieve File Name - - - unavailable - File check out status when file not available. This string is compared in JS, so please do not change the casing. - - - 255 - Maximum allowed characters in matter description - - - 75 - Maximum allowed characters in matter Id - - - 75 - Maximum allowed characters in matter name - - - 128 - Length of the content type - - - 105 - Incorrect input code for Area Of Law - - - Incorrect Inputs - Incorrect input message for Area Of Law - - - 118 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 102 - Incorrect input code for client id - - - Incorrect Inputs - Incorrect input message for client id - - - 103 - Incorrect input code for client name - - - Incorrect Inputs - Incorrect input message for client name - - - 101 - Incorrect input code for client URL - - - Incorrect Inputs - Incorrect input message for client URL - - - 117 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 114 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 115 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 112 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 113 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - 109 - Incorrect input code for Matter Id - - - Incorrect Inputs - Incorrect input message for Matter Id - - - 108 - Incorrect input code for Matter Name - - - Incorrect Inputs - Incorrect input message for Matter Name - - - 104 - Incorrect input code for Practice Group - - - Incorrect Inputs - Incorrect input message for Practice Group - - - 100 - Incorrect input code for request object - - - Incorrect Inputs - Incorrect input message for request object - - - 107 - Incorrect input code for Responsible Attorney - - - Incorrect Inputs - Incorrect input message for Responsible Attorney - - - 106 - Incorrect input code for Sub Area Of Law - - - Incorrect Inputs - Incorrect input message for Sub Area Of Law - - - 110 - Incorrect input code for user names - - - Incorrect Inputs - Incorrect input message for user names - - - 111 - Incorrect input code for assign user names - - - Incorrect Inputs - Incorrect input message for user permissions - - - 116 - Incorrect input code for assign Content Type - - - Incorrect Inputs - Incorrect input message for Content Type - - - IsReadOnlyUser - Key name of the flag used to determine whether the current logged in user is a read only user. This is appended in the JSON object returned from the Keyword Search - - - 120 - Incorrect input code for Save Search Name - - - Incorrect Inputs - Incorrect input message for Save Search Name - - - 123 - Incorrect input code for current search name - - - Incorrect Inputs - Incorrect input message for current search name - - - 122 - Incorrect input code for existing search name - - - Incorrect Inputs - Incorrect input message for existing search name - - - Success - Name of the stamped property to store Success value true for successfully created matter - - - Matter is deleted successfully - - - <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><span style="font-weight: 600;">Matter Information:</span><div style="margin-left: 15px;"><div>Client Name: {0}</div><div>Client ID: {1}</div><div>Matter Name: {2}</div><div>Matter ID: {3}</div><div>Matter Description: {4}</div><div style="margin-bottom: 10px">Matter Type: {5}</div></div></div> - Body of the Matter information for Matter creation mail - - - <span style='font-weight: 600;'>{0}</span> - HTML chunk of the Default content type for Matter creation mail - - - -900000001 - Error code when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - - - The selected Content Type is not present in the collection - Message when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - - - -900000002 - Error code when there is an issue while creating matter landing page - - - An error occurred while creating matter landing page - Message when there is an issue while creating matter landing page - - - Matter library not found while deleting - Message when document library is not found while trying to delete - - - True - Create a new calendar for each matter if value is true - - - _Calendar - Suffix for Calendar name - - - Lists/ - Title for Lists Path - - - Type;DMS_Mail_Importance;DMS_From;DMS_Subject;ReceivedDate;DMS_To;DMS_Cc;DMS_From_MailBox;Sensitivity;EmailCategories;ConversationId;ConversationTopic;HasAttachments;SentDate;LinkFilename;OriginalName - List of columns to be included in the Outlook View - - - Outlook View - Name of the custom view - - - ReceivedDate - Column to set default OrderBy for Outlook View - - - <OrderBy><FieldRef Name='{0}' Ascending='False' /></OrderBy> - Column to set OrderBy for Outlook View - - - 500 - Maximum allowed results for user search - - - 30 - Maximum records to show on the people picker control - - - false - Allow multiple users to be searched at once - - - No results found - Message if people picker control do not return any data - - - -900000003 - Error code when there is an issue while assigning permissions to calendar - - - An error occurred while assigning permissions to calendar list - Message when there is an issue while assigning permissions to the calendar - - - -900000004 - Error code when there is an issue while creating calendar list - - - An error occurred while creating calendar list - Message when there is an issue while creating calendar list - - - -900000005 - Error code when there exists a matter landing page - - - _OneNote - Suffix for OneNote Library Name - - - Site Pages - Represents the library name holding the matter landing pages for the site collection - - - MatterCenterHelpLinks - Name of the list where contextual help links details for each page are stored - - - MatterCenterHelpSection - Name of the list where contextual help section details for each page are stored - - - <GetListItems><Query><Where>{0}</Where></Query><ViewFields><FieldRef Name='SectionID' /><FieldRef Name='LinkTitle0' /><FieldRef Name='LinkURL' /><FieldRef Name='LinkOrder' /></ViewFields><QueryOptions /></GetListItems> - Query to be used for retrieving contextual help links - - - <GetListItems><Query><Where><Eq><FieldRef Name='PageName' /><Value Type='Choice'>{0}</Value></Eq></Where></Query><ViewFields><FieldRef Name='SectionID' /><FieldRef Name='SectionTitle' /><FieldRef Name='PageName' /><FieldRef Name='NumberOfColumns' /><FieldRef Name='SectionOrder' /></ViewFields><QueryOptions /></GetListItems> - Query to be used for retrieving contextual help sections - - - MatterConflictCheckBy - Name of the stamped property to store Matter conflict check by - - - MatterConflictCheckDate - Name of the stamped property to store Matter conflict check date - - - MatterDescription - Name of the stamped property to store Matter description - - - SPWebUrl - Name of managed property to retrieve the web URL of document - - - MatterCenterPermissions - Name of the stamped property to store permission - - - MatterCenterRoles - Name of the stamped property to store roles - - - MatterCenterUsers - Name of the stamped property to store users - - - MatterCenterDefaultContentType - Name of the stamped property to store default content type - - - DocumentTemplateCount - Name of the stamped property to store document template count - - - IsConflictIdentified - Name of the stamped property to store conflict identified flag - - - AppLandingPage;SearchMatter;SearchDocument;WebDashboard;ProvisionMatter - ';' separated list of page names to be used in contextual help functionality - - - <Eq><FieldRef Name='{0}' /><Value Type='Lookup'>{1}</Value></Eq>;<Or>{0}</Or> - ';' separated list to build OR part of CAMLquery to support include sections (link) - - - BlockedUsers - Name of the stamped property to store blocked users - - - LinkOrder - Name of the column storing Link Order - - - LinkTitle0 - Name of the column storing Link Title - - - LinkURL - Name of the column storing Link URL - - - SectionID - Name of the column storing Section ID - - - NumberOfColumns - Name of the column storing Number of Columns - - - PageName - Name of the column storing Page Name - - - SectionID - Name of the column storing Section ID - - - SectionOrder - Name of the column storing Section Order - - - SectionTitle - Name of the column storing Section Title - - - 124 - Incorrect input code for self permission removal - - - MCCheckoutUser - Name of managed property to retrieve checked out user of document - - - MCVersionNumber - Name of managed property to retrieve version of document - - - 125 - Incorrect input code for security group existence in team members - - - Security Groups are not allowed for matters where conflicts are identified. Remove all Security Groups to proceed. - Error message when security group exists in team members list - - - 126 - Code for invalid team members - - - Please enter valid team members. - Message for invalid team members - - - Matter Configurations - Name of the list where the configurations will be stored for the client - - - ConfigurationValue - Name of the property name column in matter configurations list - - - {0} Owners - Name of owner group of the site collection - - - <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><div style="font-weight: 600;">Conflict Check:</div><div style="margin-left: 15px;"><div>Conducted: {0}</div><div>Conducted by: {1}</div><div>Date: {2}</div><div>Conflict Identified: {3}</div></div></div> - Body of the Conflict Check for Matter creation mail - - - <div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;"><div style="margin-left: 15px;"><div>Is Matter secured only to the assigned team: {0}</div></div><div style="font-weight: 600;margin-top: 10px;">Team Members: </div><div style="margin-left: 15px;">{1}{2}</div></div><div style="font-family: 'Calibri'; font-size: 16px; font-style:italic; color: #505050;margin-top: 10px;">You can now access OneNote <span><a href='{3}/_layouts/WopiFrame.aspx?sourcedoc={4}.onetoc2'>{5}</a></span> and Site <span><a href='{6}'>{7}</a></span> of this Matter.</div> - Body of the Team Members for Matter creation mail - - - true - Content check flag default value - - - Matter Configurations - Configuration list title column value - - - <View><Query><Where><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq></Where></Query><ViewFields><FieldRef Name='Modified'/><FieldRef Name='ConfigurationValue'/></ViewFields></View> - Matter configurations list query - - - 127 - Incorrect input code for user access in Provision Matter Group - - - Incorrect Inputs - Incorrect input message for user access in Provision Matter Group - - - Conflicted User - Body of the Matter information for blocked users - - - MatterCenter - This is used to give temporary email name while the email is being created - - - Documents - Name of the document library of user's OneDrive - - - 128 - Code for users not present in site owner group - - - You do not have permission to create matter for this client - Message for users not present in site owner group - - - NA - Message to show when Responsible Attorney not found - - - [Enter Result source ID which retrieves results from Matter Center specific site collection only, e.g. 334fbf-40a4aa-ba-d34e-4274ca46553ada] - Result source ID which retrieves results from Matter Center specific site collection only - - - MCModifiedDate - Name of managed property to retrieve MCModifiedDate - - - _Task - Suffix for the task list to be created while creating matter landing page - - - taskPane,calendarPane,matterCenterFooter,matterInfo,matterCenterHeader,rssPane,oneNotePane - Div id's for various sections on Matter Landing page - - - -900000006 - Error code when there is an issue while creating task list - - - An error occurred while creating task list - Error message displayed when task list is not created - - - An error occurred while assigning permission to task list - Error message displayed when assigning permission fails - - - /sites/catalog/SiteAssets/{0}/Styles/spCommon.css - Common style sheet location - - - Matter Center Assets/Common Assets - Common assets folder location - - - /sites/catalog/SiteAssets/{0}/Scripts/spCommon.js - Common script location - - - -900000009 - Error code when there is an issue while assigning default content type while sending documents to OneDrive - - - -900000007 - Error code when there is an issue while creating site column while sending documents to OneDrive - - - -900000008 - Error code when there is an issue while creating site content type while sending documents to OneDrive - - - An error occurred while assigning default content type to library while sending documents to OneDrive - Message when there is an issue while assigning default content type while sending documents to OneDrive - - - An error occurred while creating site column while sending documents to OneDrive - Message when there is an issue while creating site column while sending documents to OneDrive - - - An error occurred while creating site content type while sending documents to OneDrive - Message when there is an issue while creating site content type while sending documents to OneDrive - - - -900000010 - Error code if OneDrive is not configured for user - - - Person.aspx - URL returned if OneDrive is not set for user - - - AreaOfLaw - Name of the column for Area of Law in base DMS content type - - - PracticeGroup - Name of the column for Practice Group in base DMS content type - - - SubareaOfLaw - Name of the column for Subarea of Law in base DMS content type - - - {0} library for this Matter is already created. Kindly delete the library or please enter a different Matter name. - Validation message to check if user has entered a matter name which is already present in the client site collection - - - Landing page of this Matter is already created. Kindly delete existing landing page or please enter a different Matter name. - Validation message to check if Matter landing page is already present in the client site collection - - - MatterGUID - Name of the stamped property to store matter GUID - - - MMM dd, yyyy - Date format used for displaying dates in Matter Center app - - - MatterCenterMatterGUID - Name of managed property to retrieve Matter GUID - - - Modified - SharePoint's internal field storing modified date of each item - - - 0 - Code which is send to UI in case of delete matter functionality - - - 202 - Code which is send to UI in case matter landing page already exists - - - 201 - Code which is send to UI in case matter library already exists - - - Please provide at least one user who has Full Control permission on this matter. - Validation message to ask user to select full control permission level for at least one user - - - {0} ) {1} : <a href=" {2}" >{2} </a><br /> - HTML format for send as email functionality - - - <div style='font-family:Calibri;font-size:12pt'>{0}</div> - CSS style for send as email body - - - ^[\s]*\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*[\s]*$ - Regex pattern to validate email address - - - ResponsibleAttorneyEmail - Name of the stamped property to store Responsible Attorney Email - - - MatterCenterUserEmails - Name of the stamped property to store user emails - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/SearchConstants.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/SearchConstants.cs deleted file mode 100644 index 6d94009c..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/SearchConstants.cs +++ /dev/null @@ -1,217 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-rijadh -// Created : 11-28-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains search constants for managed search properties. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - #endregion - - internal static class SearchConstants - { - - /// - /// The managed property responsible attorney - /// - internal static readonly string ManagedPropertyResponsibleAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Responsible_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property team members - /// - internal static readonly string ManagedPropertyTeamMembers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property site name - /// - internal static readonly string ManagedPropertySiteName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Site_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property custom title - /// - internal static readonly string ManagedPropertyCustomTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Custom_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property is matter - /// - internal static readonly string ManagedPropertyIsMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Is_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property title - /// - internal static string ManagedPropertyTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property name - /// - internal static string ManagedPropertyName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property description - /// - internal static readonly string ManagedPropertyDescription = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Description", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property last modified time - /// - internal static readonly string ManagedPropertyLastModifiedTime = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Last_Modified_Time", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property last modified time for documents - /// - internal static readonly string ManagedPropertyDocumentLastModifiedTime = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Last_Modified_Time", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property practice group - /// - internal static readonly string ManagedPropertyPracticeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Practice_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property area of law - /// - internal static readonly string ManagedPropertyAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property sub area of law - /// - internal static readonly string ManagedPropertySubAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Sub_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property matter identifier - /// - internal static readonly string ManagedPropertyMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property path - /// - internal static readonly string ManagedPropertyPath = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Path", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property matter name - /// - internal static readonly string ManagedPropertyMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property open date - /// - internal static readonly string ManagedPropertyOpenDate = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Open_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property client name - /// - internal static readonly string ManagedPropertyClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property author - /// - internal static readonly string ManagedPropertyAuthor = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Author", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property author - /// - internal static readonly string ManagedPropertyFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property is document - /// - internal static readonly string ManagedPropertyIsDocument = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Is_Document", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property server relative URL - /// - internal static readonly string ManagedPropertyServerRelativeUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Server_Relative_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property file extension - /// - internal static readonly string ManagedPropertyFileExtension = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_File_Extension", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property created - /// - internal static readonly string ManagedPropertyCreated = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Created", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property UI version string OWSTEXT - /// - internal static readonly string ManagedPropertyUIVersionStringOWSTEXT = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_UI_Version_String_OWSTEXT", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property site title - /// - internal static readonly string ManagedPropertySiteTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Site_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document client identifier - /// - internal static readonly string ManagedPropertyDocumentClientId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document client name - /// - internal static readonly string ManagedPropertyDocumentClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document matter identifier - /// - internal static readonly string ManagedPropertyDocumentMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document matter name - /// - internal static readonly string ManagedPropertyDocumentMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document identifier - /// - internal static readonly string ManagedPropertyDocumentId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property checked out by user - /// - internal static readonly string ManagedPropertyCheckOutByUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_CheckOut_By_User", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property blocked upload users - /// - internal static readonly string ManagedPropertyBlockedUploadUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Blocked_Upload_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The manage property Client ID - /// - internal static readonly string ManagedPropertyClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Represents the SPWebUrl managed property associated with the document - /// - internal static readonly string ManagedPropertySPWebUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_SPWeb_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the managed property for retrieving version of the document - /// - internal static readonly string ManagedPropertyDocumentVersion = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Version", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the managed property for retrieving checked out user of the document - /// - internal static readonly string ManagedPropertyDocumentCheckOutUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_CheckOutUser", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the managed property for retrieving GUID of matter - /// - internal static readonly string ManagedPropertyMatterGuid = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_GUID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the search result source ID - /// - internal static readonly string SearchResultSourceID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Search_Result_Source_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/ServiceConstantStrings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/ServiceConstantStrings.cs deleted file mode 100644 index bb0a3907..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/ServiceConstantStrings.cs +++ /dev/null @@ -1,2835 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-nikhid -// Created : 11-28-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file is being used as an adapter between constant resource and service. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Globalization; - #endregion - - /// - /// Provides constants used in Matter Center. - /// - internal static class ServiceConstantStrings - { - /// - /// Accessing from resource file for service - /// - private static string practiceGroupTermSetName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Practice_Group_Term_Set_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The client term set name - /// - private static string clientTermSetName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Client_Term_Set_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The log table name - /// - private static string logTableName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "LogTableName", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS role list name - /// - private static string dmsRoleListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Role_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS role query - /// - private static string dmsRoleQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Role_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name unique identifier - /// - private static string columnNameGuid = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_Guid", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The role list column role name - /// - private static string roleListColumnRoleName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Role_List_Column_Role_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The role list column is role mandatory - /// - private static string roleListColumnIsRoleMandatory = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Role_List_Column_Is_Role_Mandatory", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name modified date - /// - private static string columnNameModifiedDate = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_Modified", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The central repository URL - /// - private static string centralRepositoryUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Central_Repository_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS matter list name - /// - private static string dmsMatterListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Matter_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column matter path - /// - private static string shareListColumnMatterPath = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Matter_Path", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - private static string shareListColumnMailList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_List", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property practice group - /// - private static string stampedPropertyPracticeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Practice_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property area of law - /// - private static string stampedPropertyAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property sub area of law - /// - private static string stampedPropertySubAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Sub_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property matter name - /// - private static string stampedPropertyMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property matter identifier - /// - private static string stampedPropertyMatterID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property client name - /// - private static string stampedPropertyClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property client identifier - /// - private static string stampedPropertyClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Client_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property responsible attorney - /// - private static string stampedPropertyResponsibleAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Responsible_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property responsible attorney - /// - private static string stampedPropertyResponsibleAttorneyEmail = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Responsible_Attorney_Email", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property team members - /// - private static string stampedPropertyTeamMembers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property is matter - /// - private static string stampedPropertyIsMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Is_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property open date - /// - private static string stampedPropertyOpenDate = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Open_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property secure matter - /// - private static string stampedPropertySecureMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Secure_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Stamped Property Success - /// - private static string stampedPropertySuccess = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Success", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column client identifier - /// - private static string contentTypeColumnClientId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column client name - /// - private static string contentTypeColumnClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column matter identifier - /// - private static string contentTypeColumnMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column matter name - /// - private static string contentTypeColumnMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column practice group - /// - private static string contentTypeColumnPracticeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Practice_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column area of law - /// - private static string contentTypeColumnAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column sub area of law - /// - private static string contentTypeColumnSubareaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Subarea_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column title - /// - private static string mattersListColumnTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column client name - /// - private static string mattersListColumnClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column client identifier - /// - private static string mattersListColumnClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Client_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column matter name - /// - private static string mattersListColumnMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column matter identifier - /// - private static string mattersListColumnMatterID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Matter_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict check by - /// - private static string mattersListColumnConflictCheckBy = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Check_By", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict check on - /// - private static string mattersListColumnConflictCheckOn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Check_On", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict identified - /// - private static string mattersListColumnConflictIdentified = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Identified", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column block users - /// - private static string mattersListColumnBlockUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Block_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column managing attorney - /// - private static string mattersListColumnManagingAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Managing_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column support - /// - private static string mattersListColumnSupport = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Support", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The all folders query - /// - private static string allFoldersQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "All_Folders_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned matter list name - /// - private static string userPinnedMatterListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Matter_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column matter details - /// - private static string pinnedListColumnMatterDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_Matter_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned details query - /// - private static string userPinnedDetailsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Details_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column user alias - /// - private static string pinnedListColumnUserAlias = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_User_Alias", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned document list name - /// - private static string userPinnedDocumentListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Document_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column document details - /// - private static string pinnedListColumnDocumentDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_Document_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file leaf reference - /// - private static string columnNameFileLeafRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Leaf_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file reference - /// - private static string columnNameFileRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file DIR reference - /// - private static string columnNameFileDirRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Dir_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The property name VTI indexed property keys - /// - private static string propertyNameVtiIndexedPropertyKeys = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Property_Name_Vti_Indexed_Property_Keys", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area custom property folder names - /// - private static string subAreaCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area custom property is no folder structure present - /// - private static string subAreaCustomPropertyisNoFolderStructurePresent = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_CustomProperty_isNoFolderStructurePresent", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The area custom property folder names - /// - private static string areaCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Area_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The practice group custom property folder names - /// - private static string practiceGroupCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Practice_Group_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area of law document templates - /// - private static string subAreaOfLawDocumentTemplates = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_Of_Law_Document_Templates", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The hidden content type - /// - private static string hiddenContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Hidden_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property blocked upload users - /// - private static string stampedPropertyBlockedUploadUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Blocked_Upload_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The find document valid extensions - /// - private static string findDocumentInvalidExtensions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Find_Document_Invalid_Extensions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The valid date format - /// - private static string validDateFormat = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Valid_Date_Format", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Suffix to be appended in calendar name - /// - private static string calendarNameSuffix = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Calendar_Name_Suffix", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Title for Lists Path - /// - private static string titleListsPath = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Title_Lists_Path", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Suffix to be appended in task list name - /// - private static string taskNameSuffix = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Task_Name_Suffix", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter name length - /// - private static string matterNameLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Name_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Id length - /// - private static string matterIdLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Id_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter description length - /// - private static string matterDescriptionLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Description_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Content Type length - /// - private static string contentTypeLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Matter Center help section list name - /// - private static string matterCenterHelpSectionListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Help_Section_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Matter Center help links list name - /// - private static string matterCenterHelpLinksListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Help_Links_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link Title - /// - private static string contextualHelpLinksColumnLinkTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkTitle", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link URL - /// - private static string contextualHelpLinksColumnLinkURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkURL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link Order - /// - private static string contextualHelpLinksColumnLinkOrder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkOrder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section ID - /// - private static string contextualHelpLinksColumnSectionID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_SectionID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section ID - /// - private static string contextualHelpSectionColumnSectionID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section Title - /// - private static string contextualHelpSectionColumnSectionTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionTitle", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Page Name - /// - private static string contextualHelpSectionColumnPageName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_PageName", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section Order - /// - private static string contextualHelpSectionColumnSectionOrder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionOrder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Number of Columns - /// - private static string contextualHelpSectionColumnNumberOfColumns = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_NumberOfColumns", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query to be used for retrieving contextual help sections - /// - private static string retrieveContextualHelpSectionsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Retrieve_Contextual_Help_Sections_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query to be used for retrieving contextual help links - /// - private static string retrieveContextualHelpLinksQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Retrieve_Contextual_Help_Links_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ';' separated list of page names to be used in contextual help functionality - /// - private static string matterCenterPages = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Pages", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ';' separated list to build OR part of CAMLquery to support include sections (link) - /// - private static string contextualHelpQueryIncludeOrCondition = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Query_Include_Or_Condition", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail SOAP request - /// - private static string mailSoapRequest = - @" - - - - - - - - Default - true - - - - - - - - - - - "; - - /// - /// The attachment SOAP request - /// - private static string attachmentSoapRequest = - @" - - - - - - - - true - - - - - - - - - - - "; - - - /// - /// The invalid char regex - /// - private static string invalidCharRegex = @"[\*\?\|\\\t/:""'<>#{}%~&]"; - - /// - /// The start end regex - /// - private static string startEndregex = @"^[\. ]|[\. ]$"; - - /// - /// The invalid rule regex - /// - private static string invalidRuleRegex = @"\.{2,}"; - - /// - /// The extra space regex - /// - private static string extraSpaceRegex = " {2,}"; - - /// - /// The invalid file name regex - /// - private static string invalidFileNameRegex = "_fajlovi|.files|-Dateien|_fichiers|_bestanden|_file|_archivos|-filer|_tiedostot|_pliki|_soubory|_elemei|_ficheiros|_arquivos|_dosyalar|_datoteke|_fitxers|_failid|_fails|_bylos|_fajlovi|_fitxategiak$"; - - /// - /// The is tenant deployment - /// - private static bool isTenantDeployment = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsTenantDeployment", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is major version enable - /// - private static bool isMajorVersionEnable = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsMajorVersionEnable", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is minor version enable - /// - private static bool isMinorVersionEnable = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsMinorVersionEnable", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is force check out - /// - private static bool isForceCheckOut = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsForceCheckOut", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// This indicates whether to create calendar or not - /// - private static bool isCreateCalendarEnabled = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsCreateCalendarEnabled", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The brief case items query - /// - private static string briefCaseItemsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Briefcase_Items_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The get item by name query - /// - private static string getItemByNameQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Item_By_Name_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The briefcase folder query - /// - private static string briefcaseFolderQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Legal_Briefcase_Folder_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The briefcase folder contents query - /// - private static string briefcaseFolderContentsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Legal_Briefcase_Folder_Contents", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The legal briefcase folder - /// - private static string legalBriefcaseFolder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Legal_Briefcase_Folder_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive content type name - /// - private static string oneDriveContentTypeName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The already check out - /// - private static string alreadyCheckOut = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Already_Check_Out_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The send to matter query - /// - private static string sendToMatterQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Send_To_Matter_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user My site not present - /// - private static string userMySiteNotPresent = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_My_Site_Not_Present", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The URL is user My site not present - /// - private static string oneDriveNotSetupUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "OneDriveNotSetupUrl", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive parent content type - /// - private static string oneDriveParentContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Parent_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column schema - /// - private static string oneDriveSiteColumnSchema = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column_Schema", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive content type group - /// - private static string oneDriveContentTypeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Content_Type_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column - /// - private static string oneDriveSiteColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column type - /// - private static string oneDriveSiteColumnType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The exchange service URL - /// - private static string exchangeServiceURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Exchange_Service_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user Permissions on create matter library - /// - private static string userPermissions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Permissions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// jQuery file name - /// - private static string jqueryFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_jQuery_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page JS file name - /// - private static string matterLandingJSFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Script_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page CSS file name - /// - private static string matterLandingCSSFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_CSS_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page folder name on SharePoint - /// - private static string matterLandingFolderName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Folder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Common files folder name on SharePoint - /// - private static string commonFolderName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Common_Folder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Common js file on SharePoint - /// - private static string commonJSFileLink = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Common_JS_File_Location", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Common css file on SharePoint - /// - private static string commonCSSFileLink = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Common_CSS_File_Location", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the number of search results (users) to pull from people picker service based on the search term. This will return email enabled users as well as non-email enabled users. - /// - private static string peoplePickerMaximumEntitySuggestions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Max_Entity_Suggestions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the number of records to pull which has email property from client picker service results. - /// - private static string peoplePickerMaxRecords = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Max_Records", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the flag to allow multiple users to be searched using people picker service. - /// - private static string peoplePickerAllowMultipleEntities = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Allow_Multiple_Entities", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The temp email name - /// - private static string tempEmailName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Temp_Email_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect input code for user access in Provision Matter Group - /// - private static string incorrectInputUserAccessCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Access_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect input code for user access in Provision Matter Group - /// - private static string incorrectInputUserAccessMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Access_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// User's OneDrive document library title - /// - private static string oneDriveDocumentLibraryTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Document_Library_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Date format for dates displayed in Matter Center app - /// - private static string matterCenterDateFormat = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Date_Format", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ENUM operationTypes - /// - internal enum OperationTypes - { - /// - /// The current - /// - Current, - - /// - /// The update - /// - Update, - - /// - /// The checkout - /// - Checkout, - - /// - /// The detach - /// - Detach, - - /// - /// The check in - /// - CheckIn - } - - /// - /// Gets the name of the practice group term set. - /// - /// The name of the practice group term set. - internal static string PracticeGroupTermSetName - { - get - { - return practiceGroupTermSetName; - } - } - - /// - /// Gets the name of the client term set. - /// - /// The name of the client term set. - internal static string ClientTermSetName - { - get - { - return clientTermSetName; - } - } - - /// - /// Gets the name of the log table. - /// - /// The name of the log table. - internal static string LogTableName - { - get - { - return logTableName; - } - } - - /// - /// Gets the name of the DMS role list. - /// - /// The name of the DMS role list. - internal static string DMSRoleListName - { - get - { - return dmsRoleListName; - } - } - - /// - /// Gets the DMS role query. - /// - /// The DMS role query. - internal static string DMSRoleQuery - { - get - { - return dmsRoleQuery; - } - } - - /// - /// Gets the column name unique identifier. - /// - /// The column name unique identifier. - internal static string ColumnNameGuid - { - get - { - return columnNameGuid; - } - } - - /// - /// Gets the name of the role list column role. - /// - /// The name of the role list column role. - internal static string RoleListColumnRoleName - { - get - { - return roleListColumnRoleName; - } - } - - /// - /// Gets the role list column is role mandatory. - /// - /// The role list column is role mandatory. - internal static string RoleListColumnIsRoleMandatory - { - get - { - return roleListColumnIsRoleMandatory; - } - } - - /// - /// Gets the central repository URL. - /// - /// The central repository URL. - internal static string CentralRepositoryUrl - { - get - { - return centralRepositoryUrl; - } - } - - /// - /// Gets the name of the DMS matter list. - /// - /// The name of the DMS matter list. - internal static string DMSMatterListName - { - get - { - return dmsMatterListName; - } - } - - /// - /// Gets the share list column matter path. - /// - /// The share list column matter path. - internal static string ShareListColumnMatterPath - { - get - { - return shareListColumnMatterPath; - } - } - - /// - /// Gets the stamped property practice group. - /// - /// The stamped property practice group. - internal static string StampedPropertyPracticeGroup - { - get - { - return stampedPropertyPracticeGroup; - } - } - - /// - /// Gets the stamped property area of law. - /// - /// The stamped property area of law. - internal static string StampedPropertyAreaOfLaw - { - get - { - return stampedPropertyAreaOfLaw; - } - } - - /// - /// Gets the stamped property sub area of law. - /// - /// The stamped property sub area of law. - internal static string StampedPropertySubAreaOfLaw - { - get - { - return stampedPropertySubAreaOfLaw; - } - } - - /// - /// Gets the name of the stamped property matter. - /// - /// The name of the stamped property matter. - internal static string StampedPropertyMatterName - { - get - { - return stampedPropertyMatterName; - } - } - - /// - /// Gets the stamped property matter identifier. - /// - /// The stamped property matter identifier. - internal static string StampedPropertyMatterID - { - get - { - return stampedPropertyMatterID; - } - } - - /// - /// Gets the name of the stamped property client. - /// - /// The name of the stamped property client. - internal static string StampedPropertyClientName - { - get - { - return stampedPropertyClientName; - } - } - - /// - /// Gets the stamped property client identifier. - /// - /// The stamped property client identifier. - internal static string StampedPropertyClientID - { - get - { - return stampedPropertyClientID; - } - } - - /// - /// Gets the stamped property responsible attorney. - /// - /// The stamped property responsible attorney. - internal static string StampedPropertyResponsibleAttorney - { - get - { - return stampedPropertyResponsibleAttorney; - } - } - - /// - /// Gets the stamped property responsible attorney email. - /// - /// The stamped property responsible attorney email. - internal static string StampedPropertyResponsibleAttorneyEmail - { - get - { - return stampedPropertyResponsibleAttorneyEmail; - } - } - - /// - /// Gets the stamped property team members. - /// - /// The stamped property team members. - internal static string StampedPropertyTeamMembers - { - get - { - return stampedPropertyTeamMembers; - } - } - - /// - /// Gets the stamped property is matter. - /// - /// The stamped property is matter. - internal static string StampedPropertyIsMatter - { - get - { - return stampedPropertyIsMatter; - } - } - - /// - /// Gets the stamped property open date. - /// - /// The stamped property open date. - internal static string StampedPropertyOpenDate - { - get - { - return stampedPropertyOpenDate; - } - } - - /// - /// Gets the item property modified date. - /// - /// The item property modified date. - internal static string ColumnNameModifiedDate - { - get - { - return columnNameModifiedDate; - } - } - - /// - /// Gets the stamped property secure matter. - /// - /// The stamped property secure matter. - internal static string StampedPropertySecureMatter - { - get - { - return stampedPropertySecureMatter; - } - } - - /// - /// Gets the stamped property success - /// - /// The stamped property success - internal static string StampedPropertySuccess - { - get - { - return stampedPropertySuccess; - } - } - - /// - /// Gets the content type column client identifier. - /// - /// The content type column client identifier. - internal static string ContentTypeColumnClientId - { - get - { - return contentTypeColumnClientId; - } - } - - /// - /// Gets the name of the content type column client. - /// - /// The name of the content type column client. - internal static string ContentTypeColumnClientName - { - get - { - return contentTypeColumnClientName; - } - } - - /// - /// Gets the content type column matter identifier. - /// - /// The content type column matter identifier. - internal static string ContentTypeColumnMatterId - { - get - { - return contentTypeColumnMatterId; - } - } - - /// - /// Gets the name of the content type column matter. - /// - /// The name of the content type column matter. - internal static string ContentTypeColumnMatterName - { - get - { - return contentTypeColumnMatterName; - } - } - - /// - /// Gets the name of the content type column matter. - /// - /// The name of the content type column matter. - internal static string ContentTypeColumnPracticeGroup - { - get - { - return contentTypeColumnPracticeGroup; - } - } - - /// - /// Gets the name of the content type column matter. - /// - /// The name of the content type column matter. - internal static string ContentTypeColumnAreaOfLaw - { - get - { - return contentTypeColumnAreaOfLaw; - } - } - - /// - /// Gets the name of the content type column matter. - /// - /// The name of the content type column matter. - internal static string ContentTypeColumnSubareaOfLaw - { - get - { - return contentTypeColumnSubareaOfLaw; - } - } - - /// - /// Gets the matters list column title. - /// - /// The matters list column title. - internal static string MattersListColumnTitle - { - get - { - return mattersListColumnTitle; - } - } - - /// - /// Gets the name of the matters list column client. - /// - /// The name of the matters list column client. - internal static string MattersListColumnClientName - { - get - { - return mattersListColumnClientName; - } - } - - /// - /// Gets the matters list column client identifier. - /// - /// The matters list column client identifier. - internal static string MattersListColumnClientID - { - get - { - return mattersListColumnClientID; - } - } - - /// - /// Gets the name of the matters list column matter. - /// - /// The name of the matters list column matter. - internal static string MattersListColumnMatterName - { - get - { - return mattersListColumnMatterName; - } - } - - /// - /// Gets the matters list column matter identifier. - /// - /// The matters list column matter identifier. - internal static string MattersListColumnMatterID - { - get - { - return mattersListColumnMatterID; - } - } - - /// - /// Gets the matters list column conflict check by. - /// - /// The matters list column conflict check by. - internal static string MattersListColumnConflictCheckBy - { - get - { - return mattersListColumnConflictCheckBy; - } - } - - /// - /// Gets the matters list column conflict check on. - /// - /// The matters list column conflict check on. - internal static string MattersListColumnConflictCheckOn - { - get - { - return mattersListColumnConflictCheckOn; - } - } - - /// - /// Gets the matters list column conflict identified. - /// - /// The matters list column conflict identified. - internal static string MattersListColumnConflictIdentified - { - get - { - return mattersListColumnConflictIdentified; - } - } - - /// - /// Gets the matters list column block users. - /// - /// The matters list column block users. - internal static string MattersListColumnBlockUsers - { - get - { - return mattersListColumnBlockUsers; - } - } - - /// - /// Gets the matters list column managing attorney. - /// - /// The matters list column managing attorney. - internal static string MattersListColumnManagingAttorney - { - get - { - return mattersListColumnManagingAttorney; - } - } - - /// - /// Gets the matters list column support. - /// - /// The matters list column support. - internal static string MattersListColumnSupport - { - get - { - return mattersListColumnSupport; - } - } - - /// - /// Gets all folders query. - /// - /// All folders query. - internal static string AllFoldersQuery - { - get - { - return allFoldersQuery; - } - } - - /// - /// Gets the name of the user pinned matter list. - /// - /// The name of the user pinned matter list. - internal static string UserPinnedMatterListName - { - get - { - return userPinnedMatterListName; - } - } - - /// - /// Gets the pinned list column matter details. - /// - /// The pinned list column matter details. - internal static string PinnedListColumnMatterDetails - { - get - { - return pinnedListColumnMatterDetails; - } - } - - /// - /// Gets the user pinned details query. - /// - /// The user pinned details query. - internal static string UserPinnedDetailsQuery - { - get - { - return userPinnedDetailsQuery; - } - } - - /// - /// Gets the pinned list column user alias. - /// - /// The pinned list column user alias. - internal static string PinnedListColumnUserAlias - { - get - { - return pinnedListColumnUserAlias; - } - } - - /// - /// Gets the name of the user pinned document list. - /// - /// The name of the user pinned document list. - internal static string UserPinnedDocumentListName - { - get - { - return userPinnedDocumentListName; - } - } - - /// - /// Gets the pinned list column document details. - /// - /// The pinned list column document details. - internal static string PinnedListColumnDocumentDetails - { - get - { - return pinnedListColumnDocumentDetails; - } - } - - /// - /// Gets the column name file leaf reference. - /// - /// The column name file leaf reference. - internal static string ColumnNameFileLeafRef - { - get - { - return columnNameFileLeafRef; - } - } - - /// - /// Gets the column name file reference. - /// - /// The column name file reference. - internal static string ColumnNameFileRef - { - get - { - return columnNameFileRef; - } - } - - /// - /// Gets the column name file directory reference. - /// - /// The column name file directory reference. - internal static string ColumnNameFileDirRef - { - get - { - return columnNameFileDirRef; - } - } - - /// - /// Gets the property name VTI indexed property keys. - /// - /// The property name VTI indexed property keys. - internal static string PropertyNameVtiIndexedPropertyKeys - { - get - { - return propertyNameVtiIndexedPropertyKeys; - } - } - - /// - /// Gets the sub area custom property folder names. - /// - /// The sub area custom property folder names. - internal static string SubAreaCustomPropertyFolderNames - { - get - { - return subAreaCustomPropertyFolderNames; - } - } - - /// - /// Gets the sub area custom property is no folder structure present. - /// - /// The sub area custom property is no folder structure present. - internal static string SubAreaCustomPropertyisNoFolderStructurePresent - { - get - { - return subAreaCustomPropertyisNoFolderStructurePresent; - } - } - - /// - /// Gets the area custom property folder names. - /// - /// The area custom property folder names. - internal static string AreaCustomPropertyFolderNames - { - get - { - return areaCustomPropertyFolderNames; - } - } - - /// - /// Gets the practice group custom property folder names. - /// - /// The practice group custom property folder names. - internal static string PracticeGroupCustomPropertyFolderNames - { - get - { - return practiceGroupCustomPropertyFolderNames; - } - } - - /// - /// Gets the sub area of law document templates. - /// - /// The sub area of law document templates. - internal static string SubAreaOfLawDocumentTemplates - { - get - { - return subAreaOfLawDocumentTemplates; - } - } - - /// - /// Gets the type of the hidden content. - /// - /// The type of the hidden content. - internal static string HiddenContentType - { - get - { - return hiddenContentType; - } - } - - /// - /// Gets the stamped property blocked upload users. - /// - /// The stamped property blocked upload users. - internal static string StampedPropertyBlockedUploadUsers - { - get - { - return stampedPropertyBlockedUploadUsers; - } - } - - /// - /// Gets the stamped property matter description - /// - /// The stamped property matter description. - internal static string StampedPropertyMatterDescription - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_Description", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict check date - /// - /// The stamped property of matter conflict check date. - internal static string StampedPropertyConflictCheckDate - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Conflict_Check_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict check by - /// - /// The stamped property of matter conflict check by. - internal static string StampedPropertyConflictCheckBy - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Conflict_Check_By", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter users - /// - /// The stamped property of matter users. - internal static string StampedPropertyMatterCenterUsers - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter center user emails - /// - /// The stamped property of matter center users emails. - internal static string StampedPropertyMatterCenterUserEmails - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_User_Emails", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter roles - /// - /// The stamped property of matter roles. - internal static string StampedPropertyMatterCenterRoles - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Roles", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter Permissions - /// - /// The stamped property of matter roles. - internal static string StampedPropertyMatterCenterPermissions - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Permissions", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter default content type - /// - /// The stamped property of matter roles. - internal static string StampedPropertyDefaultContentType - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_DefaultContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict identified flag - /// - /// The stamped property of matter roles. - internal static string StampedPropertyIsConflictIdentified - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_IsConflictIdentified", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter document template count - /// - /// The stamped property of matter roles. - internal static string StampedPropertyDocumentTemplateCount - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_DocumentTempateCount", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter blocked upload users - /// - /// The stamped property of matter roles. - internal static string StampedPropertyBlockedUsers - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Blocked_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter GUID - /// - /// The stamped property of matter GUID. - internal static string StampedPropertyMatterGUID - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_GUID", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the code for delete matter functionality - /// - /// Code for delete matter functionality. - internal static string DeleteMatterCode - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "DeleteMatterCode", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the code if matter library already exists - /// - /// code if matter library already exists. - internal static string MatterLibraryExistsCode - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "MatterLibraryExistsCode", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the code if matter landing page already exists - /// - /// code if matter landing page already exists. - internal static string MatterLandingExistsCode - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "MatterLandingExistsCode", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the mail SOAP request. - /// - /// The mail SOAP request. - internal static string MailSoapRequest - { - get - { - return mailSoapRequest; - } - } - - /// - /// Gets the attachment SOAP request. - /// - /// The attachment SOAP request. - internal static string AttachmentSoapRequest - { - get - { - return attachmentSoapRequest; - } - } - - /// - /// Gets the invalid character regex. - /// - /// The invalid character regex. - internal static string InvalidCharRegex - { - get - { - return invalidCharRegex; - } - } - - /// - /// Gets the start end REGEX. - /// - /// The start end REGEX. - internal static string StartEndregex - { - get - { - return startEndregex; - } - } - - /// - /// Gets the invalid rule REGEX. - /// - /// The invalid rule REGEX. - internal static string InvalidRuleRegex - { - get - { - return invalidRuleRegex; - } - } - - /// - /// Gets the extra space regex. - /// - /// The extra space regex. - internal static string ExtraSpaceRegex - { - get - { - return extraSpaceRegex; - } - } - - /// - /// Gets the invalid file name regex. - /// - /// The invalid file name regex. - internal static string InvalidFileNameRegex - { - get - { - return invalidFileNameRegex; - } - } - - /// - /// Gets a value indicating whether this instance is tenant deployment. - /// - /// true if this instance is tenant deployment; otherwise, false. - internal static bool IsTenantDeployment - { - get - { - return isTenantDeployment; - } - } - - /// - /// Gets a value indicating whether this instance is major version enable. - /// - /// true if this instance is major version enable; otherwise, false. - internal static bool IsMajorVersionEnable - { - get - { - return isMajorVersionEnable; - } - } - - /// - /// Gets a value indicating whether this instance is minor version enable. - /// - /// true if this instance is minor version enable; otherwise, false. - internal static bool IsMinorVersionEnable - { - get - { - return isMinorVersionEnable; - } - } - - /// - /// Gets a value indicating whether this instance is force check out. - /// - /// true if this instance is force check out; otherwise, false. - internal static bool IsForceCheckOut - { - get - { - return isForceCheckOut; - } - } - - /// - /// Gets a value indicating whether to create calendar for matter or not - /// - /// trueif creation of calendar is to be done; otherwise, false - internal static bool IsCreateCalendarEnabled - { - get - { - return isCreateCalendarEnabled; - } - } - - /// - /// Gets the brief case items query. - /// - /// The brief case items query. - internal static string BriefCaseItemsQuery - { - get - { - return briefCaseItemsQuery; - } - } - - /// - /// Gets the get item by name query. - /// - /// The get item by name query. - internal static string GetItemByNameQuery - { - get - { - return getItemByNameQuery; - } - } - - /// - /// Gets the briefcase folder query. - /// - /// The briefcase folder query. - internal static string BriefcaseFolderQuery - { - get - { - return briefcaseFolderQuery; - } - } - - /// - /// Gets the briefcase folder contents query. - /// - /// The briefcase folder contents query. - internal static string BriefcaseFolderContentsQuery - { - get - { - return briefcaseFolderContentsQuery; - } - } - - /// - /// Gets the legal briefcase folder. - /// - /// The legal briefcase folder. - internal static string LegalBriefcaseFolder - { - get - { - return legalBriefcaseFolder; - } - } - - /// - /// Gets the name of the OneDrive content type. - /// - /// The name of the OneDrive content type. - internal static string OneDriveContentTypeName - { - get - { - return oneDriveContentTypeName; - } - } - - /// - /// Gets the already check out. - /// - /// The already check out. - internal static string AlreadyCheckOut - { - get - { - return alreadyCheckOut; - } - } - - /// - /// Gets the send to matter query. - /// - /// The send to matter query. - internal static string SendToMatterQuery - { - get - { - return sendToMatterQuery; - } - } - - /// - /// Gets the user my site not present. - /// - /// The user my site not present. - internal static string UserMySiteNotPresent - { - get - { - return userMySiteNotPresent; - } - } - - /// - /// Gets the user my site not present URL when OneDrive is not configured. - /// - /// The URL when user my site not present. - internal static string OneDriveNotSetupUrl - { - get - { - return oneDriveNotSetupUrl; - } - } - - /// - /// Gets the type of the OneDrive parent content. - /// - /// The type of the OneDrive parent content. - internal static string OneDriveParentContentType - { - get - { - return oneDriveParentContentType; - } - } - - /// - /// Gets the OneDrive site column schema. - /// - /// The OneDrive site column schema. - internal static string OneDriveSiteColumnSchema - { - get - { - return oneDriveSiteColumnSchema; - } - } - - /// - /// Gets the OneDrive content type group. - /// - /// The OneDrive content type group. - internal static string OneDriveContentTypeGroup - { - get - { - return oneDriveContentTypeGroup; - } - } - - /// - /// Gets the OneDrive site column. - /// - /// The OneDrive site column. - internal static string OneDriveSiteColumn - { - get - { - return oneDriveSiteColumn; - } - } - - /// - /// Gets the type of the OneDrive site column. - /// - /// The type of the OneDrive site column. - internal static string OneDriveSiteColumnType - { - get - { - return oneDriveSiteColumnType; - } - } - - /// - /// Gets the exchange service URL. - /// - /// The exchange service URL. - internal static string ExchangeServiceURL - { - get - { - return exchangeServiceURL; - } - } - - /// - /// Gets the share list column mail list. - /// - /// The share list column mail list. - internal static string ShareListColumnMailList - { - get - { - return shareListColumnMailList; - } - } - - /// - /// Gets the jQuery file name from the Constants file - /// - internal static string JQueryFileName - { - get - { - return jqueryFileName; - } - } - - /// - /// Gets the JS file name from resource file used in Matter Landing page - /// - internal static string MatterLandingJSFileName - { - get - { - return matterLandingJSFileName; - } - } - - /// - /// Gets the CSS file name of the matter landing page - /// - internal static string MatterLandingCSSFileName - { - get - { - return matterLandingCSSFileName; - } - } - - /// - /// Gets the appropriate User Permissions - /// - internal static string UserPermissions - { - get - { - return userPermissions; - } - } - - /// - /// Gets the list of invalid extension not to be displayed in find document app - /// - internal static string FindDocumentInvalidExtensions - { - get - { - return findDocumentInvalidExtensions; - } - } - - /// - /// Gets the Valid Date format - /// - internal static string ValidDateFormat - { - get - { - return validDateFormat; - } - } - - /// - /// Suffix to be appended in calendar name - /// - internal static string CalendarNameSuffix - { - get - { - return calendarNameSuffix; - } - } - - /// - /// Suffix to be appended in calendar name - /// - internal static string TaskNameSuffix - { - get - { - return taskNameSuffix; - } - } - - /// - /// Gets the Matter Landing Folder Name - /// - internal static string MatterLandingFolderName - { - get - { - return matterLandingFolderName; - } - } - - /// - /// Gets the Common Folder Name - /// - internal static string CommonFolderName - { - get - { - return commonFolderName; - } - } - - /// - /// Gets the common js file location on SharePoint - /// - internal static string CommonJSFileLink - { - get - { - return commonJSFileLink; - } - } - - /// - /// Gets the common css file location on SharePoint - /// - internal static string CommonCSSFileLink - { - get - { - return commonCSSFileLink; - } - } - - /// - /// Gets the matter Id length - /// - /// The matter Id length - internal static string MatterIdLength - { - get - { - return matterIdLength; - } - } - - /// - /// Gets the matter name length - /// - /// The matter name length - internal static string MatterNameLength - { - get - { - return matterNameLength; - } - } - - /// - /// Gets the matter description length - /// - /// The matter description length - internal static string MatterDescriptionLength - { - get - { - return matterDescriptionLength; - } - } - - /// - /// Gets the content type length - /// - /// The content type length - internal static string ContentTypeLength - { - get - { - return contentTypeLength; - } - } - - /// - /// Gets the error message when matter library is not found when trying to delete - /// - /// Error message when matter library is not found when trying to delete - internal static string MatterNotPresent - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Not_Present", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the name of the custom view. - /// - /// The name of the custom view - internal static string ViewName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the list of columns for the custom view. - /// - /// The list of columns for the custom view - internal static string ViewColumnList - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_Column_List", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the column to set OrderBy for the custom view. - /// - /// The column to set OrderBy for the custom view - internal static string ViewOrderByColumn - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_OrderBy_Column", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the query to set OrderBy for the custom view. - /// - /// The query to set OrderBy for the custom view - internal static string ViewOrderByQuery - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_OrderBy_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Holds the number of search results (users) to pull from people picker service based on the search term. This will return email enabled users as well as non-email enabled users. - /// - internal static string PeoplePickerMaximumEntitySuggestions - { - get - { - return peoplePickerMaximumEntitySuggestions; - } - } - - /// - /// Holds the number of records to pull which has email property from client picker service results. - /// - internal static string PeoplePickerMaxRecords - { - get - { - return peoplePickerMaxRecords; - } - } - - /// - /// Holds the flag to allow multiple users to be searched using people picker service. - /// - internal static string PeoplePickerAllowMultipleEntities - { - get - { - return peoplePickerAllowMultipleEntities; - } - } - - /// - /// Holds the flag to allow multiple users to be searched using people picker service. - /// - internal static string TempEmailName - { - get - { - return tempEmailName; - } - } - - /// - /// Holds the Client ID property for Clients Term Set - /// - internal static string ClientCustomPropertiesId - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Client_Custom_Properties_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Holds the error code for matter landing existence - /// - internal static string ErrorCodeMatterLandingPageExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeMatterLandingPageExists", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Suffix to be appended in OneNote library name - /// - internal static string OneNoteLibrarySuffix - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "OneNoteLibrary_Name_Suffix", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the library name holding the matter landing pages for the site collection - /// - internal static string MatterLandingPageRepositoryName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Repository_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the content of the Matter Center Help Section List. - /// - /// The Matter Center help section list name. - internal static string MatterCenterHelpSectionListName - { - get - { - return matterCenterHelpSectionListName; - } - } - - /// - /// Name of the column storing Link Title. - /// - /// Name of the column storing Link Title. - internal static string ContextualHelpLinksColumnLinkTitle - { - get - { - return contextualHelpLinksColumnLinkTitle; - } - } - - /// - /// Name of the column storing Link URL. - /// - /// Name of the column storing Link URL. - internal static string ContextualHelpLinksColumnLinkURL - { - get - { - return contextualHelpLinksColumnLinkURL; - } - } - - /// - /// Name of the column storing Link Order. - /// - /// Name of the column storing Link Order. - internal static string ContextualHelpLinksColumnLinkOrder - { - get - { - return contextualHelpLinksColumnLinkOrder; - } - } - - /// - /// Name of the column storing Section ID. - /// - /// Name of the column storing Section ID. - internal static string ContextualHelpLinksColumnSectionID - { - get - { - return contextualHelpLinksColumnSectionID; - } - } - - /// - /// Name of the column storing Section ID. - /// - /// Name of the column storing Section ID. - internal static string ContextualHelpSectionColumnSectionID - { - get - { - return contextualHelpSectionColumnSectionID; - } - } - - /// - /// Name of the column storing Section Title. - /// - /// Name of the column storing Section Title. - internal static string ContextualHelpSectionColumnSectionTitle - { - get - { - return contextualHelpSectionColumnSectionTitle; - } - } - - /// - /// Name of the column storing Page Name. - /// - /// Name of the column storing Page Name. - internal static string ContextualHelpSectionColumnPageName - { - get - { - return contextualHelpSectionColumnPageName; - } - } - - /// - /// Name of the column storing Section Order. - /// - /// Name of the column storing Section Order. - internal static string ContextualHelpSectionColumnSectionOrder - { - get - { - return contextualHelpSectionColumnSectionOrder; - } - } - - /// - /// Name of the column storing Number of Columns. - /// - /// Name of the column storing Number of Columns. - internal static string ContextualHelpSectionColumnNumberOfColumns - { - get - { - return contextualHelpSectionColumnNumberOfColumns; - } - } - - /// - /// Gets the content of the Matter Center Help links List. - /// - /// The Matter Center help links list name . - internal static string MatterCenterHelpLinksListName - { - get - { - return matterCenterHelpLinksListName; - } - } - - /// - /// Gets contextual help sections. - /// - /// Query to be used for retrieving contextual help sections. - internal static string RetrieveContextualHelpSectionsQuery - { - get - { - return retrieveContextualHelpSectionsQuery; - } - } - - /// - /// Gets contextual help links. - /// - /// Query to be used for retrieving contextual help links. - internal static string RetrieveContextualHelpLinksQuery - { - get - { - return retrieveContextualHelpLinksQuery; - } - } - - /// - /// Represents page names to be used in contextual help functionality - /// - /// ';' separated list of page names to be used in contextual help functionality. - internal static string MatterCenterPages - { - get - { - return matterCenterPages; - } - } - - /// - /// Represents OR part of CAMLquery to support include sections (link) - /// - /// ';' separated list to build OR part of CAMLquery to support include sections (link). - internal static string ContextualHelpQueryIncludeOrCondition - { - get - { - return contextualHelpQueryIncludeOrCondition; - } - } - - /// - /// Represents the error message when Full Control permission is not available - /// - internal static string ErrorEditMatterMandatoryPermission - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Error_Edit_Matter_Mandatory_Permission", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Represents the error code when user tries to remove self permission - /// - internal static string IncorrectInputSelfPermissionRemoval - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Self_Permission_Removal_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error code when security group exists in team members - /// - internal static string ErrorCodeSecurityGroupExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Security_Group_Exists_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error message when security group exists in team members - /// - internal static string ErrorMessageSecurityGroupExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Security_Group_Exists_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error code when team members are not valid - /// - internal static string IncorrectTeamMembersCode - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Team_Members_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error message when team members are not valid - /// - internal static string IncorrectTeamMembersMessage - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Team_Members_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the matter configuration entry title value - /// - internal static string MatterConfigurationTitleValue - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Configurations_Title_Value", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Represents the matter configurations list query - /// - internal static string MatterConfigurationsListQuery - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configurations_List_Query", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Title for Lists Path - /// - internal static string TitleListsPath - { - get - { - return titleListsPath; - } - } - - /// - /// The matter configurations list name - /// - internal static readonly string MatterConfigurationsList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configurations_List", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Content check flag default value - /// - internal static readonly bool IsContentCheck = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "Is_Content_Check", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// Property value column of Matter Configurations list - /// - internal static readonly string MatterConfigurationColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configuration_List_Column_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The tenant URL - /// - internal static readonly string SiteURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Site_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Email format for send as email functionality - /// - internal static string SendAsEmailFormat = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Send_As_Email_Format", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Email CSS style for send as email functionality - /// - internal static string SendAsEmailFontStyle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Send_As_Email_Font_Style", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the incorrect input code for user access in Provision Matter Group - /// - /// The incorrect input code for user access in Provision Matter Group - internal static string IncorrectInputUserAccessCode - { - get - { - return incorrectInputUserAccessCode; - } - } - - /// - /// Gets the incorrect input message for user access in Provision Matter Group - /// - /// The incorrect input message for user access in Provision Matter Group - internal static string IncorrectInputUserAccessMessage - { - get - { - return incorrectInputUserAccessMessage; - } - } - - /// - /// User's OneDrive document library title - /// - /// User's OneDrive document library title - internal static string OneDriveDocumentLibraryTitle - { - get - { - return oneDriveDocumentLibraryTitle; - } - } - - /// - /// Date format for dates displayed in Matter Center app - /// - /// Date format for dates displayed in Matter Center app - internal static string MatterCenterDateFormat - { - get - { - return matterCenterDateFormat; - } - } - - /// - /// The message for user not present in site owner for a particular client - /// - internal static readonly string UserNotSiteOwnerMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Not_Site_Owner_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The code for user not present in site owner for a particular client - /// - internal static readonly string UserNotSiteOwnerCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Not_Site_Owner_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The message for duplicate matter library - /// - internal static readonly string ErrorDuplicateMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Error_Duplicate_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The message for duplicate matter landing page - /// - internal static readonly string ErrorDuplicateMatterLandingPage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Error_Duplicate_MatterLandingPage", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Attachments tag in Exchange response - /// - internal const string AttachmentsTag = "Attachments"; - - /// - /// The FileAttachment tag in Exchange response - /// - internal const string FileAttachmentTag = "FileAttachment"; - - /// - /// The ItemAttachment tag in Exchange response - /// - internal const string ItemAttachmentTag = "ItemAttachment"; - - /// - /// The Name tag in Exchange response - /// - internal const string FileNameTag = "Name"; - - /// - /// The AttachmentID tag in Exchange response - /// - internal const string AttachmentIdTag = "AttachmentId"; - - /// - /// The Id attribute in Exchange response - /// - internal const string IdAttribute = "Id"; - - /// - /// The name of the HTTP header for web request - /// - internal const string RequestHeaderName = "Authorization"; - - /// - /// The value of the HTTP header for web request - /// - internal const string RequestHeaderValue = "Bearer {0}"; - - /// - /// The Method for web request - /// - internal const string RequestMethod = "POST"; - - /// - /// The value of the Content-type HTTP header for web request - /// - internal const string RequestContentType = "text/xml; charset=utf-8"; - - /// - /// The column name for document GUID - /// - internal const string DocumentGUIDColumnName = "UniqueId"; - - /// - /// Open square brace - /// - internal const string OpenSquareBrace = "["; - - /// - /// Close square brace - /// - internal const string CloseSquareBrace = "]"; - - /// - /// Name of the path field in results returned from SharePoint search - /// - internal const string PathFieldName = "Path"; - - /// - /// Double quote - /// - internal const string DoubleQuotes = "\""; - - /// - /// String to be used for creating default value for metadata. This string is in following format: WSSID;#VAL|GUID - /// - internal const string MetadataDefaultValue = "{0};#{1}|{2}"; - - #region Azure Cache keys - /// - /// Clients cache key - /// - internal const string CACHE_CLIENTS = "Clients"; - - /// - /// Matter type cache key - /// - internal const string CACHE_MATTER_TYPE = "MatterType"; - - /// - /// Roles cache key - /// - internal const string CACHE_ROLES = "Roles"; - #endregion - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/TextConstants.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/TextConstants.cs deleted file mode 100644 index 9a5974fa..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/TextConstants.cs +++ /dev/null @@ -1,400 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-akdigh -// Created : 11-28-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains messages displayed to user. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - #endregion - - /// - /// Provides Text constants used in Matter Center. - /// - internal static class TextConstants - { - /// - /// The message no inputs - /// - internal static readonly string MessageNoInputs = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Message_No_Inputs", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - internal static readonly string ShareListColumnMailBody = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_Body", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - internal static readonly string ShareListColumnMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// HTML chunk of the Default content type for Matter creation mail - /// - internal static readonly string MatterMailDefaultContentTypeHtmlChunk = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Default_Content_Type_Html_Chunk", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Subject of the matter creation mail - /// - internal static readonly string MatterMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Request Object message - /// - internal static readonly string IncorrectInputRequestObjectMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Request_Object_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Request Object code - /// - internal static readonly string IncorrectInputRequestObjectCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Request_Object_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client URL message - /// - internal static readonly string IncorrectInputClientUrlMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Url_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client URL code - /// - internal static readonly string IncorrectInputClientUrlCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Url_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Id message - /// - internal static readonly string IncorrectInputClientIdMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Id_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Id code - /// - internal static readonly string IncorrectInputClientIdCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Id_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client name message - /// - internal static readonly string IncorrectInputClientNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// REGEX pattern for email validation - /// - internal static readonly string EmailValidationRegex = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Email_Validation_Regex", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client name code - /// - internal static readonly string IncorrectInputClientNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Practice Group message - /// - internal static readonly string IncorrectInputPracticeGroupMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Practice_Group_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Practice Group code - /// - internal static readonly string IncorrectInputPracticeGroupCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Practice_Group_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Area Of Law message - /// - internal static readonly string IncorrectInputAreaOfLawMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Area_Of_Law_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Area Of Law code - /// - internal static readonly string IncorrectInputAreaOfLawCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Area_Of_Law_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Sub Area Of Law message - /// - internal static readonly string IncorrectInputSubareaOfLawMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Subarea_Of_Law_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Sub Area Of Law code - /// - internal static readonly string IncorrectInputSubareaOfLawCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Subarea_Of_Law_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Responsible Attorney message - /// - internal static readonly string IncorrectInputResponsibleAttorneyMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Responsible_Attorney_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Responsible Attorney code - /// - internal static readonly string IncorrectInputResponsibleAttorneyCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Responsible_Attorney_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter name message - /// - internal static readonly string IncorrectInputMatterNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter name code - /// - internal static readonly string IncorrectInputMatterNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter Id message - /// - internal static readonly string IncorrectInputMatterIdMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Id_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter Id code - /// - internal static readonly string IncorrectInputMatterIdCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Id_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user name message - /// - internal static readonly string IncorrectInputUserNamesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Names_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user name code - /// - internal static readonly string IncorrectInputUserNamesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Names_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user permission message - /// - internal static readonly string IncorrectInputUserPermissionsMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Permissions_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user permission code - /// - internal static readonly string IncorrectInputUserPermissionsCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Permissions_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Content Type message - /// - internal static readonly string IncorrectInputContentTypeMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Content_Type_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Content Type code - /// - internal static readonly string IncorrectInputContentTypeCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Content_Type_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter description message - /// - internal static readonly string IncorrectInputMatterDescriptionMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Description_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter description code - /// - internal static readonly string IncorrectInputMatterDescriptionCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Description_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict date message - /// - internal static readonly string IncorrectInputConflictDateMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Date_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict date code - /// - internal static readonly string IncorrectInputConflictDateCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Date_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict identified message - /// - internal static readonly string IncorrectInputConflictIdentifiedMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Identified_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict identified code - /// - internal static readonly string IncorrectInputConflictIdentifiedCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Identified_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user roles message - /// - internal static readonly string IncorrectInputUserRolesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Roles_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user roles code - /// - internal static readonly string IncorrectInputUserRolesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Roles_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict check by message - /// - internal static readonly string IncorrectInputConflictCheckByMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Check_By_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict check by code - /// - internal static readonly string IncorrectInputConflictCheckByCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Check_By_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect block users message - /// - internal static readonly string IncorrectInputBlockUserNamesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Block_User_Names_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect block users code - /// - internal static readonly string IncorrectInputBlockUserNamesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Block_User_Names_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Is Read Only User key name, used to determine if user is read-only user for particular matter - /// - internal static readonly string IsReadOnlyUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Is_Read_Only_User", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The no mail subject - /// - internal static readonly string NoMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "No_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The missing parameters message - /// - internal static readonly string MissingParametersMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Parameter_Missing_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The invalid parameters message - /// - internal static readonly string InvalidParametersMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Parameter_Invalid_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail cart mail subject - /// - internal static readonly string MailCartMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Mail_Cart_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail cart mail body - /// - internal static readonly string MailCartMailBody = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Mail_Cart_Mail_Body", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Link to templates document library on content type hub - /// - internal static readonly string FileNotAvailableMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "File_Not_Available_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Success message on deletion of matter - /// - internal static readonly string MatterDeletedSuccessfully = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Deletion_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the message for no data returned from people picker control based on the search term. - /// - internal static readonly string PeoplePickerNoResults = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_No_Results_Found", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - /// - /// Error code when for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - internal static readonly string ErrorCodeContentTypes = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code for issue when creation of site column while sending document to OneDrive - /// - /// Error code for issue when creation of site column while sending document to OneDrive - internal static readonly string ErrorCodeCreateSiteColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeCreateSiteColumn", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code for issue when creation of site content type while sending document to OneDrive - /// - /// Error code for issue when creation of site content type while sending document to OneDrive - internal static readonly string ErrorCodeCreateSiteContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeCreateSiteContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code for issue when assigning default site content type while sending document to OneDrive - /// - /// Error code for issue when assigning default site content type while sending document to OneDrive - internal static readonly string ErrorCodeAssignDefaultContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeAssignDefaultContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code for issue when OneDrive is not configured for user - /// - /// Error code for issue when OneDrive is not configured for user - internal static readonly string ErrorCodeOneDriveNotConfigured = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeOneDriveNotConfigured", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message for issue when creation of site column while sending document to OneDrive - /// - /// Error message for issue when creation of site column while sending document to OneDrive - internal static readonly string ErrorMessageCreateSiteColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageCreateSiteColumn", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message for issue when creation of site content type while sending document to OneDrive - /// - /// Error message for issue when creation of site content type while sending document to OneDrive - internal static readonly string ErrorMessageCreateSiteContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageCreateSiteContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message for issue when assigning default site content type while sending document to OneDrive - /// - /// Error message for issue when assigning default site content type while sending document to OneDrive - internal static readonly string ErrorMessageAssignDefaultContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageAssignDefaultContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - /// - /// Error message when for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - internal static readonly string ErrorMessageContentTypes = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code when there is an issue while assigning permissions to calendar list - /// - /// Error code when there is an issue while assigning permissions to calendar list - internal static readonly string ErrorCodeCalendarCreation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeCalendarCreation", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code when there is an issue while assigning permissions to calendar list - /// - /// Error code when there is an issue while assigning permissions to calendar list - internal static readonly string ErrorMessageTaskCreation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageTaskCreation", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message when there is an issue while assigning permissions to calendar list - /// - /// Error message when there is an issue while assigning permissions to calendar list - internal static readonly string ErrorMessageCalendarCreation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageCalendarCreation", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code when there is an issue while creating calendar list - /// - /// Error code when there is an issue while creating calendar list - internal static readonly string ErrorCodeAddCalendarList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeAddCalendarList", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error code when there is an issue while creating task list - /// - /// Error code when there is an issue while creating task list - internal static readonly string ErrorCodeAddTaskList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeAddTaskList", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message when there is an issue while creating calendar list - /// - /// Error message when there is an issue while creating calendar list - internal static readonly string ErrorMessageAddCalendarList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageAddCalendarList", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the error message when there is an issue while creating task list - /// - /// Error message when there is an issue while creating task list - internal static readonly string ErrorMessageAddTaskList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageAddTaskList", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the body of the matter mail for conflict check - /// - internal static readonly string MatterMailBodyConflictCheck = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Conflict_Check", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the body of the matter mail for Team Members - /// - internal static readonly string MatterMailBodyTeamMembers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Gets the body of the matter mail for Matter Information - /// - internal static readonly string MatterMailBodyMatterInformation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Matter_Information", Enumerators.ResourceFileLocation.App_GlobalResources); - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/WebpartConstants.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/WebpartConstants.cs deleted file mode 100644 index bfb74f1a..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Constants/WebpartConstants.cs +++ /dev/null @@ -1,262 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-shpate -// Created : 11-28-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains constants required for creating web part in SharePoint. -// *********************************************************************** - - -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - #endregion - - internal static class WebpartConstants - { - /// - /// XML definition of the left web part - /// - internal const string ContentEditorWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - MiddleLeftZone - 0 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - - - "; - - /// - /// XML definition of the RSS feed web part - /// - internal const string RssFeedWebpart = @" - - - - Cannot import this web part. - - - - False - None - - - True - - <ParameterBinding Name=""RequestUrl"" Location=""WPProperty[FeedUrl]""/> - True - False - - - 5 - False - - - 0 - - 600 - 60 - True - http://www.bing.com/search?q={0}&format=rss - True - False - False - False - - - True - False - None - Normal - True - - - False - NotSet - RSS Viewer - 00000000-0000-0000-0000-000000000000 - Displays an RSS feed. - True - - - <%@ Register TagPrefix=""WebControls"" Namespace=""Microsoft.SharePoint.WebControls"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> - <%@ Register TagPrefix=""WebPartPages"" Namespace=""Microsoft.SharePoint.WebPartPages"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> - <WebControls:XmlUrlDataSource runat=""server"" AuthType=""None"" HttpMethod=""GET""> - <DataFileParameters> - <WebPartPages:DataFormParameter Name=""RequestUrl"" ParameterKey=""RequestUrl"" PropertyName=""ParameterValues""/> - </DataFileParameters> - </WebControls:XmlUrlDataSource> - - PAGE_NORMALVIEW - - True - All - 120 - -1 - - - - True - - Cannot import this web part. - Modeless - - - - "; - /// - /// XML definition of the list view web part - /// - internal const string ListviewWebpart = @" - - - - - Cannot import this Web Part. - - - - False - - - True - - - False - - {0} - {1} - False - NotSet - False - Html, TabularView, Hidden, Mobile - True - {2} - - True - Normal - False - - - All - False - True - True - - Modeless - - True - 86400 - None - - - /_layouts/15/images/itdl.png?rev=33 - - True - - -1 - True - 750px - - False - - PAGE_NORMALVIEW - - True - True - 00000000-0000-0000-0000-000000000000 - - main.xsl - False - - False - <View Name=""{3}"" MobileView=""TRUE"" Type=""HTML"" Hidden=""TRUE"" DisplayName="" "" Url=""{4}"" Level=""1"" BaseViewID=""1"" ContentTypeID=""0x"" ImageUrl=""/_layouts/15/images/dlicon.png?rev=37"" ><Query><OrderBy><FieldRef Name=""FileLeafRef""/></OrderBy></Query><ViewFields><FieldRef Name=""DocIcon""/><FieldRef Name=""LinkFilename""/><FieldRef Name=""Modified""/><FieldRef Name=""Editor""/></ViewFields><RowLimit Paged=""TRUE"">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=""TRUE"">main.xsl</XslLink><Toolbar Type=""Standard""/></View> - False - True - - <ParameterBinding Name=""dvt_sortdir"" Location=""Postback;Connection""/> - <ParameterBinding Name=""dvt_sortfield"" Location=""Postback;Connection""/> - <ParameterBinding Name=""dvt_startposition"" Location=""Postback"" DefaultValue="" ""/> - <ParameterBinding Name=""dvt_firstrow"" Location=""Postback;Connection""/> - <ParameterBinding Name=""OpenMenuKeyAccessible"" Location=""Resource(wss,OpenMenuKeyAccessible)"" /> - <ParameterBinding Name=""open_menu"" Location=""Resource(wss,open_menu)"" /> - <ParameterBinding Name=""select_deselect_all"" Location=""Resource(wss,select_deselect_all)"" /> - <ParameterBinding Name=""idPresEnabled"" Location=""Resource(wss,idPresEnabled)"" /><ParameterBinding Name=""NoAnnouncements"" Location=""Resource(wss,noitemsinview_doclibrary)"" /><ParameterBinding Name=""NoAnnouncementsHowTo"" Location=""Resource(wss,noitemsinview_doclibrary_howto2)"" /> - List - 60 - False - - Cannot import this Web Part. - - - False - - - - "; - - /// - /// Matter Landing page sections - /// - internal static string MatterLandingPageSections = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Sections", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Section to be appended on the page - /// - internal const string MatterLandingSectionContent = "
"; - - /// - /// Style tag - /// - internal const string StyleTag = ""; - - /// - /// Script tag - /// - internal const string ScriptTag = ""; - - /// - /// Script tag with contents - /// - internal const string ScriptTagWithContents = ""; - - /// - /// Matter landing stamp properties - /// - internal const string matterLandingStampProperties = "var documentLibraryName = \"{0}\", isNewMatterLandingPage = true, documentLibraryGUID=\"{1}\";"; - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/GlobalSuppressions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/GlobalSuppressions.cs deleted file mode 100644 index 566e63be..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/GlobalSuppressions.cs and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseContentTypeHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseContentTypeHelperFunctions.cs deleted file mode 100644 index 43905d50..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseContentTypeHelperFunctions.cs +++ /dev/null @@ -1,444 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-diajme -// Created : 04-06-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods involved in briefcase operations related to content type. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.CommonHelper -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - #endregion - - /// - /// Provide methods involved in briefcase operations related to content type. - /// - internal static class BriefcaseContentTypeHelperFunctions - { - /// - /// Returns content type associated with the list. - /// - /// List object - /// Client Context object - /// Content type object - internal static ContentType GetContentType(List list, ClientContext clientContext) - { - ContentType targetDocumentSetContentType = null; - ContentTypeCollection listContentTypes = null; - try - { - listContentTypes = list.ContentTypes; - clientContext.Load( - listContentTypes, - types => types.Include( - type => type.Id, - type => type.Name, - type => type.Parent)); - - var result = clientContext.LoadQuery(listContentTypes.Where(c => c.Name == ConstantStrings.OneDriveDocumentContentType)); - clientContext.ExecuteQuery(); - targetDocumentSetContentType = result.FirstOrDefault(); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return targetDocumentSetContentType; - } - - /// - /// Updates the content type of the list item and returns the updated content type based on briefcase operation. - /// - /// Request object - /// ClientContext object - /// Document Name - /// URL parameter - /// Specifies the type of operation - /// String form of Content type ID - /// Name of the document library - /// List item Content Type Id - internal static string ContentTypeByName(RequestObject requestObject, ClientContext clientContext, string documentName, string url, int operationType, string contentTypeId, string documentLibraryName) - { - string response = string.Empty; - try - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(url.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - string itemQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.GetItemByNameQuery, documentName); - ListItemCollection listItems = Lists.GetData(clientContext, documentLibraryName, itemQuery); - ServiceConstantStrings.OperationTypes type = (ServiceConstantStrings.OperationTypes)operationType; - switch (type) - { - case ServiceConstantStrings.OperationTypes.Update: - foreach (var listitem in listItems) - { - response = Convert.ToString(listitem[ConstantStrings.OneDriveContentTypeProperty], CultureInfo.InvariantCulture); - } - break; - case ServiceConstantStrings.OperationTypes.Checkout: - foreach (var listitem in listItems) - { - listitem[ConstantStrings.OneDriveContentTypeProperty] = contentTypeId; - listitem.Update(); - clientContext.ExecuteQuery(); - response = ConstantStrings.TRUE; - } - break; - default: - response = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, TextConstants.InvalidParametersMessage); - break; - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - response = string.Concat(CultureInfo.InvariantCulture, ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return response; - } - - /// - /// Gets and sets default content type of the list. - /// - /// RequestObject object - /// ClientContext object - /// SourceURL of the OneDrive document - /// Content Type Id - /// Operation type specifies either get or set Content type operation - /// Name of the document library - /// Returns Content Type Id - internal static string GetContentTypeList(RequestObject requestObject, ClientContext clientContext, string url, string contentTypeId, int operationType, string documentLibraryName) - { - try - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(url.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - List docLib = clientContext.Web.Lists.GetByTitle(documentLibraryName); - clientContext.Load(docLib); - clientContext.ExecuteQuery(); - Microsoft.SharePoint.Client.Folder folder = docLib.RootFolder; - IList list = new List(); - clientContext.Load(folder, item => item.ContentTypeOrder, item => item.UniqueContentTypeOrder); - clientContext.ExecuteQuery(); - list = folder.ContentTypeOrder; - ServiceConstantStrings.OperationTypes type = (ServiceConstantStrings.OperationTypes)operationType; - switch (type) - { - case ServiceConstantStrings.OperationTypes.Update: - contentTypeId = list[0].StringValue; - break; - case ServiceConstantStrings.OperationTypes.Checkout: - int iterator = 0, index = 0; - for (iterator = 0; iterator < list.Count; iterator++) - { - if (list[iterator].StringValue == contentTypeId) - { - index = iterator; - break; - } - } - ContentTypeId currentContentTypeID = list[index]; - list.RemoveAt(index); - list.Insert(0, currentContentTypeID); - folder.UniqueContentTypeOrder = list; - folder.Update(); - clientContext.ExecuteQuery(); - break; - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return contentTypeId; - } - - /// - /// Check for the list item named Matter Center Briefcase already exists, if not then only create new folder - /// - /// SP client context - /// Name of the list - /// My Site URL of the user - internal static void CreateBriefcaseIfNotExists(ClientContext clientContext, List list, string usersMySite) - { - CamlQuery briefcaseQuery = new CamlQuery(); - briefcaseQuery.ViewXml = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.BriefcaseFolderQuery, ServiceConstantStrings.LegalBriefcaseFolder); - ListItemCollection briefcases = list.GetItems(briefcaseQuery); - clientContext.Load(briefcases, listItems => listItems.Include(item => item.DisplayName)); - clientContext.ExecuteQuery(); - ListItem listItem = briefcases.Where(item => item.DisplayName == ServiceConstantStrings.LegalBriefcaseFolder).FirstOrDefault(); - if (null == listItem) // Check for Matter Center Briefcase folder exists, if not then create - { - ListItemCreationInformation newItem = new ListItemCreationInformation(); - newItem.FolderUrl = string.Concat(usersMySite, ServiceConstantStrings.OneDriveDocumentLibraryTitle); - newItem.LeafName = ServiceConstantStrings.LegalBriefcaseFolder; - newItem.UnderlyingObjectType = FileSystemObjectType.Folder; - listItem = list.AddItem(newItem); - listItem.Update(); - clientContext.Load(listItem, field => field.DisplayName); - clientContext.ExecuteQuery(); - } - } - - /// - /// Sets the content type. - /// - /// SP client context - /// Name of the list - /// My Site URL of the user - internal static void SetContentType(ClientContext clientContext, List list, string usersMySite) - { - bool flag = false; - try - { - CreateBriefcaseIfNotExists(clientContext, list, usersMySite); - // Get Matter Center for OneDrive content type - ContentType oneDriveContentType = clientContext.Web.ContentTypes.Where(item => item.Name == ServiceConstantStrings.OneDriveContentTypeName).FirstOrDefault(); - if (null != oneDriveContentType) - { - list.ContentTypes.AddExistingContentType(oneDriveContentType); // Associate content type with list (Documents) - list.Update(); - clientContext.ExecuteQuery(); - } - ContentTypeCollection currentContentTypeOrder = list.ContentTypes; - clientContext.Load(currentContentTypeOrder); - clientContext.ExecuteQuery(); - foreach (ContentType contentType in currentContentTypeOrder) - { - if (contentType.Name.Equals(ServiceConstantStrings.OneDriveContentTypeName)) - { - flag = true; - } - } - List contentTypes = new List() { ServiceConstantStrings.OneDriveContentTypeName }; - if (flag == false) - { - IList contentTypeCollection = SharePointHelper.GetContentTypeData(clientContext, contentTypes); - if (null != contentTypeCollection) - { - ViewCollection views = list.Views; - clientContext.Load(views); - FieldCollection fields = ProvisionHelperFunctions.GetContentType(clientContext, contentTypeCollection, list); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.OneDriveSiteColumn).SetShowInEditForm(false); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.OneDriveSiteColumn).SetShowInNewForm(false); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.OneDriveSiteColumn).Update(); - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Sets default content type for user's OneDrive. - /// - /// SP client context - /// Name of the list - /// Default content type to be set - /// Content type Id of default content type - internal static string SetOneDriveDefaultContentType(ClientContext clientContext, List list, string defaultContentType) - { - string defaultContentTypeId = string.Empty; - try - { - ContentTypeCollection currentContentTypeOrder = list.ContentTypes; - clientContext.Load(currentContentTypeOrder); - clientContext.ExecuteQuery(); - IList updatedContentTypeOrder = new List(); - int count = 0, swap = 0; - foreach (ContentType contentType in currentContentTypeOrder) - { - if (contentType.Name.Equals(defaultContentType)) - { - defaultContentTypeId = contentType.StringId; - swap = count; - } - if (!contentType.Name.Equals(ConstantStrings.OneDriveFolderContentType)) - { - updatedContentTypeOrder.Add(contentType.Id); - count++; - } - } - ContentTypeId documentContentType = updatedContentTypeOrder[0]; - updatedContentTypeOrder[0] = updatedContentTypeOrder[swap]; - updatedContentTypeOrder[swap] = documentContentType; - list.RootFolder.UniqueContentTypeOrder = updatedContentTypeOrder; - list.RootFolder.Update(); - list.Update(); - clientContext.ExecuteQuery(); - } - catch (Exception exception) - { - defaultContentTypeId = ConstantStrings.FALSE; - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return defaultContentTypeId; - } - - /// - /// Determines whether the content type exists in the content type group under the specified client context. - /// - /// Client context - /// Object of site - /// Type of the received content - /// The content type group - /// List of site columns - internal static bool IsContentTypePresentCheck(ClientContext clientContext, Microsoft.SharePoint.Client.Web web, string receivedContentType, string contentTypeGroup, List siteColumns) - { - bool status = true; - try - { - ContentTypeCollection contentTypeCollection = web.ContentTypes; - clientContext.Load(contentTypeCollection, contentTypes => contentTypes.Include(contentTypeProperties => contentTypeProperties.Group, contentTypeProperties => contentTypeProperties.Name).Where(contentTypeValues => (contentTypeValues.Group == ServiceConstantStrings.OneDriveContentTypeGroup) && (contentTypeValues.Name == ServiceConstantStrings.OneDriveContentTypeName))); - clientContext.ExecuteQuery(); - - if (0 < contentTypeCollection.Count) - { - FieldCollection fields = contentTypeCollection[0].Fields; - clientContext.Load(fields, field => field.Include(fieldType => fieldType.Title).Where(column => column.Title == ServiceConstantStrings.OneDriveSiteColumn)); - clientContext.ExecuteQuery(); - if (0 == fields.Count) - { - BriefcaseContentTypeHelperFunctions.AddColumnsToContentType(web, siteColumns, contentTypeCollection[0]); - web.Update(); - clientContext.ExecuteQuery(); - } - } - else - { - status = BriefcaseContentTypeHelperFunctions.CreateContentType(clientContext, web, siteColumns, receivedContentType, contentTypeGroup); - } - } - catch (Exception exception) - { - status = false; - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Creates site column. - /// - /// Client Context - /// Object of site - /// List of site columns - /// Success or Failure - internal static bool CreateSiteColumn(ClientContext clientContext, Microsoft.SharePoint.Client.Web web, List siteColumns) - { - bool result = false; - try - { - FieldCollection fieldCol = web.Fields; - clientContext.Load(fieldCol); - clientContext.ExecuteQuery(); - List existingFields = fieldCol.ToList(); - foreach (string columns in siteColumns) - { - Field field = (from fld in existingFields - where fld.Title == columns && fld.TypeAsString == ServiceConstantStrings.OneDriveSiteColumnType - select fld).FirstOrDefault(); - if (null == field) - { - web.Fields.AddFieldAsXml(string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.OneDriveSiteColumnSchema, ServiceConstantStrings.OneDriveSiteColumn, ServiceConstantStrings.OneDriveContentTypeGroup), true, AddFieldOptions.DefaultValue); - web.Update(); - clientContext.ExecuteQuery(); - } - } - result = true; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = false; - } - return result; - } - - /// - /// Creates the type of the content. - /// - /// The client context. - /// Object of site - /// The site columns. - /// Name of Content Type - internal static bool CreateContentType(ClientContext clientContext, Microsoft.SharePoint.Client.Web web, List siteColumns, string contentTypeName, string contentTypegroup) - { - bool status = true; - ContentType parentContentType = null; - try - { - ContentTypeCollection contentTypeCollection = web.ContentTypes; - clientContext.Load(contentTypeCollection); - clientContext.Load(web.Fields); - clientContext.ExecuteQuery(); - parentContentType = (from ct in contentTypeCollection - where ct.Name == ServiceConstantStrings.OneDriveParentContentType - select ct).FirstOrDefault(); - ContentTypeCreationInformation contentType = new ContentTypeCreationInformation(); - contentType.Name = contentTypeName; - contentType.Group = contentTypegroup; - ///// contentType.Id = "0x010100B1ED198475FB3A4AABC59AAAD89B7EAD"; - if (parentContentType != null) - { - contentType.ParentContentType = parentContentType; - } - ContentType finalObj = web.ContentTypes.Add(contentType); - AddColumnsToContentType(web, siteColumns, finalObj); - web.Update(); - clientContext.ExecuteQuery(); - } - catch (Exception exception) - { - status = false; - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Add columns to content type. - /// - /// Object of site - /// List of site columns - /// Content type to which columns are to be added - internal static void AddColumnsToContentType(Microsoft.SharePoint.Client.Web web, List siteColumns, ContentType finalObj) - { - try - { - FieldCollection fieldCol = web.Fields; - foreach (string columns in siteColumns) - { - Field customDoc = (from fld in fieldCol - where fld.Title == columns && fld.TypeAsString == ServiceConstantStrings.OneDriveSiteColumnType - select fld).FirstOrDefault(); - FieldLinkCreationInformation fieldLinkCreationInfo = new FieldLinkCreationInformation(); - fieldLinkCreationInfo.Field = customDoc; - finalObj.FieldLinks.Add(fieldLinkCreationInfo); - } - finalObj.Update(true); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseHelperFunction.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseHelperFunction.cs deleted file mode 100644 index 1025b1a4..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseHelperFunction.cs +++ /dev/null @@ -1,553 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-akdigh -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods involved in briefcase operations. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.CommonHelper -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.UserProfiles; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Reflection; - using System.ServiceModel.Web; - using System.Web.Script.Serialization; - #endregion - - /// - /// Provide methods involved in briefcase operations. - /// - internal static class BriefcaseHelperFunction - { - /// - /// Validates the document during briefcase operations. Returns not supported message if the document in operation is not relevant to Matter Center. - /// - /// List of File names - /// Returns response for not supported files - internal static string GetNotSupportedMessage(List sourceURL) - { - string response = string.Empty; - ResponseDetails responseDetails = new ResponseDetails(); - responseDetails.Status = ConstantStrings.FALSE; - responseDetails.FileNames = sourceURL; - response = new JavaScriptSerializer().Serialize(responseDetails); - return response; - } - - /// - /// Fetches the collection of list items satisfying the search criteria. - /// - /// ClientContext object - /// Item Id of the document - /// ListItemCollection object - internal static ListItemCollection GetListItemCollection(ClientContext clientContext, int itemid) - { - ListItemCollection listItems = null; - try - { - string briefcaseItemQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.BriefCaseItemsQuery, itemid); - listItems = Lists.GetData(clientContext, ServiceConstantStrings.OneDriveDocumentLibraryTitle, briefcaseItemQuery); - clientContext.Load(listItems); - clientContext.ExecuteQuery(); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return listItems; - } - - /// - /// Returns serialized response of the object. - /// - /// CommonResponse object - /// Serialized response of the object - internal static string GetSerializeResponse(object commonResponse) - { - string result = string.Empty; - try - { - result = new JavaScriptSerializer().Serialize(commonResponse); - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Obtains and returns MySite URL of logged-in user. - /// - /// Request Object - /// My Site URL of the user - internal static string GetPersonalURL(RequestObject requestObject) - { - string usersMySite = string.Empty; - string result = string.Empty; - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(ServiceConstantStrings.CentralRepositoryUrl), requestObject.RefreshToken)) - { - PeopleManager peopleManager = new PeopleManager(clientContext); - PersonProperties personProperties = peopleManager.GetMyProperties(); - ///// Load users my site URL - clientContext.Load(personProperties, p => p.PersonalUrl); - clientContext.ExecuteQuery(); - usersMySite = personProperties.PersonalUrl; - result = usersMySite; - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Returns a list of source URL based on type of briefcase operation. - /// - /// Client Context object - /// SyncDetails object - /// Indicates the type of operation to be performed - /// List of Source URLs - internal static List CheckSourceURL(ClientContext clientContext, SyncDetails syncDetails, int operationType) - { - List sourceURL = new List(); - try - { - foreach (int itemid in syncDetails.ItemId) - { - string briefcaseItemQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.BriefCaseItemsQuery, itemid); - ListItemCollection listItems = Lists.GetData(clientContext, ServiceConstantStrings.OneDriveDocumentLibraryTitle, briefcaseItemQuery); - clientContext.Load(listItems); - clientContext.ExecuteQuery(); - foreach (var listitem in listItems) - { - switch (operationType) - { - case 1: - if (string.IsNullOrEmpty(Convert.ToString(listitem[ServiceConstantStrings.OneDriveSiteColumn], CultureInfo.InvariantCulture))) - { - sourceURL.Add(Convert.ToString(listitem[ServiceConstantStrings.ColumnNameFileLeafRef], CultureInfo.InvariantCulture)); - } - break; - case 2: - sourceURL.Add(Convert.ToString(listitem[ServiceConstantStrings.OneDriveSiteColumn], CultureInfo.InvariantCulture)); - break; - case 3: - sourceURL.Add(Convert.ToString(listitem[ServiceConstantStrings.ColumnNameFileRef], CultureInfo.InvariantCulture)); - break; - } - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - sourceURL.Add(ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return sourceURL; - } - - /// - /// Uploads the document to OneDrive (Users MySite document library). - /// - /// Request Object containing SharePoint App Token - /// Collection of documents with data for each document - /// Collection of documents with path of source document - /// User's My site URL - /// Attachment URL. - /// Overwrite check - /// JSON string specifying path of OneDrive as success and false as failure - internal static string UploadtoBriefcase(RequestObject requestObject, Dictionary collectionOfAttachments, Dictionary collectionOfOriginalAttachments, string usersMySite, string[] allAttachmentUrl, int isOverwrite) - { - string status = ConstantStrings.FALSE; - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(usersMySite), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.Web web = clientContext.Web; - string contentType = ServiceConstantStrings.OneDriveContentTypeName; // Get Content Type - string contentTypegroup = ServiceConstantStrings.OneDriveContentTypeGroup; // Get Group of Content Type - List siteColumns = new List(new string[] { ServiceConstantStrings.OneDriveSiteColumn }); - bool isSiteColumnCreated = BriefcaseContentTypeHelperFunctions.CreateSiteColumn(clientContext, web, siteColumns); - if (isSiteColumnCreated) - { - bool isContentTypeCreated = BriefcaseContentTypeHelperFunctions.IsContentTypePresentCheck(clientContext, web, contentType, contentTypegroup, siteColumns); - if (isContentTypeCreated) - { - List list = web.Lists.GetByTitle(ServiceConstantStrings.OneDriveDocumentLibraryTitle); - string briefcaseFolderQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.BriefcaseFolderQuery, ServiceConstantStrings.LegalBriefcaseFolder); - ListItemCollection listItems = Lists.GetData(clientContext, ServiceConstantStrings.OneDriveDocumentLibraryTitle, briefcaseFolderQuery); - BriefcaseContentTypeHelperFunctions.SetContentType(clientContext, list, usersMySite); - string defaultContentTypeId = BriefcaseContentTypeHelperFunctions.SetOneDriveDefaultContentType(clientContext, list, contentType); - if (ConstantStrings.FALSE != defaultContentTypeId) - { - web.Update(); - if (0 == isOverwrite) - { - MailAttachmentDetails.CheckoutFailedPosition = 0; - status = BriefcaseUtilityHelperFunctions.NewDocumentToOneDrive(clientContext, collectionOfAttachments, collectionOfOriginalAttachments, allAttachmentUrl, web, usersMySite, defaultContentTypeId); - //// Undo check out in case of failure - //// undo checkout all documents from position MailAttachmentDetails.checkOutFailedPosition - BriefcaseHelperFunction.DiscardDocumentCheckout(requestObject, allAttachmentUrl); - } - else - { - MailAttachmentDetails.CheckoutFailedPosition = 0; - status = BriefcaseUtilityHelperFunctions.OverWriteDocument(collectionOfAttachments, collectionOfOriginalAttachments, usersMySite, status, clientContext, web, listItems, defaultContentTypeId); - string[] returnedStatus = status.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture)); - if (ConstantStrings.TRUE == returnedStatus[0]) - { - BriefcaseHelperFunction.DiscardDocumentCheckout(requestObject, allAttachmentUrl); - } - status = returnedStatus[1]; - } - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeAssignDefaultContentType, TextConstants.ErrorMessageAssignDefaultContentType); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeCreateSiteContentType, TextConstants.ErrorMessageCreateSiteContentType); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeCreateSiteColumn, TextConstants.ErrorMessageCreateSiteColumn); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - status += ConstantStrings.Semicolon + usersMySite; - } - return status; - } - - /// - /// Uploads the document to matter library. - /// - /// Request Object containing SharePoint App Token - /// URL of the source document - /// Content stream of the document - /// The version information. - /// The comments. - /// retain check out option - /// Content Type List for the Request Object containing SharePoint App Token - internal static string UploadtoMatter(RequestObject requestObject, string sourceUrl, Stream documentStream, int versionInfo, string comments, bool retainCheckOut) - { - string status = ConstantStrings.FALSE; - string result = ConstantStrings.FALSE; - try - { - if (null != requestObject) - { - ClientContext clientContext; - if (!string.IsNullOrWhiteSpace(sourceUrl) && null != documentStream) - { - string[] sourceUrlParts = sourceUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture)); - if (2 == sourceUrlParts.Length) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(sourceUrlParts[0]), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(sourceUrlParts[1]); - string documentLibraryName = BriefcaseHelperFunction.getLibraryName(clientContext, file); - string contentType = string.Empty; - contentType = BriefcaseContentTypeHelperFunctions.ContentTypeByName(requestObject, clientContext, file.Name, sourceUrl, 1, contentType, documentLibraryName); - string listContentType = BriefcaseContentTypeHelperFunctions.GetContentTypeList(requestObject, clientContext, sourceUrl, contentType, 1, documentLibraryName); - status = BriefcaseContentTypeHelperFunctions.GetContentTypeList(requestObject, clientContext, sourceUrl, contentType, 2, documentLibraryName); - FileSaveBinaryInformation fileSaveBinaryInformation = new FileSaveBinaryInformation(); - fileSaveBinaryInformation.ContentStream = documentStream; - file.SaveBinary(fileSaveBinaryInformation); - // Check if file is already checked out - if (file.CheckOutType == CheckOutType.None) - { - file.CheckOut(); - } - // Check the type of Check in to be performed - switch (versionInfo) - { - case 0: - file.CheckIn(comments, CheckinType.MinorCheckIn); - break; - case 1: - file.CheckIn(comments, CheckinType.MajorCheckIn); - break; - case 2: - file.CheckIn(comments, CheckinType.OverwriteCheckIn); - break; - } - // Load the Stream data for the file - clientContext.ExecuteQuery(); - status = BriefcaseContentTypeHelperFunctions.GetContentTypeList(requestObject, clientContext, sourceUrl, listContentType, 2, documentLibraryName); - // Check whether we need to retain checkout - if (retainCheckOut) - { - file.CheckOut(); - clientContext.ExecuteQuery(); - } - status = string.Concat(ConstantStrings.TRUE, ConstantStrings.Comma, ConstantStrings.Space, file.ServerRelativeUrl); - } - } - result = status; - } - else - { - status = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, TextConstants.MissingParametersMessage); - result = status; - } - } - } - catch (Exception exception) - { - status = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - result = status; - } - return result; - } - - /// - /// Returns the checkout operation status. - /// - /// Common response object - /// Status of the operation - /// Returns Common response object - internal static CommonResponse CheckoutOperationStatus(CommonResponse commonResponse, string status) - { - CommonResponse result = null; - try - { - if (ConstantStrings.TRUE == status.Split(ConstantStrings.Comma[0])[0]) - { - commonResponse.FileNames.Add(status.Split(ConstantStrings.Comma[0])[1]); - } - else - { - if (ServiceConstantStrings.AlreadyCheckOut == status.Split(ConstantStrings.Comma[0])[1]) - { - commonResponse.FileNames.Add(status.Split(ConstantStrings.Comma[0])[1]); - } - else - { - commonResponse.ErrorMessage += status.Split(ConstantStrings.Comma[0])[1]; - } - } - result = commonResponse; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - CommonResponse CheckoutOperationStatusError = new CommonResponse(); - result = CheckoutOperationStatusError; - } - return result; - } - - /// - /// Updates the operation status. - /// - /// Common response object - /// Status of the operation - /// Returns Common response object - internal static CommonResponse UpdateOperationStatus(CommonResponse commonResponse, string status) - { - CommonResponse result = null; - try - { - Dictionary responseJson = new JavaScriptSerializer().Deserialize>(status); - int code = Convert.ToInt32(responseJson[ConstantStrings.ResponseCode], CultureInfo.InvariantCulture); - if (code == 0) - { - commonResponse.Status.Add(true); - } - else - { - commonResponse.Status.Add(false); - commonResponse.ErrorMessage += Convert.ToString(responseJson[ConstantStrings.ResponseValue], CultureInfo.InvariantCulture); - } - result = commonResponse; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - CommonResponse UpdateOperationStatusError = new CommonResponse(); - result = UpdateOperationStatusError; - } - return result; - } - - /// - /// Detaches the operation. - /// - /// Common response object - /// Client context object - /// List object - /// List item collection object - /// Returns Common response object - internal static CommonResponse DetachOperation(CommonResponse commonResponse, ClientContext clientContext, List list, ListItemCollection listItems) - { - CommonResponse detachOperationResponse = new CommonResponse(); - try - { - ContentType targetDocumentSetContentType = BriefcaseContentTypeHelperFunctions.GetContentType(list, clientContext); - if (null != targetDocumentSetContentType) - { - foreach (var listItem in listItems) - { - listItem[ServiceConstantStrings.OneDriveSiteColumn] = string.Empty; - listItem[ConstantStrings.OneDriveContentTypeProperty] = Convert.ToString(targetDocumentSetContentType.Id, CultureInfo.InvariantCulture); - listItem.Update(); - clientContext.ExecuteQuery(); - commonResponse.Status.Add(true); - } - detachOperationResponse = commonResponse; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return detachOperationResponse; - } - - /// - /// Gets the memory stream with specified content. - /// - /// Error message to be displayed in file - /// Error file stream with error content - internal static MemoryStream ReturnErrorFile(string fileContent) - { - MemoryStream result = null; - try - { - byte[] errorMessage = System.Text.Encoding.UTF8.GetBytes(fileContent); - MemoryStream mailFile = new MemoryStream(errorMessage); - mailFile.Position = 0; - WebOperationContext.Current.OutgoingResponse.ContentType = ConstantStrings.MailMediaType; - WebOperationContext.Current.OutgoingResponse.Headers.Add(ConstantStrings.MailContentDispositionHeader); - result = mailFile; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - MemoryStream ReturnErrorFileError = new MemoryStream(); - result = ReturnErrorFileError; - } - return result; - } - - /// - /// Discards checkout from the documents - /// - /// Request object - /// List of attachment URL - /// Status of discarding check out - internal static string DiscardDocumentCheckout(RequestObject requestObject, string[] allAttachmentUrl) - { - int currentCount = 0; - string result = ConstantStrings.FALSE; - - try - { - foreach (string attachmentUrl in allAttachmentUrl) - { - if (!string.IsNullOrWhiteSpace(attachmentUrl)) - { - MailAttachmentDetails sendDocumentUrl = new MailAttachmentDetails(); - sendDocumentUrl.FullUrl = attachmentUrl; - if (currentCount >= MailAttachmentDetails.CheckoutFailedPosition) - { - result = DiscardCheckout(requestObject, sendDocumentUrl); - } - } - currentCount++; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return result; - } - - /// - /// Discard individual document from Matter Center - /// - /// Request object - /// Attachment object - /// Status of discarding individual document - internal static string DiscardCheckout(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails) - { - string result = ConstantStrings.FALSE; - ClientContext clientContext; - try - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(mailAttachmentDetails.FullUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(mailAttachmentDetails.FullUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].TrimEnd(ConstantStrings.Semicolon[0])); - clientContext.Load(file); - clientContext.ExecuteQuery(); - if (file.CheckOutType != CheckOutType.None) - { - file.UndoCheckOut(); - result = string.Concat(ConstantStrings.TRUE, ConstantStrings.Comma, ConstantStrings.Space, file.Name); - } - clientContext.ExecuteQuery(); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return result; - } - - /// - /// Get library title using parent list - /// - /// Client context object - /// file object of Microsoft.Sharepoint.Client.File - /// Title of the document library - internal static string getLibraryName(ClientContext clientContext, Microsoft.SharePoint.Client.File file) - { - string result = String.Empty; - try - { - clientContext.Load(file); - List documentLibrary = file.ListItemAllFields.ParentList; - clientContext.Load(documentLibrary, libraryTitle => libraryTitle.Title); - clientContext.ExecuteQuery(); - result = documentLibrary.Title; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseUtilityHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseUtilityHelperFunctions.cs deleted file mode 100644 index dae7fbf9..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/BriefcaseUtilityHelperFunctions.cs +++ /dev/null @@ -1,221 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-swmirj -// Created : 04-06-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides utility methods involved in briefcase operations. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.CommonHelper -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Reflection; - #endregion - - /// - /// Provide utility methods involved in briefcase operations. - /// - internal static class BriefcaseUtilityHelperFunctions - { - - /// - /// Overwrite document in OneDrive, if already exists (Users MySite Document library). - /// - /// Collection of documents with data for each document - /// Collection of documents with path of source document - /// User's My site URL - /// Sets status for Overwrite check - /// Client context object for connection between SP & client - /// Object of site - /// Object for ListItems Collection - /// Id of content type - ///Returns status of operation to calling function - internal static string OverWriteDocument(Dictionary collectionOfAttachments, Dictionary collectionOfOriginalAttachments, string usersMySite, string status, ClientContext clientContext, Microsoft.SharePoint.Client.Web web, ListItemCollection listItems, string defaultContentTypeId) - { - string fileNameKey = string.Empty; - int documentCount = 0; - try - { - foreach (string key in collectionOfAttachments.Keys) - { - fileNameKey = key.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]; - foreach (ListItem item in listItems) - { - clientContext.Load(item); - clientContext.ExecuteQuery(); - Folder folder = clientContext.Web.GetFolderByServerRelativeUrl(Convert.ToString(item.FieldValues[ServiceConstantStrings.ColumnNameFileRef], CultureInfo.InvariantCulture)); - FileCollection files = folder.Files; - clientContext.Load(folder); - clientContext.Load(files); - clientContext.ExecuteQuery(); - foreach (Microsoft.SharePoint.Client.File file in files) - { - if (file.Name == fileNameKey) - { - file.DeleteObject(); - clientContext.ExecuteQuery(); - SendDocumentToOneDrive(web, usersMySite, fileNameKey, collectionOfAttachments[key], collectionOfOriginalAttachments[key], defaultContentTypeId); - break; - } - } - } - documentCount++; - } - clientContext.ExecuteQuery(); - status = string.Concat(usersMySite, ServiceConstantStrings.OneDriveDocumentLibraryTitle, ConstantStrings.Semicolon, documentCount, ConstantStrings.Semicolon, collectionOfAttachments.Count); - } - catch (Exception exception) - { - status = ConstantStrings.TRUE + ConstantStrings.DOLLAR + Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Sends document to user's OneDrive. - /// - /// Object of site - /// User's My site URL - /// Key parameter - /// Attachments Collection - /// Original attachments collection - /// Content type id of default content type - internal static void SendDocumentToOneDrive(Microsoft.SharePoint.Client.Web web, string usersMySite, string key, Stream collectionOfAttachments, string collectionOfOriginalAttachments, string contentTypeId) - { - try - { - Microsoft.SharePoint.Client.File file = web.GetFolderByServerRelativeUrl(string.Concat(usersMySite, ServiceConstantStrings.OneDriveDocumentLibraryTitle, ConstantStrings.ForwardSlash, ServiceConstantStrings.LegalBriefcaseFolder)).Files.Add(new FileCreationInformation() - { - Url = key, - Overwrite = true, - ContentStream = collectionOfAttachments - }); - file.ListItemAllFields.ParseAndSetFieldValue(ServiceConstantStrings.OneDriveSiteColumn, collectionOfOriginalAttachments); - file.ListItemAllFields[ConstantStrings.OneDriveContentTypeProperty] = contentTypeId; - file.ListItemAllFields.Update(); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Sends new documents to user's OneDrive. - /// - /// SP client context - /// Dictionary object containing attachment URLs and their stream data - /// Dictionary object containing attachment URLs - /// A string array containing all the attachment URLs - /// Object of site - /// My Site URL of the user - /// Default content type Id - /// JSON string specifying success or failure for new documents and URL of the files that already exist in the user's OneDrive - internal static string NewDocumentToOneDrive(ClientContext clientContext, Dictionary collectionOfAttachments, Dictionary collectionOfOriginalAttachments, string[] allAttachmentUrl, Microsoft.SharePoint.Client.Web web, string usersMySite, string defaultContentTypeId) - { - string status = ConstantStrings.FALSE, -legalBriefcaseFolderQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.BriefcaseFolderContentsQuery, ServiceConstantStrings.LegalBriefcaseFolder); - try - { - ListItemCollection listItemsColl = Lists.GetData(clientContext, ServiceConstantStrings.OneDriveDocumentLibraryTitle, legalBriefcaseFolderQuery); - clientContext.Load( - listItemsColl, - items => items.Include( - item => item.DisplayName, - item => item.FileSystemObjectType, - item => item.Folder.Files.Include( - files => files.Name))); - clientContext.ExecuteQuery(); - status = SendNewDocumentToOneDrive(clientContext, listItemsColl, collectionOfAttachments, collectionOfOriginalAttachments, allAttachmentUrl, web, usersMySite, defaultContentTypeId); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Send new documents to user's OneDrive. - /// - /// SP client context - /// List item collection of Legal Briefcase folder - /// Dictionary object containing attachment URLs and their stream data - /// Dictionary object containing attachment URLs - /// A string array containing all the attachment URLs - /// Object of site - /// My Site URL of the user - /// Default content type Id - /// JSON string specifying success or failure for new documents and URL of the files that already exist in the user's OneDrive - internal static string SendNewDocumentToOneDrive(ClientContext clientContext, ListItemCollection listItemsColl, Dictionary collectionOfAttachments, Dictionary collectionOfOriginalAttachments, string[] allAttachmentUrl, Microsoft.SharePoint.Client.Web web, string usersMySite, string defaultContentTypeId) - { - string status = ConstantStrings.FALSE; - string result = string.Empty; - try - { - status = SendIndividualDocument(clientContext, collectionOfAttachments, listItemsColl, allAttachmentUrl, web, usersMySite, collectionOfOriginalAttachments, defaultContentTypeId, status); - result = status; - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Sends individual document to OneDrive - /// - /// SP client context - /// Dictionary object containing attachment URLs and their stream data - /// List item collection of Legal Briefcase folder - /// A string array containing all the attachment URLs - /// Object of site - /// My Site URL of the user - /// Dictionary object containing attachment URLs - /// Default content type Id - /// Status of documents sent to OneDrive - /// Status of documents sent to OneDrive - internal static string SendIndividualDocument(ClientContext clientContext, Dictionary collectionOfAttachments, ListItemCollection listItemsColl, string[] allAttachmentUrl, Microsoft.SharePoint.Client.Web web, string usersMySite, Dictionary collectionOfOriginalAttachments, string defaultContentTypeId, string status) - { - int documentCount = 0, count = 0; - string fileNameKey = string.Empty; - string overwriteDocumentURLs = string.Empty; - foreach (string key in collectionOfAttachments.Keys) - { - fileNameKey = key.Split(new string[] { ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries)[0]; - var selectedItems = from li in listItemsColl.Cast() - from files in li.Folder.Files - where files.Name.ToUpperInvariant() == fileNameKey.ToUpperInvariant() - select files; - if (selectedItems.FirstOrDefault() != null) - { - overwriteDocumentURLs += allAttachmentUrl[count] + ConstantStrings.Semicolon; - } - else - { - SendDocumentToOneDrive(web, usersMySite, fileNameKey, collectionOfAttachments[key], collectionOfOriginalAttachments[key], defaultContentTypeId); - documentCount++; - } - count++; - web.Update(); - clientContext.ExecuteQuery(); - MailAttachmentDetails.CheckoutFailedPosition++; - status = string.Concat(usersMySite, ServiceConstantStrings.OneDriveDocumentLibraryTitle, ConstantStrings.Semicolon, documentCount, ConstantStrings.Semicolon, collectionOfAttachments.Count, ConstantStrings.Semicolon, overwriteDocumentURLs); - } - return status; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/EditMatterHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/EditMatterHelperFunctions.cs deleted file mode 100644 index caecd6a0..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/EditMatterHelperFunctions.cs +++ /dev/null @@ -1,872 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-akvira -// Created : 29-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides helper methods to update matter properties. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.HelperClasses -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.Security.Application; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Utilities; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - #endregion - - /// - /// Provides helper methods to update matter properties. - /// - internal static class EditMatterHelperFunctions - { - /// - /// Checks if the property exists in property bag. Returns the value for the property from property bag. - /// - /// Dictionary object containing matter property bag key/value pairs - /// Key to check in dictionary - /// Property bag value for - internal static string GetStampPropertyValue(Dictionary stampedPropertyValues, string key) - { - string result = string.Empty; - if (stampedPropertyValues.ContainsKey(key)) - { - result = System.Web.HttpUtility.HtmlDecode(Convert.ToString(stampedPropertyValues[key], CultureInfo.InvariantCulture)); - } - - // This is just to check for null value in key, if exists - return (!string.IsNullOrWhiteSpace(result)) ? result : string.Empty; - } - - /// - /// Retrieves the users assigned to matter. - /// - /// Users tagged with matter in property bag - /// Users assigned to matter - internal static List> GetMatterAssignedUsers(string matterCenterUsers) - { - List> matterCenterUserCollection = new List>(); - - if (!string.IsNullOrWhiteSpace(matterCenterUsers)) - { - List userCollection = matterCenterUsers.Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries).ToList(); - foreach (string userRow in userCollection) - { - List users = userRow.Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries).ToList(); - matterCenterUserCollection.Add(users); - } - } - return matterCenterUserCollection; - } - - /// - /// Extracts matter details from matter library property bag. - /// - /// Dictionary object containing matter property bag key/value pairs - /// Matter details from matter library property bag - internal static MatterDetails ExtractMatterDetails(Dictionary stampedPropertyValues) - { - MatterDetails matterDetails = new MatterDetails() - { - PracticeGroup = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyPracticeGroup), - AreaOfLaw = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyAreaOfLaw), - SubareaOfLaw = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertySubAreaOfLaw), - ResponsibleAttorney = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyResponsibleAttorney), - TeamMembers = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyTeamMembers), - UploadBlockedUsers = GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyBlockedUploadUsers).Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries).ToList() - }; - return matterDetails; - } - - /// - /// Fetches matter library stamped properties. - /// - /// ClientContext object - /// Library name - /// Stamped properties - internal static PropertyValues FetchMatterStampedProperties(ClientContext clientContext, string libraryName) - { - PropertyValues stampedProperties = null; - try - { - if (null != clientContext && !string.IsNullOrWhiteSpace(libraryName)) - { - stampedProperties = clientContext.Web.Lists.GetByTitle(libraryName).RootFolder.Properties; - clientContext.Load(stampedProperties); - clientContext.ExecuteQuery(); - } - } - catch (Exception) - { - throw; //// This will transfer control to catch block of parent function. - } - - return stampedProperties; - } - - /// - /// Updates the matter stamped properties with new details for user permissions. - /// - /// ClientContext object - /// MatterDetails object - /// Matter object - /// Matter stamped properties - /// Page opened in edit mode - /// Status of operation - internal static string UpdateMatterStampedProperties(ClientContext clientContext, MatterDetails matterDetails, Matter matter, PropertyValues matterStampedProperties, bool isEditMode) - { - string result = ConstantStrings.FALSE; - try - { - if (null != clientContext && null != matter && null != matterDetails && (0 < matterStampedProperties.FieldValues.Count)) - { - Dictionary propertyList = new Dictionary(); - - // Get existing stamped properties - string stampedUsers = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyMatterCenterUsers); - string stampedUserEmails = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyMatterCenterUserEmails); - string stampedPermissions = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyMatterCenterPermissions); - string stampedRoles = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyMatterCenterRoles); - string stampedResponsibleAttorneys = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyResponsibleAttorney); - string stampedResponsibleAttorneysEmail = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyResponsibleAttorneyEmail); - string stampedTeamMembers = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyTeamMembers); - string stampedBlockedUploadUsers = GetStampPropertyValue(matterStampedProperties.FieldValues, ServiceConstantStrings.StampedPropertyBlockedUploadUsers); - - string currentPermissions = string.Join(ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, matter.Permissions.Where(user => !string.IsNullOrWhiteSpace(user))); - string currentRoles = string.Join(ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, matter.Roles.Where(user => !string.IsNullOrWhiteSpace(user))); - string currentBlockedUploadUsers = string.Join(ConstantStrings.Semicolon, matterDetails.UploadBlockedUsers.Where(user => !string.IsNullOrWhiteSpace(user))); - string currentUsers = GetMatterAssignedUsers(matter); - string currentUserEmails = GetMatterAssignedUsersEmail(clientContext, matter); - - string finalMatterPermissions = string.IsNullOrWhiteSpace(stampedPermissions) || isEditMode ? currentPermissions : string.Concat(stampedPermissions, ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, currentPermissions); - string finalMatterRoles = string.IsNullOrWhiteSpace(stampedRoles) || isEditMode ? currentRoles : string.Concat(stampedRoles, ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, currentRoles); - string finalResponsibleAttorneys = string.IsNullOrWhiteSpace(stampedResponsibleAttorneys) || isEditMode ? matterDetails.ResponsibleAttorney : string.Concat(stampedResponsibleAttorneys, ConstantStrings.Semicolon, matterDetails.ResponsibleAttorney); - string finalResponsibleAttorneysEmail = string.IsNullOrWhiteSpace(stampedResponsibleAttorneysEmail) || isEditMode ? matterDetails.ResponsibleAttorneyEmail : string.Concat(stampedResponsibleAttorneysEmail, ConstantStrings.Semicolon, matterDetails.ResponsibleAttorneyEmail); - string finalTeamMembers = string.IsNullOrWhiteSpace(stampedTeamMembers) || isEditMode ? matterDetails.TeamMembers : string.Concat(stampedTeamMembers, ConstantStrings.Semicolon, matterDetails.TeamMembers); - string finalMatterCenterUsers = string.IsNullOrWhiteSpace(stampedUsers) || isEditMode ? currentUsers : string.Concat(stampedUsers, ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, currentUsers); - string finalMatterCenterUserEmails = string.IsNullOrWhiteSpace(stampedUserEmails) || isEditMode ? currentUserEmails : string.Concat(stampedUserEmails, ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, currentUserEmails); - string finalBlockedUploadUsers = string.IsNullOrWhiteSpace(stampedBlockedUploadUsers) || isEditMode ? currentBlockedUploadUsers : string.Concat(stampedBlockedUploadUsers, ConstantStrings.Semicolon, currentBlockedUploadUsers); - - propertyList.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorney, Encoder.HtmlEncode(finalResponsibleAttorneys)); - propertyList.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorneyEmail, Encoder.HtmlEncode(finalResponsibleAttorneysEmail)); - propertyList.Add(ServiceConstantStrings.StampedPropertyTeamMembers, Encoder.HtmlEncode(finalTeamMembers)); - propertyList.Add(ServiceConstantStrings.StampedPropertyBlockedUploadUsers, Encoder.HtmlEncode(finalBlockedUploadUsers)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterRoles, Encoder.HtmlEncode(finalMatterRoles)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterPermissions, Encoder.HtmlEncode(finalMatterPermissions)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterUsers, Encoder.HtmlEncode(finalMatterCenterUsers)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterUserEmails, Encoder.HtmlEncode(finalMatterCenterUserEmails)); - - Lists.SetPropertBagValuesForList(clientContext, matterStampedProperties, matter.Name, propertyList); - result = ConstantStrings.TRUE; - } - } - catch (Exception) - { - throw; //// This will transfer control to catch block of parent function. - } - return result; - } - - /// - /// Converts the matter users in a form that can be stamped to library. - /// - /// Matter object - /// Users that can be stamped - private static string GetMatterAssignedUsers(Matter matter) - { - string currentUsers = string.Empty; - string separator = string.Empty; - if (null != matter && 0 < matter.AssignUserNames.Count) - { - foreach (IList userNames in matter.AssignUserNames) - { - currentUsers += separator + string.Join(ConstantStrings.Semicolon, userNames.Where(user => !string.IsNullOrWhiteSpace(user))); - separator = ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR; - } - } - return currentUsers; - } - - /// - /// Converts the project users emails in a form that can be stamped to library. - /// - /// ClientContext object - /// Matter object - /// Users that can be stamped - private static string GetMatterAssignedUsersEmail(ClientContext clientContext, Matter matter) - { - string currentUsers = string.Empty; - string separator = string.Empty; - if (null != matter && 0 < matter.AssignUserEmails.Count) - { - foreach (IList userNames in matter.AssignUserEmails) - { - List userEmails = new List(); - if (null != clientContext && null != userNames) - { - foreach (string userName in userNames) - { - if (!string.IsNullOrWhiteSpace(userName)) - { - if (ValidationHelperFunctions.ValidateExternalUserInput(userName)) - { - userEmails.Add(userName); - } - else - { - User user = clientContext.Web.EnsureUser(userName.Trim()); - ///// Only Fetch the User ID which is required - clientContext.Load(user, u => u.Email); - clientContext.ExecuteQuery(); - ///// Add the user to the first element of the FieldUserValue array. - userEmails.Add(user.Email); - } - } - } - currentUsers += separator + string.Join(ConstantStrings.Semicolon, userEmails); - separator = ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR; - } - } - } - - return currentUsers; - } - - - /// - /// Fetches the effective permissions of users present in matter library. - /// - /// ClientContext object - /// Matter library name - /// List permissions - internal static IEnumerable FetchUserPermission(ClientContext clientContext, string matterLibrary) - { - IEnumerable userPermissionCollection = null; - try - { - if (null != clientContext && !string.IsNullOrWhiteSpace(matterLibrary)) - { - List list = clientContext.Web.Lists.GetByTitle(matterLibrary); - userPermissionCollection = clientContext.LoadQuery(list.RoleAssignments.Include(listRoleAssignment => listRoleAssignment.PrincipalId, listRoleAssignment => listRoleAssignment.Member, listRoleAssignment => listRoleAssignment.Member.Title, listRoleAssignment => listRoleAssignment.Member.PrincipalType, listRoleAssignment => listRoleAssignment.RoleDefinitionBindings.Include(userRoles => userRoles.BasePermissions, userRoles => userRoles.Name, userRoles => userRoles.Id)).Where(listUsers => (PrincipalType.User == listUsers.Member.PrincipalType) || (PrincipalType.SecurityGroup == listUsers.Member.PrincipalType))); - clientContext.ExecuteQuery(); - } - } - catch (Exception) - { - throw; //// This will transfer control to catch block of parent function. - } - return userPermissionCollection; - } - - /// - /// Remove old users and assign permissions to new users. - /// - /// ClientContext object - /// Matter object - /// List of users to remove - /// Title of logged-in user - /// ListItem or list - /// List Name - /// List item id - /// Add/ Edit mode - /// - internal static string UpdatePermission(ClientContext clientContext, Matter matter, List users, string loggedInUserTitle, bool isListItem, string listName, int matterLandingPageId, bool isEditMode) - { - bool result = false; - try - { - if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) - { - if (isEditMode) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, isListItem, listName, matterLandingPageId); - } - // Add permission - if (!isListItem) - { - result = Lists.SetPermission(clientContext, matter.AssignUserEmails, matter.Permissions, listName); - } - else - { - if (0 <= matterLandingPageId) - { - result = Lists.SetItemPermission(clientContext, matter.AssignUserEmails, ServiceConstantStrings.MatterLandingPageRepositoryName, matterLandingPageId, matter.Permissions); - } - } - } - } - catch (Exception) - { - throw; - } - // To avoid the invalid symbol error while parsing the JSON, return the response in lower case - return Convert.ToString(result, CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentCulture); - } - - /// - /// Removes the users' permission from list or list item. - /// - /// ClientContext object - /// List of users - /// Title of logged-in user - /// ListItem or list - /// Name of the List - /// List item id - private static void RemoveSpecificUsers(ClientContext clientContext, List usersToRemove, string loggedInUserTitle, bool isListItem, string listName, int matterLandingPageId) - { - try - { - ListItem listItem = null; - RoleAssignmentCollection roleCollection = null; - Microsoft.SharePoint.Client.Web web = clientContext.Web; - List list = web.Lists.GetByTitle(listName); - clientContext.Load(list); - clientContext.ExecuteQuery(); - if (0 < usersToRemove.Count) - { - if (isListItem) - { - // Fetch the list item - if (0 <= matterLandingPageId) - { - listItem = list.GetItemById(matterLandingPageId); - clientContext.Load(listItem, listItemProperties => listItemProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, roleAssignmentProperties => roleAssignmentProperties.Member.Title, roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions)).Where(listUsers => (PrincipalType.User == listUsers.Member.PrincipalType) || (PrincipalType.SecurityGroup == listUsers.Member.PrincipalType || (PrincipalType.SharePointGroup == listUsers.Member.PrincipalType)))); - clientContext.ExecuteQuery(); - roleCollection = listItem.RoleAssignments; - } - } - else - { - clientContext.Load(list, listProperties => listProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, roleAssignmentProperties => roleAssignmentProperties.Member.Title, roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions)).Where(listUsers => (PrincipalType.User == listUsers.Member.PrincipalType) || (PrincipalType.SecurityGroup == listUsers.Member.PrincipalType) || (PrincipalType.SharePointGroup == listUsers.Member.PrincipalType))); - clientContext.ExecuteQuery(); - roleCollection = list.RoleAssignments; - } - - if (null != roleCollection && 0 < roleCollection.Count && 0 < usersToRemove.Count) - { - foreach (string user in usersToRemove) - { - foreach (RoleAssignment role in roleCollection) - { - List roleDefinationList = new List(); - foreach (RoleDefinition roleDef in role.RoleDefinitionBindings) - { - // Removing permission for all the user except current user with full control - // Add those users in list, then traverse the list and removing all users from that list - if (PrincipalType.SharePointGroup == role.Member.PrincipalType) - { - roleDefinationList.Add(roleDef); - } - else - { - string email = ((User)role.Member).Email; - if (email == user && !((email == loggedInUserTitle) && (roleDef.Name == ConstantStrings.EditMatterAllowedPermissionLevel))) - { - roleDefinationList.Add(roleDef); - } - } - } - foreach (RoleDefinition roleDef in roleDefinationList) - { - role.RoleDefinitionBindings.Remove(roleDef); - } - role.Update(); - } - } - } - clientContext.ExecuteQuery(); - } - } - catch (Exception) - { - throw; - } - - } - - /// - /// Gets the display name of users having permission on library. - /// - /// Users having permission on library - /// - internal static List RetrieveMatterUsers(IEnumerable userPermissionOnLibrary) - { - List users = new List(); - try - { - if (null != userPermissionOnLibrary && 0 < userPermissionOnLibrary.Count()) - { - foreach (RoleAssignment roles in userPermissionOnLibrary) - { - users.Add(((User)roles.Member).Email); - } - } - } - catch (Exception) - { - throw; - } - return users; - } - - /// - /// Reverts the permission of users from matter, OneNote, Calendar libraries and matter landing page - /// - /// Request object - /// Client object - /// Matter object - /// ClientContext object - /// MatterRevertObjectList object - /// Logged-in user title - /// Old library users - /// List item id - /// Add/ Edit mode - /// Status of operation - internal static string RevertMatterUpdates(RequestObject requestObject, Client client, Matter matter, ClientContext clientContext, MatterRevertList matterRevertListObject, string loggedInUserTitle, IEnumerable oldUserPermissions, int matterLandingPageId, bool isEditMode) - { - bool result = false; - try - { - if (null != requestObject && null != client && null != matter && null != clientContext && null != matterRevertListObject) - { - List users = new List(); - users = matter.AssignUserEmails.SelectMany(user => user).Distinct().ToList(); - - // Remove recently added users - if (null != matterRevertListObject.MatterLibrary) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterLibrary, -1); - } - if (null != matterRevertListObject.MatterCalendar) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterCalendar, -1); - } - if (null != matterRevertListObject.MatterOneNoteLibrary) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterOneNoteLibrary, -1); - } - if (null != matterRevertListObject.MatterTask) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterTask, -1); - } - if (null != matterRevertListObject.MatterSitePages) - { - RemoveSpecificUsers(clientContext, users, loggedInUserTitle, true, matterRevertListObject.MatterSitePages, matterLandingPageId); - } - - if (isEditMode) - { - Matter matterRevertUserPermission = PrepareUserPermission(oldUserPermissions); - if (null != matterRevertListObject.MatterLibrary) - { - result = Lists.SetPermission(clientContext, matterRevertUserPermission.AssignUserEmails, matterRevertUserPermission.Permissions, matterRevertListObject.MatterLibrary); - } - if (null != matterRevertListObject.MatterOneNoteLibrary) - { - result = Lists.SetPermission(clientContext, matterRevertUserPermission.AssignUserEmails, matterRevertUserPermission.Permissions, matterRevertListObject.MatterOneNoteLibrary); - } - if (null != matterRevertListObject.MatterCalendar) - { - result = Lists.SetPermission(clientContext, matterRevertUserPermission.AssignUserEmails, matterRevertUserPermission.Permissions, matterRevertListObject.MatterCalendar); - } - if (null != matterRevertListObject.MatterTask) - { - result = Lists.SetPermission(clientContext, matterRevertUserPermission.AssignUserEmails, matterRevertUserPermission.Permissions, matterRevertListObject.MatterTask); - } - if (null != matterRevertListObject.MatterSitePages && 0 <= matterLandingPageId) - { - result = Lists.SetItemPermission(clientContext, matterRevertUserPermission.AssignUserEmails, ServiceConstantStrings.MatterLandingPageRepositoryName, matterLandingPageId, matterRevertUserPermission.Permissions); - } - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - // To avoid the invalid symbol error while parsing the JSON, return the response in lower case - return Convert.ToString(result, CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentUICulture); - } - - /// - /// Fetches the users to remove permission. - /// - /// Users having permission on library - /// Matter object containing user name and permissions - internal static Matter PrepareUserPermission(IEnumerable userPermissions) - { - Matter matterUserPermission = new Matter(); - matterUserPermission.AssignUserEmails = new List>(); - matterUserPermission.Permissions = new List(); - - if (null != userPermissions && 0 < userPermissions.Count()) - { - foreach (RoleAssignment userPermission in userPermissions) - { - foreach (RoleDefinition roleDefinition in userPermission.RoleDefinitionBindings) - { - matterUserPermission.AssignUserEmails.Add(new List { ((User)userPermission.Member).Email }); - matterUserPermission.Permissions.Add(roleDefinition.Name); - } - } - } - return matterUserPermission; - } - - /// - /// Checks if security group exists in team members list. - /// - /// ClientContext object - /// Matter object - /// Security group existence - internal static string CheckSecurityGroupInTeamMembers(ClientContext clientContext, Matter matter, IList userId) - { - string result = ConstantStrings.TRUE; - int teamMembersRowCount, securityGroupRowNumber = -1; // Blocked user field has security group - List> teamMemberPrincipalCollection = new List>(); - if (null != clientContext && null != matter && null != matter.AssignUserEmails && null != matter.BlockUserNames) - { - try - { - teamMembersRowCount = matter.AssignUserEmails.Count; - List blockedUsers = matter.BlockUserNames.Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); - if (0 < teamMembersRowCount) - { - securityGroupRowNumber = -2; // Invalid user - for (int iterator = 0; iterator < teamMembersRowCount; iterator++) - { - List currentRowTeamMembers = matter.AssignUserEmails[iterator].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); - foreach (string teamMember in currentRowTeamMembers) - { - Principal teamMemberPrincipal = clientContext.Web.EnsureUser(teamMember); - clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => teamMemberPrincipalProperties.PrincipalType, teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); - teamMemberPrincipalCollection.Add(new Tuple(iterator, teamMemberPrincipal)); - } - } - } - if (0 < blockedUsers.Count) - { - foreach (string blockedUser in blockedUsers) - { - Principal teamMemberPrincipal = clientContext.Web.EnsureUser(blockedUser); - clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => teamMemberPrincipalProperties.PrincipalType, teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); - teamMemberPrincipalCollection.Add(new Tuple(-1, teamMemberPrincipal)); - } - } - clientContext.ExecuteQuery(); - foreach (Tuple teamMemberPrincipal in teamMemberPrincipalCollection) - { - Principal currentTeamMemberPrincipal = teamMemberPrincipal.Item2; - if (currentTeamMemberPrincipal.PrincipalType == PrincipalType.SecurityGroup) - { - securityGroupRowNumber = teamMemberPrincipal.Item1; - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.ErrorCodeSecurityGroupExists, ServiceConstantStrings.ErrorMessageSecurityGroupExists + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + userId[securityGroupRowNumber]); - break; - } - } - } - catch (Exception) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + userId[securityGroupRowNumber]); - } - } - else - { - result = ConstantStrings.FALSE; - } - return result; - } - - /// - /// Checks users in team members list. - /// - /// ClientContext object - /// Matter object - /// Id of the user's row - /// Security group existence - internal static string ValidateTeamMembers(ClientContext clientContext, Matter matter, IList userId) - { - string result = string.Empty; - bool isInvalidUser = false; - int iCounter = 0, teamMembersRowCount = matter.AssignUserEmails.Count(), iCount = 0; - List teamMemberPrincipalCollection = new List(); - try - { - for (iCounter = 0; iCounter < teamMembersRowCount; iCounter++) - { - IList userList = matter.AssignUserEmails[iCounter].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); - IList userNameList = matter.AssignUserNames[iCounter].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); - foreach (string userName in userList) - { - Principal teamMemberPrincipal = clientContext.Web.EnsureUser(userName.Trim()); - clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); - teamMemberPrincipalCollection.Add(teamMemberPrincipal); - } - clientContext.ExecuteQuery(); - //// Check whether the name entered by the user and the name resolved by SharePoint is same. - foreach (string teamMember in userNameList) - { - if (!string.Equals(teamMember.Trim(), teamMemberPrincipalCollection[iCount].Title.Trim(), StringComparison.OrdinalIgnoreCase)) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + userId[iCounter]); - isInvalidUser = true; - break; - } - iCount++; - } - if (isInvalidUser) - { - break; // To break the outer loop as there is an invalid user - } - } - } - catch (Exception) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + userId[iCounter]); - } - return result; - } - - /// - /// Fetches the user name updating the matter. - /// - /// Client context object - /// Logged-in user name - internal static string GetUserUpdatingMatter(ClientContext clientContext) - { - string userName = string.Empty; - try - { - Users loggedInUser = UIUtility.GetLoggedInUserDetails(clientContext); - userName = loggedInUser.Email; - } - catch (Exception) - { - throw; - } - return userName; - } - - /// - /// Fetches Matter Name from Matter Stamp properties. - /// - /// Client context object - /// Matter Title - /// Matter Name related to Matter Title - internal static string GetMatterName(ClientContext clientContext, string matterName) - { - try - { - - PropertyValues properties = clientContext.Web.Lists.GetByTitle(matterName).RootFolder.Properties; - clientContext.Load(properties); - clientContext.ExecuteQuery(); - return properties.FieldValues.ContainsKey(ServiceConstantStrings.StampedPropertyMatterGUID) ? System.Web.HttpUtility.HtmlDecode(Convert.ToString(properties.FieldValues[ServiceConstantStrings.StampedPropertyMatterGUID], CultureInfo.InvariantCulture)) : matterName; - } - catch (Exception) - { - throw; - } - } - - /// - /// Assign or Remove Full Control base on parameter given. - /// - /// Client context object - /// Matter object - /// Name of logged in user - /// ID of the list item - /// List of existed list - /// Flag to determine Assign or Remove Permission - /// Flag to determine user has Full Permission or not - internal static void AssignRemoveFullControl(ClientContext clientContext, Matter matter, string loggedInUser, int listItemId, List listExists, bool assignFullControl, bool hasFullPermission) - { - IList> currentUser = new List>(); - IList currentLoggedInUser = new List() { loggedInUser }; - currentUser.Add(currentLoggedInUser); - - IList permission = new List() { ConstantStrings.EditMatterAllowedPermissionLevel }; - - if (assignFullControl) - { - //Assign full control to Matter - if (listExists.Contains(matter.Name)) - { - Lists.SetPermission(clientContext, currentUser, permission, matter.Name); - } - //Assign full control to OneNote - if (listExists.Contains(matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix)) - { - Lists.SetPermission(clientContext, currentUser, permission, matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix); - } - // Assign full control to Task list - if (listExists.Contains(matter.Name + ServiceConstantStrings.TaskNameSuffix)) - { - Lists.SetPermission(clientContext, currentUser, permission, matter.Name + ServiceConstantStrings.TaskNameSuffix); - } - //Assign full control to calendar - if (listExists.Contains(matter.Name + ServiceConstantStrings.CalendarNameSuffix)) - { - Lists.SetPermission(clientContext, currentUser, permission, matter.Name + ServiceConstantStrings.CalendarNameSuffix); - } - // Assign full control to Matter Landing page - if (0 <= listItemId) - { - Lists.SetItemPermission(clientContext, currentUser, ServiceConstantStrings.MatterLandingPageRepositoryName, listItemId, permission); - } - } - else - { - if (!hasFullPermission) - { - //Remove full control to Matter - if (listExists.Contains(matter.Name)) - { - RemoveFullControl(clientContext, matter.Name, loggedInUser, false, -1); - } - //Remove full control to OneNote - if (listExists.Contains(matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix)) - { - RemoveFullControl(clientContext, matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix, loggedInUser, false, -1); - } - // Remove full control to Task list - if (listExists.Contains(matter.Name + ServiceConstantStrings.TaskNameSuffix)) - { - RemoveFullControl(clientContext, matter.Name + ServiceConstantStrings.TaskNameSuffix, loggedInUser, false, -1); - } - //Remove full control to calendar - if (listExists.Contains(matter.Name + ServiceConstantStrings.CalendarNameSuffix)) - { - RemoveFullControl(clientContext, matter.Name + ServiceConstantStrings.CalendarNameSuffix, loggedInUser, false, -1); - } - if (0 <= listItemId) - { - RemoveFullControl(clientContext, ServiceConstantStrings.MatterLandingPageRepositoryName, loggedInUser, true, listItemId); - } - } - - } - - } - - /// - /// Remove Full Permission. - /// - /// Client context object - /// Name of the list - /// Name of logged in User - internal static void RemoveFullControl(ClientContext clientContext, string listName, string currentLoggedInUser, bool isListItem, int matterLandingPageId) - { - ListItem listItem = null; - RoleAssignmentCollection roleCollection = null; - List list = clientContext.Web.Lists.GetByTitle(listName); - clientContext.Load(list); - clientContext.ExecuteQuery(); - if (isListItem) - { - // Fetch the list item - if (0 <= matterLandingPageId) - { - listItem = list.GetItemById(matterLandingPageId); - clientContext.Load(listItem, listProperties => listProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, roleAssignmentProperties => roleAssignmentProperties.Member.Title, roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions))); - clientContext.ExecuteQuery(); - roleCollection = listItem.RoleAssignments; - } - } - else - { - clientContext.Load(list, listProperties => listProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, roleAssignmentProperties => roleAssignmentProperties.Member.Title, roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions))); - clientContext.ExecuteQuery(); - roleCollection = list.RoleAssignments; - } - - - if (null != roleCollection && 0 < roleCollection.Count) - { - foreach (RoleAssignment role in roleCollection) - { - if (role.Member.Title == currentLoggedInUser) - { - IList roleDefinationList = new List(); - foreach (RoleDefinition roleDef in role.RoleDefinitionBindings) - { - if (roleDef.Name == ConstantStrings.EditMatterAllowedPermissionLevel) - { - roleDefinationList.Add(roleDef); - } - } - foreach (RoleDefinition roleDef in roleDefinationList) - { - role.RoleDefinitionBindings.Remove(roleDef); - } - } - role.Update(); - } - } - clientContext.ExecuteQuery(); - - } - - /// - /// Check Full Permission for logged in User. - /// - /// List of Assigned UserNames - /// List of Permission - /// Name of logged in User - /// Status of Full Permission - internal static bool CheckFullPermissionInAssignList(IList> assignUserEmails, IList Permissions, string loggedInUserName) - { - bool result = false; - if (null != Permissions && null != assignUserEmails && Permissions.Count == assignUserEmails.Count) - { - int position = 0; - foreach (string roleName in Permissions) - { - IList AssignUserEmails = assignUserEmails[position]; - if (!string.IsNullOrWhiteSpace(roleName) && null != AssignUserEmails) - { - foreach (string user in AssignUserEmails) - { - if (!string.IsNullOrWhiteSpace(user) && user.Trim().Equals(loggedInUserName.Trim())) - { - if (roleName == ConstantStrings.EditMatterAllowedPermissionLevel) - { - return true; - } - } - } - } - position++; - } - return result; - } - return result; - } - - /// - /// Validates if there is at-least one user with full control in assign list. - /// - /// Matter object - /// Status of Full Control permission - internal static bool ValidateFullControlPermission(Matter matter) - { - - bool hasFullConrol = false; - if (null != matter && null != matter.Permissions && 0 != matter.Permissions.Count) - { - hasFullConrol = matter.Permissions.Contains(ConstantStrings.EditMatterAllowedPermissionLevel); - } - return hasFullConrol; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MailHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MailHelperFunctions.cs deleted file mode 100644 index 86bfe030..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MailHelperFunctions.cs +++ /dev/null @@ -1,174 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 29-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods involved in mail functionalities. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Exchange.WebServices.Data; - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Collections.Generic; - using System.Configuration; - using System.Globalization; - using System.IO; - using System.Reflection; - using System.ServiceModel.Web; - #endregion - /// - /// Provide methods involved in mail functionalities. - /// - internal static class MailHelperFunctions - { - /// - /// Generates the email. - /// - /// The collection of attachments. - /// Stream Content - internal static Stream GenerateEmail(Dictionary collectionOfAttachments, string[] documentUrls, bool attachmentFlag) - { - Stream result = null; - try - { - MemoryStream mailFile = GetMailAsStream(collectionOfAttachments, documentUrls, attachmentFlag); - mailFile.Position = 0; - WebOperationContext.Current.OutgoingResponse.Headers.Clear(); - WebOperationContext.Current.OutgoingResponse.ContentType = MailHelperFunctions.ReturnExtension(string.Empty); - WebOperationContext.Current.OutgoingResponse.ContentLength = mailFile.Length; - WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Description: File Transfer"); - WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Disposition", "attachment; filename=" + ServiceConstantStrings.TempEmailName + DateTime.Now + ConstantStrings.EmailFileExtension); - WebOperationContext.Current.OutgoingResponse.Headers.Add("Content-Transfer-Encoding: binary"); - WebOperationContext.Current.OutgoingResponse.Headers.Add("Expires: 0"); - WebOperationContext.Current.OutgoingResponse.Headers.Add("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - WebOperationContext.Current.OutgoingResponse.Headers.Add("Pragma: public"); - result = mailFile; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - Stream mailFile = null; - result = mailFile; - } - return result; - } - - /// - /// Forms the memory stream of the mail with attachments. - /// - /// Collection of attachments as dictionary - /// Memory stream of the created mail object - internal static MemoryStream GetMailAsStream(Dictionary collectionOfAttachments, string[] documentUrls, bool attachmentFlag) - { - MemoryStream result = null; - string documentUrl = string.Empty; - try - { - // need to be able to update/configure or get current version of server - ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013); - //// can use on premise exchange server credentials with service.UseDefaultCredentials = true, or explicitly specify the admin account (set default to false) - service.Credentials = new WebCredentials(ConfigurationManager.AppSettings["Mail_Cart_Mail_User_Name"], ConfigurationManager.AppSettings["Mail_Cart_Mail_Password"]); - service.Url = new Uri(ServiceConstantStrings.ExchangeServiceURL); - Microsoft.Exchange.WebServices.Data.EmailMessage email = new Microsoft.Exchange.WebServices.Data.EmailMessage(service); - email.Subject = TextConstants.MailCartMailSubject; - - if (attachmentFlag) - { - email.Body = new MessageBody(TextConstants.MailCartMailBody); - foreach (KeyValuePair mailAttachment in collectionOfAttachments) - { - if (null != mailAttachment.Value) - { - // Remove the date time string before adding the file as an attachment - email.Attachments.AddFileAttachment(mailAttachment.Key.Split('$')[0], mailAttachment.Value); - } - } - } - else - { - int index = 0; - foreach (string currentURL in documentUrls) - { - if (null != currentURL && 0 < currentURL.Length) - { - string[] currentAssets = currentURL.Split('$'); - string documentURL = ServiceConstantStrings.SiteURL + currentAssets[1]; - string documentName = currentAssets[2]; - - documentUrl = string.Concat(documentUrl, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.SendAsEmailFormat, ++index, documentName, documentURL)); - } - } - documentUrl = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.SendAsEmailFontStyle, documentUrl); - email.Body = new MessageBody(documentUrl); - } - //// This header allows us to open the .eml in compose mode in outlook - email.SetExtendedProperty(new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Unsent", MapiPropertyType.String), "1"); - email.Save(WellKnownFolderName.Drafts); // must save draft in order to get MimeContent - email.Load(new PropertySet(EmailMessageSchema.MimeContent)); - MimeContent mimcon = email.MimeContent; - //// Do not make the StylCop fixes for MemoryStream here - MemoryStream fileContents = new MemoryStream(); - fileContents.Write(mimcon.Content, 0, mimcon.Content.Length); - fileContents.Position = 0; - result = fileContents; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - MemoryStream fileContents = new MemoryStream(); - result = fileContents; - } - return result; - } - /// - /// Gets the file content type based on specified extensions. - /// - /// Extension of the file - /// File content type - internal static string ReturnExtension(string fileExtension) - { - string result = string.Empty; - switch (fileExtension) - { - case ".txt": - result = "text/plain"; - break; - case ".doc": - result = "application/ms-word"; - break; - case ".xls": - result = "application/vnd.ms-excel"; - break; - case ".gif": - result = "image/gif"; - break; - case ".jpg": - case "jpeg": - result = "image/jpeg"; - break; - case ".bmp": - result = "image/bmp"; - break; - case ".wav": - result = "audio/wav"; - break; - case ".ppt": - result = "application/mspowerpoint"; - break; - case ".dwg": - result = "image/vnd.dwg"; - break; - default: - result = "application/octet-stream"; - break; - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MatterLandingHelperFunction.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MatterLandingHelperFunction.cs deleted file mode 100644 index afdb0086..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/MatterLandingHelperFunction.cs +++ /dev/null @@ -1,155 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 07-01-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods involved in matter landing page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.CommonHelper -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Globalization; - using System.Reflection; - using System.Web; - #endregion - - /// - /// Provides methods involved in matter landing page. - /// - internal static class MatterLandingHelperFunction - { - - /// - /// Configures XML of web parts. - /// - /// Request Object - /// Client object containing Client data - /// Matter object containing Matter data - /// SharePoint Client Context - /// SharePoint List of matter library - /// Object of FileCreationInformation - /// To get URL segments - /// Web object of the current context - /// List of Web Parts - internal static string[] ConfigureXMLCodeOfWebParts(RequestObject requestObject, Client client, Matter matter, ClientContext clientContext, string pageName, Uri uri, Web web, MatterConfigurations matterConfigurations) - { - string[] result = null; - try - { - List sitePageLib = web.Lists.GetByTitle(matter.Name); - clientContext.Load(sitePageLib); - clientContext.ExecuteQuery(); - - ////Configure list View Web Part XML - string listViewWebPart = ConfigureListViewWebPart(requestObject, sitePageLib, clientContext, pageName, client, matter, string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}", uri.AbsolutePath, ConstantStrings.ForwardSlash, matter.Name, ConstantStrings.ForwardSlash, pageName)); - string[] contentEditorSectionIds = WebpartConstants.MatterLandingPageSections.Split(Convert.ToChar(ConstantStrings.Comma, CultureInfo.InvariantCulture)); - - ////Configure content Editor Web Part of user information XML - string contentEditorWebPartTasks = string.Empty; - if (matterConfigurations.IsTaskSelected) - { - contentEditorWebPartTasks = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.TaskPanel, CultureInfo.InvariantCulture)])); - } - - string calendarWebpart = string.Empty, rssFeedWebPart = string.Empty, rssTitleWebPart = string.Empty; - if (matterConfigurations.IsRSSSelected) - { - rssFeedWebPart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.RssFeedWebpart, HttpUtility.UrlEncode(matter.Name)); - rssTitleWebPart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.RSSTitlePanel, CultureInfo.InvariantCulture)])); - } - - ////Configure calendar Web Part XML - if (matterConfigurations.IsCalendarSelected) - { - ////If create calendar is enabled configure calendar Web Part XML; else dont configure - calendarWebpart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.CalendarPanel, CultureInfo.InvariantCulture)])); - } - - string matterInformationSection = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.InformationPanel, CultureInfo.InvariantCulture)])); - string cssLink = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MatterLandingCSSFileName, ServiceConstantStrings.MatterLandingFolderName); - string commonCssLink = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.CommonCSSFileLink, ServiceConstantStrings.CommonFolderName); - string jsLinkMatterLandingPage = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MatterLandingJSFileName, ServiceConstantStrings.MatterLandingFolderName); - string jsLinkJQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.JQueryFileName, ServiceConstantStrings.CommonFolderName); - string jsLinkCommon = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.CommonJSFileLink, ServiceConstantStrings.CommonFolderName); - string headerWebPartSection = string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.HeaderPanel, CultureInfo.InvariantCulture)]); - string footerWebPartSection = string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.FooterPanel, CultureInfo.InvariantCulture)]); - headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.StyleTag, cssLink), headerWebPartSection); - headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.StyleTag, commonCssLink), headerWebPartSection); - headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.ScriptTagWithContents, string.Format(CultureInfo.InvariantCulture, WebpartConstants.matterLandingStampProperties, matter.Name, matter.MatterGuid)), headerWebPartSection); - footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.ScriptTag, jsLinkMatterLandingPage), footerWebPartSection); - footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.ScriptTag, jsLinkCommon), footerWebPartSection); - footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, WebpartConstants.ScriptTag, jsLinkJQuery), footerWebPartSection); - string headerWebPart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, headerWebPartSection); - string footerWebPart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, footerWebPartSection); - string oneNoteWebPart = string.Format(CultureInfo.InvariantCulture, WebpartConstants.ContentEditorWebPart, string.Format(CultureInfo.InvariantCulture, WebpartConstants.MatterLandingSectionContent, contentEditorSectionIds[Convert.ToInt32(Enumerators.MatterLandingSection.OneNotePanel, CultureInfo.InvariantCulture)])); - string[] webParts = { headerWebPart, matterInformationSection, oneNoteWebPart, listViewWebPart, rssFeedWebPart, rssTitleWebPart, footerWebPart, calendarWebpart, contentEditorWebPartTasks }; - result = webParts; - } - catch (Exception exception) - { - //// Generic Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - string[] arr = new string[1]; - arr[0] = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = arr; - } - return result; - } - - /// - /// Configures XML code of List View web part. - /// - /// Request Object - /// SharePoint List of matter library - /// SharePoint Client Context - /// Object of FileCreationInformation - /// Client object containing Client data - /// Matter object containing Matter data - /// Segment of URL - /// Configured ListView Web Part - internal static string ConfigureListViewWebPart(RequestObject requestObject, List sitePageLib, ClientContext clientContext, string pageName, Client client, Matter matter, string titleUrl) - { - string viewName = string.Empty; - string result = string.Empty; - try - { - Uri uri = new Uri(client.Url); - ViewCollection viewColl = sitePageLib.Views; - clientContext.Load( - viewColl, - views => views.Include( - view => view.Title, - view => view.Id)); - clientContext.ExecuteQuery(); - foreach (View view in viewColl) - { - viewName = Convert.ToString(view.Id, CultureInfo.InvariantCulture); - break; - } - viewName = string.Concat(ConstantStrings.OpeningCurlyBrace, viewName, ConstantStrings.ClosingCurlyBrace); - string listViewWebPart = WebpartConstants.ListviewWebpart; - listViewWebPart = string.Format(CultureInfo.InvariantCulture, listViewWebPart, - Convert.ToString(sitePageLib.Id, CultureInfo.InvariantCulture), titleUrl, - string.Concat(ConstantStrings.OpeningCurlyBrace, Convert.ToString(sitePageLib.Id, CultureInfo.InvariantCulture), - ConstantStrings.ClosingCurlyBrace), viewName, string.Concat(uri.AbsolutePath, ConstantStrings.ForwardSlash, - matter.Name, ConstantStrings.ForwardSlash, pageName)); - result = listViewWebPart; - } - catch (Exception exception) - { - ////Generic Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctions.cs deleted file mode 100644 index 8edd9b46..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctions.cs +++ /dev/null @@ -1,888 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-rijadh -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods involved in matter provisioning. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.ProviderService.HelperClasses; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.Security.Application; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Taxonomy; - using Newtonsoft.Json; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Globalization; - using System.Linq; - using System.Reflection; - #endregion - - /// - /// Provide methods involved in matter provisioning. - /// - internal static class ProvisionHelperFunctions - { - /// - /// Assigns field values for specified content types to the specified matter (document library). - /// - /// Request Object containing SharePoint App Token - /// Object containing metadata for Matter - /// SP client context - /// Collection of content types - /// Client Object - /// Matter Object - /// true if success else false - internal static string AssignContentTypeHelper(RequestObject requestObject, MatterMetadata matterMetadata, ClientContext clientContext, IList contentTypeCollection, Client client, Matter matter) - { - Web web = clientContext.Web; - List matterList = web.Lists.GetByTitle(matter.Name); - SetFieldValues(clientContext, contentTypeCollection, matterList, matterMetadata); - clientContext.ExecuteQuery(); - SetDefaultContentType(clientContext, matterList, requestObject, client, matter); - string[] viewColumnList = ServiceConstantStrings.ViewColumnList.Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries).Select(listEntry => listEntry.Trim()).ToArray(); - string strQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.ViewOrderByQuery, ServiceConstantStrings.ViewOrderByColumn); - bool isViewCreated = Lists.AddView(clientContext, matterList, viewColumnList, ServiceConstantStrings.ViewName, strQuery); - return (string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, Convert.ToString(isViewCreated, CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentCulture))); - } - - /// - /// Assigns field values for specified content types to the specified matter (document library). - /// - /// SP client context - /// Collection of content types - /// List containing matters - /// Object containing metadata for Matter - internal static void SetFieldValues(ClientContext clientContext, IList contentTypeCollection, List matterList, MatterMetadata matterMetadata) - { - FieldCollection fields = GetContentType(clientContext, contentTypeCollection, matterList); - if (null != fields) - { - matterMetadata = ProvisionHelperFunctionsUtility.GetWSSId(clientContext, matterMetadata, fields); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientId).DefaultValue = matterMetadata.Client.Id; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientId).ReadOnlyField = true; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientId).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientId).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientName).ReadOnlyField = true; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientName).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientName).DefaultValue = matterMetadata.Client.Name; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnClientName).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterId).DefaultValue = matterMetadata.Matter.Id; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterId).ReadOnlyField = true; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterId).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterId).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterName).DefaultValue = matterMetadata.Matter.Name; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterName).ReadOnlyField = true; - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterName).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnMatterName).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnPracticeGroup).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnPracticeGroup).DefaultValue = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MetadataDefaultValue, matterMetadata.PracticeGroupTerm.WssId, matterMetadata.PracticeGroupTerm.TermName, matterMetadata.PracticeGroupTerm.Id); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnPracticeGroup).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnAreaOfLaw).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnAreaOfLaw).DefaultValue = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MetadataDefaultValue, matterMetadata.AreaTerm.WssId, matterMetadata.AreaTerm.TermName, matterMetadata.AreaTerm.Id); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnAreaOfLaw).Update(); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnSubareaOfLaw).SetShowInDisplayForm(true); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnSubareaOfLaw).DefaultValue = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MetadataDefaultValue, matterMetadata.SubareaTerm.WssId, matterMetadata.SubareaTerm.TermName, matterMetadata.SubareaTerm.Id); - fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnSubareaOfLaw).Update(); - } - } - - /// - /// Sets the default content type based on user selection. - /// - /// SP client context - /// Name of the list - /// Request Object - /// Client Object - /// Matter Object - internal static void SetDefaultContentType(ClientContext clientContext, List list, RequestObject requestObject, Client client, Matter matter) - { - int contentCount = 0, contentSwap = 0; - try - { - ContentTypeCollection currentContentTypeOrder = list.ContentTypes; - clientContext.Load(currentContentTypeOrder); - clientContext.ExecuteQuery(); - IList updatedContentTypeOrder = new List(); - foreach (ContentType contentType in currentContentTypeOrder) - { - if (0 == string.Compare(contentType.Name, matter.DefaultContentType, StringComparison.OrdinalIgnoreCase)) - { - contentSwap = contentCount; - } - - if (0 != string.Compare(contentType.Name, ServiceConstantStrings.HiddenContentType, StringComparison.OrdinalIgnoreCase)) - { - updatedContentTypeOrder.Add(contentType.Id); - contentCount++; - } - } - if (updatedContentTypeOrder.Count > contentSwap) - { - ContentTypeId documentContentType = updatedContentTypeOrder[0]; - updatedContentTypeOrder[0] = updatedContentTypeOrder[contentSwap]; - updatedContentTypeOrder.RemoveAt(contentSwap); - updatedContentTypeOrder.Add(documentContentType); - } - list.RootFolder.UniqueContentTypeOrder = updatedContentTypeOrder; - list.RootFolder.Update(); - list.Update(); - clientContext.ExecuteQuery(); - } - catch (Exception exception) - { - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Saves the matter details in centralized list. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Name of list where matter creation entry is logged - /// matterConfigurations object consist of configuration of matter - /// Client context - /// true if success else false - internal static string SaveMatterDetails(RequestObject requestObject, Client client, Matter matter, string matterListName, MatterConfigurations matterConfigurations, ClientContext clientContext) - { - string returnFlag = ConstantStrings.FALSE; - try - { - if (!string.IsNullOrWhiteSpace(matterListName) && null != requestObject && null != matter && null != client) - { - FieldUserValue tempUser = null; - List blockUserList = null; - List> assignUserList = null; - - List columnNames = new List() - { - ServiceConstantStrings.MattersListColumnTitle, - ServiceConstantStrings.MattersListColumnClientName, - ServiceConstantStrings.MattersListColumnClientID, - ServiceConstantStrings.MattersListColumnMatterName, - ServiceConstantStrings.MattersListColumnMatterID - }; - List columnValues = new List() - { - string.Concat(client.Name, ConstantStrings.Underscore, matter.Name), - client.Name, - client.Id, - matter.Name, - matter.Id - }; - - if (matterConfigurations.IsConflictCheck) - { - - if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.CheckBy)) - { - tempUser = SharePointHelper.ResolveUserNames(clientContext, new List() { matter.Conflict.CheckBy }).FirstOrDefault(); - columnNames.Add(ServiceConstantStrings.MattersListColumnConflictCheckBy); - columnValues.Add(tempUser); - if (!string.IsNullOrWhiteSpace(matter.Conflict.CheckOn)) - { - columnNames.Add(ServiceConstantStrings.MattersListColumnConflictCheckOn); - columnValues.Add(Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture)); - } - - columnNames.Add(ServiceConstantStrings.MattersListColumnConflictIdentified); - columnValues.Add(Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)); - } - - if (null != matter.BlockUserNames) - { - blockUserList = new List(); - blockUserList = SharePointHelper.ResolveUserNames(clientContext, matter.BlockUserNames).ToList(); - columnNames.Add(ServiceConstantStrings.MattersListColumnBlockUsers); - columnValues.Add(blockUserList); - } - } - - if (null != matter.AssignUserEmails) - { - assignUserList = new List>(); - foreach (IList assignUsers in matter.AssignUserEmails) - { - List tempAssignUserList = SharePointHelper.ResolveUserNames(clientContext, assignUsers).ToList(); - assignUserList.Add(tempAssignUserList); - } - - if (0 != assignUserList.Count && null != matter.Roles && 0 != matter.Roles.Count) - { - int assignPosition = 0; - List managingAttorneyList = new List(); - List teamMemberList = new List(); - foreach (string role in matter.Roles) - { - switch (role) - { - case ConstantStrings.ManagingAttorneyValue: - managingAttorneyList.AddRange(assignUserList[assignPosition]); - break; - default: - teamMemberList.AddRange(assignUserList[assignPosition]); - break; - } - - assignPosition++; - } - - columnNames.Add(ServiceConstantStrings.MattersListColumnManagingAttorney); - columnValues.Add(managingAttorneyList); - columnNames.Add(ServiceConstantStrings.MattersListColumnSupport); - columnValues.Add(teamMemberList); - } - } - - Microsoft.SharePoint.Client.Web web = clientContext.Web; - List matterList = web.Lists.GetByTitle(matterListName); - // To avoid the invalid symbol error while parsing the JSON, return the response in lower case - returnFlag = Convert.ToString(Lists.AddItem(clientContext, matterList, columnNames, columnValues), CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentUICulture); - } - } - catch (Exception exception) - { - //// SharePoint Specific Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return returnFlag; - } - - /// - /// Retrieves the list of content types that are to be associated with the matter. - /// - /// SP client context - /// Collection of content types - /// List containing matters - /// Content types in Field Collection object - internal static FieldCollection GetContentType(ClientContext clientContext, IList contentTypeCollection, List matterList) - { - foreach (ContentType contenttype in contentTypeCollection) - { - matterList.ContentTypesEnabled = true; - matterList.ContentTypes.AddExistingContentType(contenttype); - } - - matterList.Update(); - FieldCollection fields = matterList.Fields; - clientContext.Load(fields); - clientContext.Load(matterList); - clientContext.ExecuteQuery(); - return fields; - } - - /// - /// Generates list of users for sending email. - /// - /// Matter details - /// SharePoint client context - /// List of users associated with the matter - /// List of users to whom mail is to be sent - internal static List GenerateMailList(Matter matter, ClientContext clientContext, ref List userList) - { - List result = null; - try - { - List userEmailList = new List(); - if (null != matter.AssignUserEmails) - { - foreach (IList userNames in matter.AssignUserEmails) - { - userList = SharePointHelper.ResolveUserNames(clientContext, userNames).ToList(); - foreach (FieldUserValue userEmail in userList) - { - userEmailList.Add(userEmail); - } - } - } - result = userEmailList; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - List userEmailList = new List(); - result = userEmailList; - } - return result; - } - - /// - /// Generates list of users permissions which are allowed on created matter. - /// - /// List of Roles present in the SharePoint Permissions - /// SharePoint Web Object - /// List of permissions which are allowed on the created matter - internal static List GetAllowedUserPermissions(List roles, Web web) - { - string userAllowedPermissions = ServiceConstantStrings.UserPermissions; - List result = null; - try - { - if (!String.IsNullOrWhiteSpace(userAllowedPermissions)) - { - //// Get the user permissions from the Resource file - List userPermissions = userAllowedPermissions.ToUpperInvariant().Trim().Split(new string[] { ConstantStrings.Comma }, StringSplitOptions.RemoveEmptyEntries).ToList(); - //// Filter only the allowed roles using LINQ query - List roleDefinition = (from webRole in web.RoleDefinitions.ToList() - where userPermissions.Contains(webRole.Name.ToUpperInvariant()) - select webRole).ToList(); - foreach (RoleDefinition role in roleDefinition) - { - Role tempRole = new Role(); - tempRole.Name = role.Name; - tempRole.Id = Convert.ToString(role.Id, CultureInfo.InvariantCulture); - roles.Add(tempRole); - } - } - result = roles.OrderBy(role => role.Name).ToList(); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - List GetAllowedUserPermissionsError = new List(); - result = GetAllowedUserPermissionsError; - } - return result; - } - - /// - /// Iterates through the list of users and maps required properties. - /// - /// List of users - /// Users obtained from people picker service based on the search term - /// Returns resultant list of users for matter provision - internal static IList FilterUsers(IList users, IList userSet) - { - foreach (PeoplePickerUser item in userSet) - { - Users tempUser = new Users(); - tempUser.Name = Convert.ToString(item.DisplayText, CultureInfo.InvariantCulture); - tempUser.LogOnName = Convert.ToString(item.Key, CultureInfo.InvariantCulture); - tempUser.Email = string.Equals(item.EntityType, ConstantStrings.PeoplePickerEntityTypeUser, StringComparison.OrdinalIgnoreCase) ? Convert.ToString(item.Description, CultureInfo.InvariantCulture) : Convert.ToString(item.EntityData.Email, CultureInfo.InvariantCulture); - tempUser.EntityType = Convert.ToString(item.EntityType, CultureInfo.InvariantCulture); - tempUser.ProviderName = Convert.ToString(item.ProviderName, CultureInfo.InvariantCulture); - tempUser.EntityData = new EntityData() - { - Department = string.IsNullOrWhiteSpace(item.EntityData.Department) ? string.Empty : item.EntityData.Department, - Email = string.IsNullOrWhiteSpace(item.EntityData.Email) ? tempUser.Email : item.EntityData.Email, - Title = string.IsNullOrWhiteSpace(item.EntityData.Title) ? string.Empty : item.EntityData.Title - }; - users.Add(tempUser); - } - return users; - } - - /// - /// Returns roles from list. - /// - /// list of roles - /// list of item collection - /// resultant list of roles - internal static IList GetRoleDataUtility(IList roles, ListItemCollection collListItem) - { - if (null != collListItem && 0 != collListItem.Count) - { - foreach (ListItem item in collListItem) - { - Role tempRole = new Role(); - tempRole.Id = Convert.ToString(item[ServiceConstantStrings.ColumnNameGuid], CultureInfo.InvariantCulture); - tempRole.Name = Convert.ToString(item[ServiceConstantStrings.RoleListColumnRoleName], CultureInfo.InvariantCulture); - tempRole.Mandatory = Convert.ToBoolean(item[ServiceConstantStrings.RoleListColumnIsRoleMandatory], CultureInfo.InvariantCulture); - roles.Add(tempRole); - } - } - return roles; - } - - /// - /// Provides the permission levels present in the site. - /// - /// object of type RequestObject - /// object of client - /// value to be returned - /// permission levels - internal static string GetPermissionLevelUtility(RequestObject requestObject, Client client, string returnValue) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - List roles = new List(); - Web web = clientContext.Web; - clientContext.Load(web.RoleDefinitions, roledefinitions => roledefinitions.Include(thisRole => thisRole.Name, thisRole => thisRole.Id)); - clientContext.ExecuteQuery(); - roles = ProvisionHelperFunctions.GetAllowedUserPermissions(roles, web); - returnValue = JsonConvert.SerializeObject(roles); - } - } - catch (Exception exception) - { - ///// SharePoint Specific Exception - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return returnValue; - } - - /// - /// Utility function to create matter. - /// - /// object of type request object - /// object of client - /// object of matter type - /// client context information - /// URL of matter - /// Matter URL - internal static string CreateMatterUtility(RequestObject requestObject, Client client, Matter matter, ClientContext clientContext, string matterURL, MatterConfigurations matterConfigurations) - { - try - { - Uri centralListURL = new Uri(string.Concat(ServiceConstantStrings.CentralRepositoryUrl, ConstantStrings.ForwardSlash, ConstantStrings.Lists, ConstantStrings.ForwardSlash, ServiceConstantStrings.DMSMatterListName)); // Central Repository List URL - IList documentLibraryFolders = new List(); - Dictionary documentLibraryVersioning = new Dictionary(); - Uri clientUrl = new Uri(client.Url); - - ListInformation listInformation = new ListInformation(); - listInformation.name = matter.Name; - listInformation.description = matter.Description; - listInformation.folderNames = matter.FolderNames; - listInformation.isContentTypeEnable = true; - listInformation.versioning = new VersioningInfo(); - listInformation.versioning.EnableVersioning = ServiceConstantStrings.IsMajorVersionEnable; - listInformation.versioning.EnableMinorVersions = ServiceConstantStrings.IsMinorVersionEnable; - listInformation.versioning.ForceCheckout = ServiceConstantStrings.IsForceCheckOut; - listInformation.Path = matter.MatterGuid; - - Lists.Create(clientContext, listInformation); - - documentLibraryVersioning.Add("EnableVersioning", false); - documentLibraryFolders.Add(matter.MatterGuid); - listInformation.name = matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix; - listInformation.folderNames = documentLibraryFolders; - listInformation.versioning.EnableVersioning = false; - listInformation.versioning.EnableMinorVersions = false; - listInformation.versioning.ForceCheckout = false; - listInformation.Path = matter.MatterGuid + ServiceConstantStrings.OneNoteLibrarySuffix; - Lists.Create(clientContext, listInformation); - - bool isCopyRoleAssignment = CopyRoleAssignment(matter.Conflict.Identified, matter.Conflict.SecureMatter); - //create calendar list if create calendar flag is enabled and break its permissions - string calendarName = string.Concat(matter.Name, ServiceConstantStrings.CalendarNameSuffix); - string taskListName = string.Concat(matter.Name, ServiceConstantStrings.TaskNameSuffix); - if (ServiceConstantStrings.IsCreateCalendarEnabled && matterConfigurations.IsCalendarSelected) - { - ListInformation calendarInformation = new ListInformation(); - calendarInformation.name = calendarName; - calendarInformation.isContentTypeEnable = false; - calendarInformation.templateType = ConstantStrings.CalendarName; - calendarInformation.Path = ServiceConstantStrings.TitleListsPath + matter.MatterGuid + ServiceConstantStrings.CalendarNameSuffix; - - if (Lists.Create(clientContext, calendarInformation)) - { - Lists.BreakPermission(clientContext, calendarName, isCopyRoleAssignment); - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeAddCalendarList, TextConstants.ErrorMessageAddCalendarList); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - if (matterConfigurations.IsTaskSelected) - { - ListInformation taskListInformation = new ListInformation(); - taskListInformation.name = taskListName; - taskListInformation.isContentTypeEnable = false; - taskListInformation.templateType = ConstantStrings.TaskListTemplateType; - taskListInformation.Path = ServiceConstantStrings.TitleListsPath + matter.MatterGuid + ServiceConstantStrings.TaskNameSuffix; - if (Lists.Create(clientContext, taskListInformation)) - { - Lists.BreakPermission(clientContext, taskListName, isCopyRoleAssignment); - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeAddTaskList, TextConstants.ErrorMessageAddTaskList); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - string oneNoteUrl = string.Concat(clientUrl.AbsolutePath, ConstantStrings.ForwardSlash, matter.MatterGuid, ServiceConstantStrings.OneNoteLibrarySuffix, ConstantStrings.ForwardSlash, matter.MatterGuid); - matterURL = Lists.AddOneNote(clientContext, client.Url, oneNoteUrl, matter.MatterGuid, matter.Name); - matterURL = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, client.Url); - if (null != matter.Conflict) - { - //Break permission for Matter library - Lists.BreakPermission(clientContext, matter.Name, isCopyRoleAssignment); - - //Break permission for OneNote document library - string oneNoteLibraryName = string.Concat(matter.Name, ServiceConstantStrings.OneNoteLibrarySuffix); - Lists.BreakPermission(clientContext, oneNoteLibraryName, isCopyRoleAssignment); - } - string roleCheck = ValidationHelperFunctions.RoleCheck(requestObject, matter, client); - if (string.IsNullOrEmpty(roleCheck)) - { - string centralList = Convert.ToString(centralListURL, CultureInfo.InvariantCulture); - string matterSiteURL = centralList.Substring(0, centralList.LastIndexOf(string.Concat(ConstantStrings.ForwardSlash, ConstantStrings.Lists, ConstantStrings.ForwardSlash), StringComparison.OrdinalIgnoreCase)); - string matterListName = centralList.Substring(centralList.LastIndexOf(ConstantStrings.ForwardSlash, StringComparison.OrdinalIgnoreCase) + 1); - ClientContext listClientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(matterSiteURL), requestObject.RefreshToken); - ProvisionHelperFunctions.SaveMatterDetails(requestObject, client, matter, matterListName, matterConfigurations, listClientContext); - } - else - { - matterURL = roleCheck; - } - } - catch (Exception exception) - { - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - matterURL = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return matterURL; - } - - /// - /// Function to delete the matter in case of failure. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Result of operation: Matter Deleted or not - internal static string DeleteMatter(RequestObject requestObject, Client client, Matter matter) - { - string result = ConstantStrings.FALSE; - - if (null != requestObject && null != client && null != matter) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - if (null != clientContext && !string.IsNullOrWhiteSpace(matter.Name)) - { - string stampResult = Lists.GetPropertyValueForList(clientContext, matter.Name, ServiceConstantStrings.StampedPropertySuccess); - if (0 != string.Compare(stampResult, ConstantStrings.TRUE, StringComparison.OrdinalIgnoreCase)) - { - IList lists = new List(); - lists.Add(matter.Name); - lists.Add(string.Concat(matter.Name, ServiceConstantStrings.CalendarNameSuffix)); - lists.Add(string.Concat(matter.Name, ServiceConstantStrings.OneNoteLibrarySuffix)); - lists.Add(string.Concat(matter.Name, ServiceConstantStrings.TaskNameSuffix)); - bool bListDeleted = Lists.Delete(clientContext, lists); - if (bListDeleted) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.DeleteMatterCode, TextConstants.MatterDeletedSuccessfully); - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.DeleteMatterCode, ServiceConstantStrings.MatterNotPresent); - } - Uri clientUri = new Uri(client.Url); - string matterLandingPageUrl = string.Concat(clientUri.AbsolutePath, ConstantStrings.ForwardSlash, ServiceConstantStrings.MatterLandingPageRepositoryName.Replace(ConstantStrings.Space, string.Empty), ConstantStrings.ForwardSlash, matter.MatterGuid, ConstantStrings.AspxExtension); - Page.Delete(clientContext, matterLandingPageUrl); - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.MatterLibraryExistsCode, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.ErrorDuplicateMatter, ConstantStrings.Matter) + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + ConstantStrings.MatterPrerequisiteCheck.LibraryExists); - } - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - return result; - } - - /// - /// Creates an item in the specific list with the list of users to whom the matter will be shared. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object - /// Details of matter - /// Flag to determine if Matter landing page exists - /// Object holding configuration for the matter - /// true if success else false - internal static string ShareMatter(RequestObject requestObject, Client client, Matter matter, MatterDetails matterDetails, string matterLandingFlag, MatterConfigurations matterConfigurations) - { - string returnFlag = ConstantStrings.FALSE; - - if (null != requestObject && null != client && null != matter && null != matterDetails) - { - try - { - - Uri mailListURL = new Uri(string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}", ConstantStrings.ProvisionMatterAppURL, ConstantStrings.ForwardSlash, ConstantStrings.Lists, ConstantStrings.ForwardSlash, ConstantStrings.SendMailListName)); - string centralMailListURL = Convert.ToString(mailListURL, CultureInfo.InvariantCulture); - string mailSiteURL = centralMailListURL.Substring(0, centralMailListURL.LastIndexOf(string.Concat(ConstantStrings.ForwardSlash, ConstantStrings.Lists, ConstantStrings.ForwardSlash), StringComparison.OrdinalIgnoreCase)); - ///// Retrieve the specific site where the Mail List is present along with the required List Name - if (null != mailListURL && null != client.Url) - { - if (!string.IsNullOrWhiteSpace(mailSiteURL)) - { - returnFlag = ProvisionHelperFunctions.ShareMatterUtility(requestObject, client, matter, matterDetails, mailSiteURL, centralMailListURL, matterLandingFlag, matterConfigurations); - } - } - } - - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - return returnFlag; - } - - /// - /// Function to share the matter. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object - /// Matter object containing Matter data details - /// URL of the site - /// URL of the Send Mail list - /// Flag to determine if Matter landing page exists - /// Object holding configuration for the matter - /// Result of operation: Matter Shared successfully or not - internal static string ShareMatterUtility(RequestObject requestObject, Client client, Matter matter, MatterDetails matterDetails, string mailSiteURL, string centralMailListURL, string matterLandingFlag, MatterConfigurations matterConfigurations) - { - string shareFlag = ConstantStrings.FALSE; - string mailListName = centralMailListURL.Substring(centralMailListURL.LastIndexOf(ConstantStrings.ForwardSlash, StringComparison.OrdinalIgnoreCase) + 1); - string matterLocation = string.Concat(client.Url, ConstantStrings.ForwardSlash, matter.Name); - string ProvisionMatterValidation = string.Empty; - if (!string.IsNullOrWhiteSpace(mailSiteURL)) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(mailSiteURL), requestObject.RefreshToken)) - { - - ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, null, int.Parse(ConstantStrings.ProvisionMatterShareMatter, CultureInfo.InvariantCulture), matterConfigurations); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - // Get the current logged in User - clientContext.Load(clientContext.Web.CurrentUser); - clientContext.ExecuteQuery(); - string matterMailBody, blockUserNames; - // Generate Mail Subject - string matterMailSubject = string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailSubject, matter.Id, matter.Name, clientContext.Web.CurrentUser.Title); - - // Logic to Create Mail body - // Step 1: Create Matter Information - // Step 2: Create Team Information - // Step 3: Create Access Information - // Step 4: Create Conflict check Information based on the conflict check flag and create mail body - - // Step 1: Create Matter Information - string defaultContentType = string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailDefaultContentTypeHtmlChunk, matter.DefaultContentType); - string matterType = string.Join(";", matter.ContentTypes.ToArray()).TrimEnd(';').Replace(matter.DefaultContentType, defaultContentType); - - // Step 2: Create Team Information - string secureMatter = ConstantStrings.FALSE.ToUpperInvariant() == matter.Conflict.SecureMatter.ToUpperInvariant() ? ConstantStrings.NO : ConstantStrings.YES; - string mailBodyTeamInformation = string.Empty; - mailBodyTeamInformation = TeamMembersPermissionInformation(matterDetails, mailBodyTeamInformation); - - // Step 3: Create Access Information - if (ConstantStrings.TRUE == matterLandingFlag) - { - matterLocation = string.Concat(client.Url, ConstantStrings.ForwardSlash, ServiceConstantStrings.MatterLandingPageRepositoryName.Replace(ConstantStrings.Space, string.Empty), ConstantStrings.ForwardSlash, matter.MatterGuid, ConstantStrings.AspxExtension); - } - string oneNotePath = string.Concat(client.Url, ConstantStrings.ForwardSlash, matter.MatterGuid, ServiceConstantStrings.OneNoteLibrarySuffix, ConstantStrings.ForwardSlash, matter.MatterGuid, ConstantStrings.ForwardSlash, matter.MatterGuid); - - // Step 4: Create Conflict check Information based on the conflict check flag and create mail body - if (matterConfigurations.IsConflictCheck) - { - string conflictIdentified = ConstantStrings.FALSE.ToUpperInvariant() == matter.Conflict.Identified.ToUpperInvariant() ? ConstantStrings.NO : ConstantStrings.YES; - blockUserNames = string.Join(";", matter.BlockUserNames.ToArray()).Trim().TrimEnd(';'); - - blockUserNames = !String.IsNullOrEmpty(blockUserNames) ? string.Format(CultureInfo.InvariantCulture, "
{0}: {1}
", "Conflicted User", blockUserNames) : string.Empty; - matterMailBody = string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailBodyMatterInformation, client.Name, client.Id, matter.Name, matter.Id, matter.Description, matterType) + string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailBodyConflictCheck, ConstantStrings.YES, matter.Conflict.CheckBy, Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture).ToString(ServiceConstantStrings.MatterCenterDateFormat, CultureInfo.InvariantCulture), conflictIdentified) + string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailBodyTeamMembers, secureMatter, mailBodyTeamInformation, blockUserNames, client.Url, oneNotePath, matter.Name, matterLocation, matter.Name); - } - else - { - blockUserNames = string.Empty; - matterMailBody = string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailBodyMatterInformation, client.Name, client.Id, matter.Name, matter.Id, matter.Description, matterType) + string.Format(CultureInfo.InvariantCulture, TextConstants.MatterMailBodyTeamMembers, secureMatter, mailBodyTeamInformation, blockUserNames, client.Url, oneNotePath, matter.Name, matterLocation, matter.Name); - } - - Web web = clientContext.Web; - List mailList = web.Lists.GetByTitle(mailListName); - List userList = new List(); - List userEmailList = ProvisionHelperFunctions.GenerateMailList(matter, clientContext, ref userList); - ///// Add the Matter URL in list - FieldUrlValue matterPath = new FieldUrlValue() - { - Url = string.Concat(client.Url.Replace(String.Concat(ConstantStrings.HTTPS, ConstantStrings.COLON, ConstantStrings.ForwardSlash, ConstantStrings.ForwardSlash), String.Concat(ConstantStrings.HTTP, ConstantStrings.COLON, ConstantStrings.ForwardSlash, ConstantStrings.ForwardSlash)), ConstantStrings.ForwardSlash, matter.Name, ConstantStrings.ForwardSlash, matter.Name), - Description = matter.Name - }; - List columnNames = new List() { ServiceConstantStrings.ShareListColumnMatterPath, ServiceConstantStrings.ShareListColumnMailList, TextConstants.ShareListColumnMailBody, TextConstants.ShareListColumnMailSubject }; - List columnValues = new List() { matterPath, userEmailList, matterMailBody, matterMailSubject }; - // To avoid the invalid symbol error while parsing the JSON, return the response in lower case - shareFlag = Convert.ToString(Lists.AddItem(clientContext, mailList, columnNames, columnValues), CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentUICulture); - } - } - } - return shareFlag; - } - - /// - /// Provides the team members and their respective permission details. - /// - /// Matter Details object - /// Team members permission information - /// Team members permission information - private static string TeamMembersPermissionInformation(MatterDetails matterDetails, string mailBodyTeamInformation) - { - if (null != matterDetails && !string.IsNullOrWhiteSpace(matterDetails.RoleInformation)) - { - Dictionary roleInformation = JsonConvert.DeserializeObject>(matterDetails.RoleInformation); - - foreach (KeyValuePair entry in roleInformation) - { - mailBodyTeamInformation = string.Format(CultureInfo.InvariantCulture, ConstantStrings.RoleInfoHtmlChunk, entry.Key, entry.Value) + mailBodyTeamInformation; - } - } - return mailBodyTeamInformation; - } - - /// - /// Function to create dictionary object for stamp property - /// - /// Client object containing Client data - /// Matter object containing Matter data - /// Matter details object which has data of properties to be stamped - /// returns dictionary object - internal static Dictionary SetStampProperty(Client client, Matter matter, MatterDetails matterDetails) - { - string matterCenterPermission = string.Join(ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, matter.Permissions); - string matterCenterRoles = string.Join(ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, matter.Roles); - string documentTemplateCount = string.Join(ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR, matter.DocumentTemplateCount); - string matterCenterUsers = string.Empty; - string matterCenterUserEmails = string.Empty; - string separator = ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR; - foreach (IList userNames in matter.AssignUserNames) - { - matterCenterUsers += string.Join(ConstantStrings.Semicolon, userNames.Where(user => !string.IsNullOrWhiteSpace(user))) + separator; - } - // Removed $|$ from end of the string - matterCenterUsers = matterCenterUsers.Substring(0, matterCenterUsers.Length - separator.Length); - foreach (IList userEmails in matter.AssignUserEmails) - { - matterCenterUserEmails += string.Join(ConstantStrings.Semicolon, userEmails.Where(user => !string.IsNullOrWhiteSpace(user))) + separator; - } - // Removed $|$ from end of the string - matterCenterUserEmails = matterCenterUserEmails.Substring(0, matterCenterUserEmails.Length - separator.Length); - List keys = new List(); - Dictionary propertyList = new Dictionary(); - keys.Add(ServiceConstantStrings.StampedPropertyPracticeGroup); - keys.Add(ServiceConstantStrings.StampedPropertyAreaOfLaw); - keys.Add(ServiceConstantStrings.StampedPropertySubAreaOfLaw); - keys.Add(ServiceConstantStrings.StampedPropertyMatterName); - keys.Add(ServiceConstantStrings.StampedPropertyMatterID); - keys.Add(ServiceConstantStrings.StampedPropertyClientName); - keys.Add(ServiceConstantStrings.StampedPropertyClientID); - keys.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorney); - keys.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorneyEmail); - keys.Add(ServiceConstantStrings.StampedPropertyTeamMembers); - keys.Add(ServiceConstantStrings.StampedPropertyIsMatter); - keys.Add(ServiceConstantStrings.StampedPropertyOpenDate); - keys.Add(ServiceConstantStrings.StampedPropertySecureMatter); - keys.Add(ServiceConstantStrings.StampedPropertyBlockedUploadUsers); - keys.Add(ServiceConstantStrings.StampedPropertyMatterDescription); - keys.Add(ServiceConstantStrings.StampedPropertyConflictCheckDate); - keys.Add(ServiceConstantStrings.StampedPropertyConflictCheckBy); - keys.Add(ServiceConstantStrings.StampedPropertyMatterCenterRoles); - keys.Add(ServiceConstantStrings.StampedPropertyMatterCenterPermissions); - keys.Add(ServiceConstantStrings.StampedPropertyMatterCenterUsers); - keys.Add(ServiceConstantStrings.StampedPropertyMatterCenterUserEmails); - keys.Add(ServiceConstantStrings.StampedPropertyDefaultContentType); - keys.Add(ServiceConstantStrings.StampedPropertyIsConflictIdentified); - keys.Add(ServiceConstantStrings.StampedPropertyDocumentTemplateCount); - keys.Add(ServiceConstantStrings.StampedPropertyBlockedUsers); - keys.Add(ServiceConstantStrings.StampedPropertyMatterGUID); - - propertyList.Add(ServiceConstantStrings.StampedPropertyPracticeGroup, Encoder.HtmlEncode(matterDetails.PracticeGroup)); - propertyList.Add(ServiceConstantStrings.StampedPropertyAreaOfLaw, Encoder.HtmlEncode(matterDetails.AreaOfLaw)); - propertyList.Add(ServiceConstantStrings.StampedPropertySubAreaOfLaw, Encoder.HtmlEncode(matterDetails.SubareaOfLaw)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterName, Encoder.HtmlEncode(matter.Name)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterID, Encoder.HtmlEncode(matter.Id)); - propertyList.Add(ServiceConstantStrings.StampedPropertyClientName, Encoder.HtmlEncode(client.Name)); - propertyList.Add(ServiceConstantStrings.StampedPropertyClientID, Encoder.HtmlEncode(client.Id)); - propertyList.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorney, Encoder.HtmlEncode(matterDetails.ResponsibleAttorney)); - propertyList.Add(ServiceConstantStrings.StampedPropertyResponsibleAttorneyEmail, Encoder.HtmlEncode(matterDetails.ResponsibleAttorneyEmail)); - propertyList.Add(ServiceConstantStrings.StampedPropertyTeamMembers, Encoder.HtmlEncode(matterDetails.TeamMembers)); - propertyList.Add(ServiceConstantStrings.StampedPropertyIsMatter, ConstantStrings.TRUE); - propertyList.Add(ServiceConstantStrings.StampedPropertyOpenDate, Encoder.HtmlEncode(DateTime.Now.ToString(ServiceConstantStrings.ValidDateFormat, CultureInfo.InvariantCulture))); - propertyList.Add(ServiceConstantStrings.PropertyNameVtiIndexedPropertyKeys, Encoder.HtmlEncode(ServiceUtility.GetEncodedValueForSearchIndexProperty(keys))); - propertyList.Add(ServiceConstantStrings.StampedPropertySecureMatter, (matter.Conflict != null) ? (matter.Conflict.SecureMatter != null) ? Encoder.HtmlEncode(matter.Conflict.SecureMatter) : "False" : "False"); - propertyList.Add(ServiceConstantStrings.StampedPropertyBlockedUploadUsers, Encoder.HtmlEncode(string.Join(";", matterDetails.UploadBlockedUsers))); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterDescription, Encoder.HtmlEncode(matter.Description)); - propertyList.Add(ServiceConstantStrings.StampedPropertyConflictCheckDate, (string.IsNullOrEmpty(matter.Conflict.CheckOn)) ? "" : Encoder.HtmlEncode(Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture).ToString(ServiceConstantStrings.ValidDateFormat, CultureInfo.InvariantCulture))); - propertyList.Add(ServiceConstantStrings.StampedPropertyConflictCheckBy, Encoder.HtmlEncode(matter.Conflict.CheckBy)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterRoles, Encoder.HtmlEncode(matterCenterRoles)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterPermissions, Encoder.HtmlEncode(matterCenterPermission)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterUsers, Encoder.HtmlEncode(matterCenterUsers)); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterCenterUserEmails, Encoder.HtmlEncode(matterCenterUserEmails)); - propertyList.Add(ServiceConstantStrings.StampedPropertyDefaultContentType, Encoder.HtmlEncode(matter.DefaultContentType)); - propertyList.Add(ServiceConstantStrings.StampedPropertyIsConflictIdentified, Encoder.HtmlEncode(matter.Conflict.Identified)); - propertyList.Add(ServiceConstantStrings.StampedPropertyDocumentTemplateCount, Encoder.HtmlEncode(documentTemplateCount)); - propertyList.Add(ServiceConstantStrings.StampedPropertyBlockedUsers, Encoder.HtmlEncode(string.Join(";", matter.BlockUserNames))); - propertyList.Add(ServiceConstantStrings.StampedPropertyMatterGUID, Encoder.HtmlEncode(matter.MatterGuid)); - propertyList.Add(ServiceConstantStrings.StampedPropertySuccess, ConstantStrings.TRUE); - return propertyList; - } - - /// - /// Checks whether to retain previous users while breaking permission - /// - /// Conflict identified information - /// Security information - /// Flag to indicate whether to retain the previous users - internal static bool CopyRoleAssignment(string conflictIdentified, string matterSecured) - { - bool isBreakPermission = true; - if (Convert.ToBoolean(conflictIdentified, CultureInfo.InvariantCulture) || Convert.ToBoolean(matterSecured, CultureInfo.InvariantCulture)) - { - isBreakPermission = false; - } - return isBreakPermission; - } - - /// - /// Checks if the lists exist - /// - /// Client context - /// List name - /// - internal static List CheckListsExist(ClientContext clientContext, string matterName, MatterConfigurations matterConfigurations = null) - { - List lists = new List(); - lists.Add(matterName); - lists.Add(matterName + ServiceConstantStrings.OneNoteLibrarySuffix); - if (null == matterConfigurations || matterConfigurations.IsCalendarSelected) - { - lists.Add(matterName + ServiceConstantStrings.CalendarNameSuffix); - } - if (null == matterConfigurations || matterConfigurations.IsTaskSelected) - { - lists.Add(matterName + ServiceConstantStrings.TaskNameSuffix); - } - List listExists = Lists.Exists(clientContext, new ReadOnlyCollection(lists)); - return listExists; - } - - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctionsUtility.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctionsUtility.cs deleted file mode 100644 index 6f85e83d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ProvisionHelperFunctionsUtility.cs +++ /dev/null @@ -1,51 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-rijadh -// Created : 09-23-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides additional methods involved in matter provisioning. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.HelperClasses -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Taxonomy; - #endregion - - /// - /// Provide additional methods involved in matter provisioning. - /// - internal static class ProvisionHelperFunctionsUtility - { - /// - /// Function to get the WssID for the Practice group, Area of law and Sub area of law terms - /// - /// SP client context - /// Object containing meta data for Matter - /// Field Collection object - /// An Object containing meta data for Matter - internal static MatterMetadata GetWSSId(ClientContext clientContext, MatterMetadata matterMetadata, FieldCollection fields) - { - ClientResult practiceGroupResult = clientContext.CastTo - (fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnPracticeGroup)) - .GetFieldValueAsTaxonomyFieldValue(matterMetadata.PracticeGroupTerm.Id); - ClientResult areaOfLawResult = clientContext.CastTo - (fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnAreaOfLaw)) - .GetFieldValueAsTaxonomyFieldValue(matterMetadata.AreaTerm.Id); - ClientResult subareaOfLawResult = clientContext.CastTo - (fields.GetByInternalNameOrTitle(ServiceConstantStrings.ContentTypeColumnSubareaOfLaw)) - .GetFieldValueAsTaxonomyFieldValue(matterMetadata.SubareaTerm.Id); - clientContext.ExecuteQuery(); - - matterMetadata.PracticeGroupTerm.WssId = practiceGroupResult.Value.WssId; - matterMetadata.AreaTerm.WssId = areaOfLawResult.Value.WssId; - matterMetadata.SubareaTerm.WssId = subareaOfLawResult.Value.WssId; - return matterMetadata; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctions.cs deleted file mode 100644 index eddc6d90..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctions.cs +++ /dev/null @@ -1,1224 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-sauve -// Created : 06-03-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides methods for SharePoint Search functionality. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.Security.Application; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Search.Query; - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - using System.Web; - #endregion - - /// - /// Provide methods for SharePoint Search functionality. - /// - internal static class SearchHelperFunctions - { - /// - /// Retrieves folder hierarchy from document library. - /// - /// SharePoint library - /// List items - /// List of all folders of type folder data - /// List of folders of type folder data - internal static List GetFolderAssignment(List list, ListItemCollection listItems, List allFolders) - { - FolderData folderData = new FolderData() - { - Name = list.RootFolder.Name, - URL = list.RootFolder.ServerRelativeUrl, - ParentURL = null - }; - allFolders.Add(folderData); - foreach (var listItem in listItems) - { - folderData = new FolderData() - { - Name = Convert.ToString(listItem[ServiceConstantStrings.ColumnNameFileLeafRef], CultureInfo.InvariantCulture), - URL = Convert.ToString(listItem[ServiceConstantStrings.ColumnNameFileRef], CultureInfo.InvariantCulture), - ParentURL = Convert.ToString(listItem[ServiceConstantStrings.ColumnNameFileDirRef], CultureInfo.InvariantCulture) - }; - - allFolders.Add(folderData); - } - - return allFolders; - } - - /// - /// Returns the Keyword query object with refiners added for sorting - /// - /// Keyword object - /// Property by which sort is applied - /// Direction in which sort is applied (0 --> Ascending order and 1 --> Descending order) - /// Keyword object with sorting refiners applied - internal static KeywordQuery AddSortingRefiner(KeywordQuery keywordQuery, string sortByProperty, int sortDirection) - { - if (0 == sortDirection) - { - keywordQuery.SortList.Add(sortByProperty, Microsoft.SharePoint.Client.Search.Query.SortDirection.Ascending); - } - else if (1 == sortDirection) - { - keywordQuery.SortList.Add(sortByProperty, Microsoft.SharePoint.Client.Search.Query.SortDirection.Descending); - } - return keywordQuery; - } - - /// - /// Defines the sorting property and direction for querying SharePoint Search. - /// - /// Keyword object - /// Search object - /// Boolean flag which determines current search is for matters or documents - /// - internal static KeywordQuery GetSortByProperty(KeywordQuery keywordQuery, SearchObject searchObject, Boolean isMatterSearch) - { - string matterIDRefiner = string.Empty; - ////Sorting by specified property 0 --> Ascending order and 1 --> Descending order - if (!string.IsNullOrWhiteSpace(searchObject.Sort.ByProperty)) - { - keywordQuery = AddSortingRefiner(keywordQuery, searchObject.Sort.ByProperty, searchObject.Sort.Direction); - //// Add Matter ID property as second level sort for Client.MatterID column based on Search Matter or Search Document - if (SearchConstants.ManagedPropertyClientID == searchObject.Sort.ByProperty || SearchConstants.ManagedPropertyDocumentClientId == searchObject.Sort.ByProperty) - { - if (isMatterSearch) - { - matterIDRefiner = SearchConstants.ManagedPropertyMatterId; - } - else - { - matterIDRefiner = SearchConstants.ManagedPropertyDocumentMatterId; - } - keywordQuery = AddSortingRefiner(keywordQuery, matterIDRefiner, searchObject.Sort.Direction); - } - } - return keywordQuery; - } - - /// - /// Forms filter query for the specified property and data list. - /// - /// Name of the property - /// List of values as data - /// Filter query - internal static string FormFilterQuery(string propertyName, IList dataList) - { - string previousFilterValues = string.Empty; - string result = string.Empty; - try - { - if (!string.IsNullOrWhiteSpace(propertyName) && null != dataList) - { - if (1 == dataList.Count) - { - previousFilterValues = string.Concat(propertyName, ConstantStrings.COLON); - } - else - { - previousFilterValues = string.Concat(propertyName, ConstantStrings.COLON, ConstantStrings.Space, ConstantStrings.OpeningBracket, ConstantStrings.OperatorOR, ConstantStrings.OpeningBracket); - } - for (int counter = 0; counter < dataList.Count; counter++) - { - if (0 < counter) - { - previousFilterValues += ConstantStrings.Comma; - } - previousFilterValues += string.Concat(ConstantStrings.DoubleQuote, dataList[counter], ConstantStrings.DoubleQuote); - } - if (1 != dataList.Count) - { - previousFilterValues += string.Concat(ConstantStrings.ClosingBracket, ConstantStrings.ClosingBracket); - } - } - result = previousFilterValues; - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Gets pinned matters/documents specific to user. - /// - /// Request object containing SharePoint App Token - /// Client object containing client URL - /// Name of the list - /// Name of the list column - /// Process Document (true) or Matter (false) - /// JSON structure with the meta-data of pinned Matter/Document for requested user - internal static string ShowPinData(RequestObject requestObject, Client client, string listName, string listColumnName, bool isShowDocument) - { - string result = string.Empty; - if (null != requestObject && null != client && !string.IsNullOrWhiteSpace(listName) && !string.IsNullOrWhiteSpace(listColumnName)) - { - ////Holds logged-in user alias - string userAlias = string.Empty; - - ////Object to store all the list items retrieved from SharePoint list - ListItemCollection listItems; - - ////Stores the JSON structure with the meta-data of pinned matter/document - string userPinnedDetails = string.Empty; - - ////Stores the count of pinned matters/documents for the requested user - int userPinnedDetailCount = 0; - - try - { - ////Object to store list item details as per pinned matter/document - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - ////Get logged in user alias - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - userAlias = currentUserDetail.LogOnName; - listItems = Lists.GetData(clientContext, listName, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.UserPinnedDetailsQuery, ServiceConstantStrings.PinnedListColumnUserAlias, userAlias, listColumnName)); - clientContext.Load(listItems); - clientContext.ExecuteQuery(); - - ////ListItems are present in the list - if (null != listItems && listItems.Count > 0) - { - ////Since we are maintaining only single list item per user, listItems collection will have only one object; hence accessing first object - ////Check if column holds null or empty string. If non empty, pinned matter/document exists - if (!string.IsNullOrEmpty(Convert.ToString(listItems[0][listColumnName], CultureInfo.InvariantCulture))) - { - string userPinnedMatter = Convert.ToString(listItems[0][listColumnName], CultureInfo.InvariantCulture); - if (isShowDocument) - { - Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); - userPinnedDetailCount = userpinnedMatterCollection.Count; - userPinnedDetails = JsonConvert.SerializeObject(userpinnedMatterCollection.Values.Reverse(), Newtonsoft.Json.Formatting.Indented); - userPinnedDetails = string.Concat(userPinnedDetails, ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, userPinnedDetailCount); - } - else - { - Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); - userPinnedDetailCount = userpinnedMatterCollection.Count; - userPinnedDetails = JsonConvert.SerializeObject(userpinnedMatterCollection.Values.Reverse(), Newtonsoft.Json.Formatting.Indented); - userPinnedDetails = string.Concat(userPinnedDetails, ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, userPinnedDetailCount); - } - result = userPinnedDetails; - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, 0, ConstantStrings.NoPinnedMessage); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, 0, ConstantStrings.NoPinnedMessage); - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Gets the current user pinned details. - /// - /// If the user is pinning a matter, this will be true, else will be false. - /// This is an object that contains the details of the specific pinned matter/document. - /// This returns an object that contains the details of the specific pinned matter/document. - internal static PinUnpinDetails GetCurrentUserPinnedDetails(bool isMatterView, object getUserPinnedDetails) - { - PinUnpinDetails userPinnedDetails = new PinUnpinDetails(); - try - { - if (isMatterView) - { - userPinnedDetails.UserPinnedMatterData = (MatterData)getUserPinnedDetails; - } - else - { - userPinnedDetails.UserPinnedDocumentData = (DocumentData)getUserPinnedDetails; - } - - userPinnedDetails.ListName = isMatterView ? ServiceConstantStrings.UserPinnedMatterListName : ServiceConstantStrings.UserPinnedDocumentListName; - userPinnedDetails.PinnedListColumnDetails = isMatterView ? ServiceConstantStrings.PinnedListColumnMatterDetails : ServiceConstantStrings.PinnedListColumnDocumentDetails; - userPinnedDetails.URL = isMatterView ? userPinnedDetails.UserPinnedMatterData.MatterUrl : userPinnedDetails.UserPinnedDocumentData.DocumentUrl; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return userPinnedDetails; - } - - /// - /// Pins the record and associate to logged-in user. - /// - /// The client context object - /// This is an object that contains the details of the specific pinned matter/document. - /// If the user is pinning a matter, this will be true, else will be false. - /// It returns a string object, that contains the execution status of the PinThisRecord function. - internal static string PinThisRecord(ClientContext clientContext, object getUserPinnedDetails, bool isMatterView) - { - string result = string.Empty; - if (null != clientContext) - { - bool status = false; - string userAlias = string.Empty; - string pinnedDetailsJson = string.Empty; - ListItemCollection listItems; - - PinUnpinDetails userPinnedDetails = GetCurrentUserPinnedDetails(isMatterView, getUserPinnedDetails); - - try - { - List list = clientContext.Web.Lists.GetByTitle(userPinnedDetails.ListName); - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - userAlias = currentUserDetail.LogOnName; - listItems = Lists.GetData(clientContext, userPinnedDetails.ListName, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.UserPinnedDetailsQuery, ServiceConstantStrings.PinnedListColumnUserAlias, userAlias, userPinnedDetails.PinnedListColumnDetails)); - ////Pinned matter/document(s) exists for users - if (null != listItems && 0 < listItems.Count) - { - ////Logic to create pinned matter/document - if (isMatterView) - { - string userPinnedMatter = !string.IsNullOrEmpty(Convert.ToString(listItems[0][ServiceConstantStrings.PinnedListColumnMatterDetails], CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][ServiceConstantStrings.PinnedListColumnMatterDetails], CultureInfo.InvariantCulture) : string.Empty; - // Check if empty entry is retrieved - if (!string.IsNullOrWhiteSpace(userPinnedMatter)) - { - Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); - // Check if matter is already pinned - if (!userpinnedMatterCollection.ContainsKey(userPinnedDetails.UserPinnedMatterData.MatterUrl)) - { - userpinnedMatterCollection.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData); - pinnedDetailsJson = JsonConvert.SerializeObject(userpinnedMatterCollection, Newtonsoft.Json.Formatting.Indented); - } - else - { - status = true; - } - } - else - { - pinnedDetailsJson = GetFirstPinnedMatter(userPinnedDetails); - } - } - else - { - string userPinnedDocument = !string.IsNullOrEmpty(Convert.ToString(listItems[0][ServiceConstantStrings.PinnedListColumnDocumentDetails], CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][ServiceConstantStrings.PinnedListColumnDocumentDetails], CultureInfo.InvariantCulture) : string.Empty; - if (!string.IsNullOrWhiteSpace(userPinnedDocument)) - { - Dictionary userpinnedDocumentCollection = JsonConvert.DeserializeObject>(userPinnedDocument); - // Check if document is already pinned - if (!userpinnedDocumentCollection.ContainsKey(userPinnedDetails.URL)) - { - userpinnedDocumentCollection.Add(userPinnedDetails.URL, userPinnedDetails.UserPinnedDocumentData); - pinnedDetailsJson = JsonConvert.SerializeObject(userpinnedDocumentCollection, Newtonsoft.Json.Formatting.Indented); - } - else - { - status = true; - } - } - else - { - pinnedDetailsJson = GetFirstPinnedDocument(userPinnedDetails); - } - } - - // Run update query only when status is false - if (!status) - { - ////We are maintaining single list item entry for user - listItems[0][userPinnedDetails.PinnedListColumnDetails] = pinnedDetailsJson; - listItems[0].Update(); - clientContext.ExecuteQuery(); - status = true; - } - } - else - { - ////No pinned matter/document(s) for logged in user. Create pinned matter/document for the user. - ////Create pin request - if (isMatterView) - { - pinnedDetailsJson = GetFirstPinnedMatter(userPinnedDetails); - } - else - { - pinnedDetailsJson = GetFirstPinnedDocument(userPinnedDetails); - } - ////Logic to create list item entry for user - ListItemCreationInformation listItemInformation = new ListItemCreationInformation(); - ListItem listItem = list.AddItem(listItemInformation); - listItem[ServiceConstantStrings.PinnedListColumnUserAlias] = userAlias; - listItem[userPinnedDetails.PinnedListColumnDetails] = pinnedDetailsJson; - listItem.Update(); - clientContext.ExecuteQuery(); - listItem.BreakRoleInheritance(false, true); // Remove inheriting permissions on item - clientContext.ExecuteQuery(); - status = true; - } - result = Convert.ToString(status, CultureInfo.InvariantCulture); - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Gets the first pinned document serialized JSON object - /// - /// User document pin details object - /// - private static string GetFirstPinnedDocument(PinUnpinDetails userPinnedDetails) - { - Dictionary userFirstPinnedDocument = new Dictionary(); - userFirstPinnedDocument.Add(userPinnedDetails.URL, userPinnedDetails.UserPinnedDocumentData); - string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedDocument, Newtonsoft.Json.Formatting.Indented); - return pinnedDetailsJson; - } - - /// - /// Gets the first pinned matter serialized JSON object - /// - /// User matter pin details object - /// JSON format of pin data - private static string GetFirstPinnedMatter(PinUnpinDetails userPinnedDetails) - { - Dictionary userFirstPinnedMatter = new Dictionary(); - userFirstPinnedMatter.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData); - string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedMatter, Newtonsoft.Json.Formatting.Indented); - return pinnedDetailsJson; - } - - /// - /// Removes the record and dissociate from logged-in user. - /// - /// The client context. - /// This is an object that contains the details of the specific pinned matter/document. - /// If the user is pinning a matter, this will be true, else will be false. - /// It returns a string object, that contains the execution status of the function. - internal static string RemoveThisRecord(ClientContext clientContext, object getUserPinnedDetails, bool isMatterView) - { - string result = string.Empty; - if (null != clientContext) - { - bool status = false; - string userAlias = string.Empty; - ListItemCollection listItems; - - PinUnpinDetails userPinnedDetails = GetCurrentUserPinnedDetails(isMatterView, getUserPinnedDetails); - - try - { - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - userAlias = currentUserDetail.LogOnName; - listItems = Lists.GetData(clientContext, userPinnedDetails.ListName, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.UserPinnedDetailsQuery, ServiceConstantStrings.PinnedListColumnUserAlias, userAlias, userPinnedDetails.PinnedListColumnDetails)); - - ////Pinned matter/document(s) exists for users - if (null != listItems && 0 < listItems.Count) - { - ////Logic to create pinned matter/document - if (isMatterView) - { - string userPinnedMatter = !string.IsNullOrEmpty(Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture) : string.Empty; - Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); - - if (!string.IsNullOrWhiteSpace(userPinnedDetails.UserPinnedMatterData.MatterName) && userpinnedMatterCollection.ContainsKey(userPinnedDetails.UserPinnedMatterData.MatterName)) - { - ////Only 1 pinned request for user - if (1 == userpinnedMatterCollection.Count) - { - ////We are maintaining single list item entry for user - listItems[0].DeleteObject(); - } - else - { - ////Matter already exists - userpinnedMatterCollection.Remove(userPinnedDetails.UserPinnedMatterData.MatterName); - string updatedMatter = JsonConvert.SerializeObject(userpinnedMatterCollection, Newtonsoft.Json.Formatting.Indented); - ////We are maintaining single list item entry for user - listItems[0][ServiceConstantStrings.PinnedListColumnMatterDetails] = updatedMatter; - listItems[0].Update(); - } - } - } - else - { - string userPinnedDocument = !string.IsNullOrEmpty(Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture) : string.Empty; - Dictionary userpinnedDocumentCollection = JsonConvert.DeserializeObject>(userPinnedDocument); - if (!string.IsNullOrWhiteSpace(userPinnedDetails.URL) && userpinnedDocumentCollection.ContainsKey(userPinnedDetails.URL)) - { - ////Only 1 pinned request for user - if (1 == userpinnedDocumentCollection.Count) - { - ////We are maintaining single list item entry for user - listItems[0].DeleteObject(); - } - else - { - //// Matter already exists - userpinnedDocumentCollection.Remove(userPinnedDetails.URL); - string updatedDocument = JsonConvert.SerializeObject(userpinnedDocumentCollection, Newtonsoft.Json.Formatting.Indented); - - ////We are maintaining single list item entry for user - listItems[0][userPinnedDetails.PinnedListColumnDetails] = updatedDocument; - listItems[0].Update(); - } - } - } - - clientContext.ExecuteQuery(); - - status = true; - } - result = Convert.ToString(status, CultureInfo.InvariantCulture); - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Prepares and returns the keyword query to get data from SharePoint Search based on filtering condition. - /// - /// The client object - /// The search object. - /// The keyword query. - /// The filter condition. - /// The managed property. - /// If the user is pinning a matter, this will be true, else will be false. - /// It returns a Keyword Query object. - internal static KeywordQuery KeywordQueryMetrics(Client client, SearchObject searchObject, KeywordQuery keywordQuery, string filterCondition, string managedProperty, bool isMatterView) - { - KeywordQuery result = null; - try - { - if (ServiceConstantStrings.IsTenantDeployment) - { - keywordQuery.QueryText = searchObject.SearchTerm; - } - else - { - keywordQuery.QueryText = "(" + searchObject.SearchTerm + " AND site:" + client.Url + ")"; - } - - keywordQuery.RefinementFilters.Add(filterCondition); - if (isMatterView) - { - keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ConstantStrings.COLON, ConstantStrings.DoubleQuote, true, ConstantStrings.DoubleQuote)); - } - else - { - - string[] invalidExtensions = ServiceConstantStrings.FindDocumentInvalidExtensions.Split(','); - string chunk = string.Empty; - - foreach (string extension in invalidExtensions) - { - chunk = chunk + "equals" + ConstantStrings.OpeningBracket + ConstantStrings.DoubleQuote + extension + ConstantStrings.DoubleQuote + ConstantStrings.ClosingBracket + ConstantStrings.Comma; - } - chunk = chunk.Remove(chunk.Length - 1); - - keywordQuery.RefinementFilters.Add(string.Concat("not" + ConstantStrings.OpeningBracket + "FileType", ConstantStrings.COLON, ConstantStrings.OperatorOR + ConstantStrings.OpeningBracket + - chunk + ConstantStrings.ClosingBracket + ConstantStrings.ClosingBracket - )); - keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ConstantStrings.COLON, "equals", ConstantStrings.OpeningBracket + ConstantStrings.DoubleQuote + - "1" + ConstantStrings.DoubleQuote + ConstantStrings.ClosingBracket - )); - } - - keywordQuery.TrimDuplicates = false; - if (0 < searchObject.PageNumber && 0 < searchObject.ItemsPerPage) - { - keywordQuery.StartRow = (searchObject.PageNumber - 1) * searchObject.ItemsPerPage; - keywordQuery.RowLimit = searchObject.ItemsPerPage; - } - - result = keywordQuery; - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = null; - } - return result; - } - - /// - /// Assigns the keyword query values. - /// - /// The keyword query. - /// The managed properties. - /// It returns a Keyword Query object. - internal static KeywordQuery AssignKeywordQueryValues(KeywordQuery keywordQuery, List managedProperties) - { - KeywordQuery result = null; - if (keywordQuery != null) - { - keywordQuery.SelectProperties.Clear(); - foreach (string selectProperties in managedProperties) - { - keywordQuery.SelectProperties.Add(selectProperties); - } - result = keywordQuery; - } - else - { - result = null; - } - return result; - } - - /// - /// Returns the query to filter the matters/ documents for common filters. - /// - /// The search object. - /// The keyword query. - /// Flag to identify matters/documents view. - /// It returns a keyword query object. - internal static KeywordQuery FilterCommonDetails(SearchObject searchObject, KeywordQuery keywordQuery, bool isMatterView) - { - if (null != searchObject && null != keywordQuery) - { - - if (null != searchObject.Filters.DateFilters) - { - string lastModifiedTime = SearchConstants.ManagedPropertyLastModifiedTime; - //// Add refiner for Modified date value - if (!isMatterView) - { - lastModifiedTime = SearchConstants.ManagedPropertyDocumentLastModifiedTime; - } - keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.ModifiedFromDate, searchObject.Filters.DateFilters.ModifiedToDate, lastModifiedTime); - - ////// Add refiner for Created date value - keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.CreatedFromDate, searchObject.Filters.DateFilters.CreatedToDate, SearchConstants.ManagedPropertyCreated); - } - } - return keywordQuery; - } - - /// - /// Adds date refinement filter to the keyword query object - /// - /// The keyword query - /// From date - /// To date - /// Managed property name - /// Returns a keyword query object - internal static KeywordQuery AddDateRefinementFilter(KeywordQuery keywordQuery, string fromDate, string toDate, string managedProperty) - { - if (!string.IsNullOrWhiteSpace(fromDate) && !string.IsNullOrWhiteSpace(toDate)) - { - keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ConstantStrings.COLON, ConstantStrings.OperatorRange, ConstantStrings.OpeningBracket, fromDate, ConstantStrings.Comma, toDate, ConstantStrings.ClosingBracket)); - } - else if (string.IsNullOrWhiteSpace(fromDate) && !string.IsNullOrWhiteSpace(toDate)) - { - keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ConstantStrings.COLON, ConstantStrings.OperatorRange, ConstantStrings.OpeningBracket, ConstantStrings.MinDate, ConstantStrings.Comma, toDate, ConstantStrings.ClosingBracket)); - } - else if (!string.IsNullOrWhiteSpace(fromDate) && string.IsNullOrWhiteSpace(toDate)) - { - keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ConstantStrings.COLON, ConstantStrings.OperatorRange, ConstantStrings.OpeningBracket, fromDate, ConstantStrings.Comma, ConstantStrings.MaxDate, ConstantStrings.ClosingBracket)); - } - return keywordQuery; - } - - /// - /// Prepares and returns the query to filter the documents. - /// - /// The search object. - /// The keyword query. - /// It returns a Keyword Query object. - internal static KeywordQuery FilterDocuments(SearchObject searchObject, KeywordQuery keywordQuery) - { - string filterValues = string.Empty; - if (null != searchObject && null != keywordQuery) - { - if (null != searchObject.Filters) - { - keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.FromDate, searchObject.Filters.ToDate, SearchConstants.ManagedPropertyCreated); - if (null != searchObject.Filters.DocumentAuthor && !string.IsNullOrWhiteSpace(searchObject.Filters.DocumentAuthor)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyAuthor, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.DocumentAuthor, ConstantStrings.DoubleQuote)); - } - - if (0 < searchObject.Filters.ClientsList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.ClientsList[0])) - { - filterValues = SearchHelperFunctions.FormFilterQuery(SearchConstants.ManagedPropertyDocumentClientName, searchObject.Filters.ClientsList); - keywordQuery.RefinementFilters.Add(filterValues); - } - - /* New refinement filters for list view control */ - - if (!string.IsNullOrWhiteSpace(searchObject.Filters.Name)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyFileName, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.Name, ConstantStrings.DoubleQuote)); - } - - if (!string.IsNullOrWhiteSpace(searchObject.Filters.ClientName)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyDocumentClientName, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.ClientName, ConstantStrings.DoubleQuote)); - } - - if (null != searchObject.Filters.DocumentCheckoutUsers && !string.IsNullOrWhiteSpace(searchObject.Filters.DocumentCheckoutUsers)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyDocumentCheckOutUser, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.DocumentCheckoutUsers, ConstantStrings.DoubleQuote)); - } - } - keywordQuery = FilterCommonDetails(searchObject, keywordQuery, false); - } - return keywordQuery; - } - - /// - /// Returns the query to filter the matters. - /// - /// The search object. - /// The keyword query. - /// It returns a keyword query object. - internal static KeywordQuery FilterMattersUtility(SearchObject searchObject, KeywordQuery keywordQuery) - { - if (null != searchObject && null != keywordQuery && null != searchObject.Filters) - { - /* New refinement filters for list view control */ - if (!string.IsNullOrWhiteSpace(searchObject.Filters.Name)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyMatterName, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.Name, ConstantStrings.DoubleQuote)); - } - - if (!string.IsNullOrWhiteSpace(searchObject.Filters.ClientName)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyClientName, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.ClientName, ConstantStrings.DoubleQuote)); - } - - if (null != searchObject.Filters.ResponsibleAttorneys && !string.IsNullOrWhiteSpace(searchObject.Filters.ResponsibleAttorneys)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertyResponsibleAttorney, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.ResponsibleAttorneys, ConstantStrings.DoubleQuote)); - } - - if (!string.IsNullOrWhiteSpace(searchObject.Filters.SubareaOfLaw)) - { - keywordQuery.RefinementFilters.Add(string.Concat(SearchConstants.ManagedPropertySubAreaOfLaw, ConstantStrings.COLON, ConstantStrings.DoubleQuote, searchObject.Filters.SubareaOfLaw, ConstantStrings.DoubleQuote)); - } - if (null != searchObject.Filters.DateFilters) - { - ////// Add refiner for Open date value - keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.OpenDateFrom, searchObject.Filters.DateFilters.OpenDateTo, SearchConstants.ManagedPropertyOpenDate); - } - } - - return keywordQuery; - } - - /// - /// Returns the query to filter the matters. - /// - /// The search object. - /// The keyword query. - /// It returns a keyword query object. - internal static KeywordQuery FilterMatters(SearchObject searchObject, KeywordQuery keywordQuery) - { - string filterValues = string.Empty; - if (null != searchObject && null != keywordQuery) - { - if (null != searchObject.Filters) - { - if (null != searchObject.Filters.AOLList && 0 < searchObject.Filters.AOLList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.AOLList[0])) - { - filterValues = SearchHelperFunctions.FormFilterQuery(SearchConstants.ManagedPropertyAreaOfLaw, searchObject.Filters.AOLList); - keywordQuery.RefinementFilters.Add(filterValues); - } - - if (null != searchObject.Filters.PGList && 0 < searchObject.Filters.PGList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.PGList[0])) - { - filterValues = SearchHelperFunctions.FormFilterQuery(SearchConstants.ManagedPropertyPracticeGroup, searchObject.Filters.PGList); - keywordQuery.RefinementFilters.Add(filterValues); - } - keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.FromDate, searchObject.Filters.ToDate, SearchConstants.ManagedPropertyOpenDate); - if (null != searchObject.Filters.ClientsList && 0 < searchObject.Filters.ClientsList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.ClientsList[0])) - { - filterValues = SearchHelperFunctions.FormFilterQuery(SearchConstants.ManagedPropertyClientName, searchObject.Filters.ClientsList); - keywordQuery.RefinementFilters.Add(filterValues); - } - } - - keywordQuery = FilterMattersUtility(searchObject, keywordQuery); - - keywordQuery = SearchHelperFunctions.FilterCommonDetails(searchObject, keywordQuery, true); - } - return keywordQuery; - } - - /// - /// Fires query on SharePoint Search and fills the result data. - /// - /// The client context. - /// The keyword query. - /// The search object. - /// The flag to determine weather call is from Search Matter or Search Document. - /// List of managed properties - /// It returns a string object, that contains all the results combined with dollar pipe dollar separator. - internal static string FillResultData(ClientContext clientContext, KeywordQuery keywordQuery, SearchObject searchObject, Boolean isMatterSearch, List managedProperties) - { - string result = string.Empty; - Boolean isReadOnly; - try - { - if (null != searchObject.Sort) - { - keywordQuery.EnableSorting = true; - keywordQuery = SearchHelperFunctions.GetSortByProperty(keywordQuery, searchObject, isMatterSearch); - } - SearchExecutor searchExecutor = new SearchExecutor(clientContext); - ClientResult resultsTableCollection = searchExecutor.ExecuteQuery(keywordQuery); - Users currentLoggedInUser = UIUtility.GetLoggedInUserDetails(clientContext); - - if (null != resultsTableCollection && null != resultsTableCollection.Value && 0 < resultsTableCollection.Value.Count && null != resultsTableCollection.Value[0].ResultRows) - { - if (isMatterSearch && 0 < resultsTableCollection.Value.Count && null != resultsTableCollection.Value[0].ResultRows && (!string.IsNullOrWhiteSpace(currentLoggedInUser.Name) || !string.IsNullOrWhiteSpace(currentLoggedInUser.Email))) - { - foreach (IDictionary matterMetadata in resultsTableCollection.Value[0].ResultRows) - { - isReadOnly = false; - if (null != matterMetadata) - { - // Decode matter properties - DecodeMatterProperties(matterMetadata); - string readOnlyUsers = Convert.ToString(matterMetadata[SearchConstants.ManagedPropertyBlockedUploadUsers], CultureInfo.InvariantCulture); - if (!string.IsNullOrWhiteSpace(readOnlyUsers)) - { - isReadOnly = IsUserReadOnlyForMatter(isReadOnly, currentLoggedInUser.Name, currentLoggedInUser.Email, readOnlyUsers); - } - matterMetadata.Add(TextConstants.IsReadOnlyUser, isReadOnly); - } - } - } - else - { - /*Keeping the code to clean the author values*/ - foreach (IDictionary documentMetadata in resultsTableCollection.Value[0].ResultRows) - { - if (null != documentMetadata) - { - string authorData = Convert.ToString(documentMetadata[SearchConstants.ManagedPropertyAuthor], CultureInfo.InvariantCulture); - int ltIndex = authorData.IndexOf(ConstantStrings.OpeningAngularBracket, StringComparison.Ordinal); - int gtIndex = authorData.IndexOf(ConstantStrings.ClosingAngularBracket, StringComparison.Ordinal); - authorData = (0 <= ltIndex && ltIndex < gtIndex) ? authorData.Remove(ltIndex, (gtIndex - ltIndex) + 1) : authorData; - authorData = authorData.Replace(ServiceConstantStrings.DoubleQuotes, string.Empty); - documentMetadata[SearchConstants.ManagedPropertyAuthor] = authorData.Trim(); - } - } - } - if (1 < resultsTableCollection.Value.Count) - { - result = string.Concat(JsonConvert.SerializeObject(resultsTableCollection.Value[0].ResultRows), ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, resultsTableCollection.Value[0].TotalRows, ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, JsonConvert.SerializeObject(resultsTableCollection.Value[1].ResultRows)); - } - else - { - if (0 == resultsTableCollection.Value[0].TotalRows) - { - result = SearchHelperFunctions.NoDataRow(managedProperties); - } - else - { - result = string.Concat(JsonConvert.SerializeObject(resultsTableCollection.Value[0].ResultRows), ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, resultsTableCollection.Value[0].TotalRows); - } - } - } - else - { - result = SearchHelperFunctions.NoDataRow(managedProperties); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Function to return no data row - /// - /// Managed properties information - /// No data row - internal static string NoDataRow(List managedProperties) - { - - Dictionary noDataObject = new Dictionary(); - managedProperties.Add(ServiceConstantStrings.PathFieldName); - foreach (string managedProperty in managedProperties) - { - if (!noDataObject.ContainsKey(managedProperty)) - { - noDataObject.Add(managedProperty, string.Empty); - } - } - - string result = string.Concat(ServiceConstantStrings.OpenSquareBrace, JsonConvert.SerializeObject(noDataObject), ServiceConstantStrings.CloseSquareBrace, ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR, 0); - - return result; - - } - - /// - /// Checks if logged-in user has read permission on matter. - /// - /// Flag indicating if user has read permission on matter - /// Current logged-in user name - /// Current logged-in user email - /// List of read only user for matter - /// Flag indicating if user has read permission on matter - private static bool IsUserReadOnlyForMatter(Boolean isReadOnly, string currentLoggedInUser, string currentLoggedInUserEmail, string readOnlyUsers) - { - List readOnlyUsersList = readOnlyUsers.Trim().Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries).ToList(); - List currentReadOnlyUser = (from readOnlyUser in readOnlyUsersList - where string.Equals(readOnlyUser.Trim(), currentLoggedInUser.Trim(), StringComparison.OrdinalIgnoreCase) || - string.Equals(readOnlyUser.Trim(), currentLoggedInUserEmail.Trim(), StringComparison.OrdinalIgnoreCase) - select readOnlyUser).ToList(); - if (null != currentReadOnlyUser && 0 < currentReadOnlyUser.Count) - { - isReadOnly = true; - } - return isReadOnly; - } - - /// - /// Decodes matter properties before sending them to UI - /// - /// Dictionary object contains matter meta data - internal static void DecodeMatterProperties(IDictionary matterMetadata) - { - - // Decode matter properties - matterMetadata[SearchConstants.ManagedPropertyTitle] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyTitle]); - matterMetadata[SearchConstants.ManagedPropertySiteName] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertySiteName]); - matterMetadata[SearchConstants.ManagedPropertyDescription] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyDescription]); - matterMetadata[SearchConstants.ManagedPropertyPracticeGroup] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyPracticeGroup]); - matterMetadata[SearchConstants.ManagedPropertyAreaOfLaw] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyAreaOfLaw]); - matterMetadata[SearchConstants.ManagedPropertySubAreaOfLaw] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertySubAreaOfLaw]); - matterMetadata[SearchConstants.ManagedPropertyCustomTitle] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyCustomTitle]); - matterMetadata[SearchConstants.ManagedPropertyPath] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyPath]); - matterMetadata[SearchConstants.ManagedPropertyMatterName] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyMatterName]); - matterMetadata[SearchConstants.ManagedPropertyOpenDate] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyOpenDate]); - matterMetadata[SearchConstants.ManagedPropertyClientName] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyClientName]); - matterMetadata[SearchConstants.ManagedPropertyBlockedUploadUsers] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyBlockedUploadUsers]); - matterMetadata[SearchConstants.ManagedPropertyResponsibleAttorney] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyResponsibleAttorney]); - matterMetadata[SearchConstants.ManagedPropertyClientID] = DecodeValues(matterMetadata[SearchConstants.ManagedPropertyClientID]); - } - - /// - /// Provides the required matter properties - /// - /// Matter Properties object - /// Decoded String - internal static string DecodeValues(object value) - { - return null != value ? HttpUtility.HtmlDecode(Convert.ToString(value, CultureInfo.InvariantCulture)) : string.Empty; - } - - /// - /// Encodes the pinned user details - /// - /// Matter properties - /// Encoded String - public static string EncodeValues(string value) - { - return !string.IsNullOrWhiteSpace(value) ? Encoder.HtmlEncode(value.Trim()) : string.Empty; - } - - /// - /// Populate meta-data and perform pin operation for matter or document based upon the passed object. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Document object containing Document data - /// Status of update - internal static string PopulateMetadeta(RequestObject requestObject, Client client, MatterData matterData, DocumentData documentData) - { - string status = string.Empty; - bool isMatterCall = null != matterData ? true : false; - - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - status = isMatterCall ? SearchHelperFunctions.PinThisRecord(clientContext, matterData, true) : SearchHelperFunctions.PinThisRecord(clientContext, documentData, false); - } - } - catch (Exception exception) - { - status = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Removes pinned item from user pinned details. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Document object containing Document data - /// Status of update - internal static string UnpinItem(RequestObject requestObject, Client client, MatterData matterData, DocumentData documentData) - { - string status = string.Empty; - bool isMatterCall = null != matterData ? true : false; - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - if (isMatterCall) - { - status = SearchHelperFunctions.RemoveThisRecord(clientContext, matterData, true); - } - else - { - status = SearchHelperFunctions.RemoveThisRecord(clientContext, documentData, false); - } - } - } - catch (Exception exception) - { - status = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return status; - } - - /// - /// Encodes search results before saving to the list. - /// - /// SavedSearchDetails object containing Current search details - /// Flag for matter or document search (true = matter, false = document) - internal static void EncodeSearchDetailsUtility(FilterObject searchDetails, Boolean isMatterSearch) - { - if (isMatterSearch && null != searchDetails.Name) // Encode name only in case of Matter search - { - searchDetails.Name = Encoder.HtmlEncode(searchDetails.Name); - } - - if (null != searchDetails.ResponsibleAttorneys) - { - searchDetails.ResponsibleAttorneys = Encoder.HtmlEncode(searchDetails.ResponsibleAttorneys); - } - - if (null != searchDetails.SubareaOfLaw) - { - searchDetails.SubareaOfLaw = Encoder.HtmlEncode(searchDetails.SubareaOfLaw); - } - } - - /// - /// Encodes search results before saving to the list. - /// - /// SavedSearchDetails object containing Current search details - /// Flag for matter or document search (true = matter, false = document) - internal static void EncodeSearchDetails(FilterObject searchDetails, Boolean isMatterSearch) - { - // Encode all the values which are coming from the JS file - searchDetails.FromDate = (null != searchDetails.FromDate) ? Encoder.HtmlEncode(searchDetails.FromDate) : string.Empty; - searchDetails.ToDate = (null != searchDetails.ToDate) ? Encoder.HtmlEncode(searchDetails.ToDate) : string.Empty; - - if (null != searchDetails.AOLList) - { - IList encodedAOLList = new List(); - foreach (string aolList in searchDetails.AOLList) - { - if (!string.IsNullOrWhiteSpace(aolList)) - { - encodedAOLList.Add(Encoder.HtmlEncode(aolList)); - } - } - searchDetails.AOLList = encodedAOLList; - } - - if (null != searchDetails.PGList) - { - IList encodedPGList = new List(); - foreach (string pgList in searchDetails.PGList) - { - if (!string.IsNullOrWhiteSpace(pgList)) - { - encodedPGList.Add(Encoder.HtmlEncode(pgList)); - } - } - searchDetails.PGList = encodedPGList; - } - - - if (null != searchDetails.ClientsList) - { - IList encodedClientsList = new List(); - foreach (string clientsList in searchDetails.ClientsList) - { - if (!string.IsNullOrWhiteSpace(clientsList)) - { - encodedClientsList.Add(Encoder.HtmlEncode(clientsList)); - } - } - searchDetails.ClientsList = encodedClientsList; - } - - EncodeSearchDetailsUtility(searchDetails, isMatterSearch); - } - - /// - /// Checks if the requested page exists or not. - /// - /// URL of the page, for which check is to be performed - /// ClientContext for SharePoint - /// true or false string based upon the existence of the page, referred in requestedUrl - internal static string PageExists(string requestedUrl, ClientContext clientContext) - { - string pageExists = ConstantStrings.FALSE; - try - { - string[] requestedUrls = requestedUrl.Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries); - if (1 < requestedUrls.Length) - { - foreach (string url in requestedUrls) - { - if (Page.IsFileExists(clientContext, url)) - { - pageExists = ConstantStrings.TRUE + ConstantStrings.DOLLAR + ConstantStrings.SymbolHash + ConstantStrings.DOLLAR + url; - break; - } - } - } - else - { - pageExists = Page.IsFileExists(clientContext, requestedUrl) ? ConstantStrings.TRUE : ConstantStrings.FALSE; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return pageExists; - } - - /// - /// Fetches contextual help content from SPList. - /// - /// String object which stores json object in string format - /// String object which contains selected section id - /// Collections of section id for contextual help functionality - /// Collection of ContextHelpData - /// ClientContext for SharePoint - /// List collection object for contextual help section list - /// - internal static ListItemCollection FetchContextualHelpContentUtility(ref string result, ref string selectedSectionIDs, IList sectionID, ref List contextHelpCollection, ClientContext clientContext, ListItemCollection contextualHelpSectionListItems) - { - string[] contextualHelpLinksQueryParts = ServiceConstantStrings.ContextualHelpQueryIncludeOrCondition.Split(';'); - ListItemCollection contextualHelpLinksListItems; - foreach (ListItem oListItem in contextualHelpSectionListItems) - { - // Retrieve and save content from MatterCenterHelpSectionList - sectionID.Add(Convert.ToString(oListItem[ServiceConstantStrings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture)); - } - - // Using section ids, create caml query which will retrieve links from MatterCenterHelpLinksList - for (int index = 0; index < sectionID.Count; index++) - { - if (2 > index) - { - selectedSectionIDs = string.Concat(selectedSectionIDs, String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[0], ServiceConstantStrings.ContextualHelpSectionColumnSectionID, sectionID[index])); - } - else - { - selectedSectionIDs = String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[1], selectedSectionIDs); - selectedSectionIDs = string.Concat(selectedSectionIDs, String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[0], ServiceConstantStrings.ContextualHelpSectionColumnSectionID, sectionID[index])); - } - } - if (1 < sectionID.Count) - { - selectedSectionIDs = String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[1], selectedSectionIDs); - } - - // get Contextual Help links form MatterCenterHelpLinksList - contextualHelpLinksListItems = Lists.GetData(clientContext, ServiceConstantStrings.MatterCenterHelpLinksListName, String.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.RetrieveContextualHelpLinksQuery, selectedSectionIDs)); - //If these exists any links for contextual help flyout - if (null != contextualHelpLinksListItems && 0 < contextualHelpLinksListItems.Count) - { - foreach (ListItem oListItem in contextualHelpLinksListItems) - { - foreach (ListItem oListItemHelpSection in contextualHelpSectionListItems) - { - if (Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture) == ((Microsoft.SharePoint.Client.FieldLookupValue)(oListItem[ServiceConstantStrings.ContextualHelpLinksColumnSectionID])).LookupValue) - { - string currentLinkOrder = Convert.ToString(oListItem[ServiceConstantStrings.ContextualHelpLinksColumnLinkOrder], CultureInfo.InvariantCulture); - string currentLinkTitle = Convert.ToString(oListItem[ServiceConstantStrings.ContextualHelpLinksColumnLinkTitle], CultureInfo.InvariantCulture); - string currentLinkUrl = ((Microsoft.SharePoint.Client.FieldUrlValue)oListItem[ServiceConstantStrings.ContextualHelpLinksColumnLinkURL]).Url; - string currentPageName = Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnPageName], CultureInfo.InvariantCulture); - string numberOfColumns = Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnNumberOfColumns], CultureInfo.InvariantCulture); - - ContextHelpData contextData = new ContextHelpData - { - ContextSection = new ContextHelpSection - { - SectionID = Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture), - SectionTitle = Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnSectionTitle], CultureInfo.InvariantCulture), - SectionOrder = Convert.ToString(oListItemHelpSection[ServiceConstantStrings.ContextualHelpSectionColumnSectionOrder], CultureInfo.InvariantCulture), - PageName = currentPageName, - NumberOfColumns = numberOfColumns - }, - LinkOrder = currentLinkOrder, - LinkTitle = currentLinkTitle, - LinkURL = currentLinkUrl - }; - contextHelpCollection.Add(contextData); - } - } - } - } - - contextHelpCollection = contextHelpCollection.OrderBy(c => c.ContextSection.SectionOrder).ThenBy(c => c.LinkOrder).ToList(); - - // Serialize the object - result = JsonConvert.SerializeObject(contextHelpCollection); - return contextualHelpLinksListItems; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctionsUtility.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctionsUtility.cs deleted file mode 100644 index 013c761d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SearchHelperFunctionsUtility.cs +++ /dev/null @@ -1,57 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-shpate -// Created : 06-06-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file is being used by Search service. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.HelperClasses -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Globalization; - using System.Linq; - #endregion - - internal class SearchHelperFunctionsUtility - { - - /// - /// Retrieves the document and List GUID - /// - /// Client object containing list data - /// Client Context - /// Returns the document and List GUID - internal static string GetDocumentAndClientGUID(Client client, ClientContext clientContext) - { - string listInternalName = string.Empty, documentGUID = string.Empty, result = string.Empty; - ListCollection lists = clientContext.Web.Lists; - clientContext.Load(lists, list => list.Include(listItem => listItem.Id, listItem => listItem.RootFolder.ServerRelativeUrl)); - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(client.Id); - clientContext.Load(file, files => files.ListItemAllFields); - clientContext.ExecuteQuery(); - if (0 < file.ListItemAllFields.FieldValues.Count) - { - documentGUID = Convert.ToString(file.ListItemAllFields.FieldValues[ServiceConstantStrings.DocumentGUIDColumnName], CultureInfo.InvariantCulture); - } - - List retrievedList = (from list in lists - where list.RootFolder.ServerRelativeUrl.ToUpperInvariant().Equals(client.Name.ToUpperInvariant()) - select list).FirstOrDefault(); - if (null != retrievedList) - { - listInternalName = Convert.ToString(retrievedList.Id, CultureInfo.InvariantCulture); - } - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponseForSearch, listInternalName + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + documentGUID); - - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ServiceConstantStrings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ServiceConstantStrings.cs deleted file mode 100644 index d9b7278a..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ServiceConstantStrings.cs +++ /dev/null @@ -1,5137 +0,0 @@ -// -// Microsoft.com. All rights reserved. -// -// MAQ Software -#region Page Summary -/// ***************************************************************** -/// -/// Project: Matter Center -/// Solution: Microsoft.Legal.MatterCenter.ProviderService -/// -/// Date: November 28, 2014 -/// Description: This file is being used as an adapter between constant resource and service -/// -/// Change History: -/// Name Date Version Description -/// ------------------------------------------------------------------------------- -/// Jonathan C April 7, 2014 1.0.0.0 Accessing from resource file for service -/// Shahid A Nov 28, 2014 1.0.0.0 Added service constants for people picker control -/// Rishikesh J December 1, 2014 1.0.1.0 Implementation for Red Banner -/// ------------------------------------------------------------------------------- -/// Copyright (C) . -/// ------------------------------------------------------------------------------- -#endregion - -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region Using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Globalization; - #endregion - /// - /// Provides constants used in Matter Center. - /// - internal static class ServiceConstantStrings - { - /// - /// Accessing from resource file for service - /// - private static string practiceGroupTermSetName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Practice_Group_Term_Set_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The client term set name - /// - private static string clientTermSetName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Client_Term_Set_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The log table name - /// - private static string logTableName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "LogTableName", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS role list name - /// - private static string dmsRoleListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Role_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS role query - /// - private static string dmsRoleQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Role_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name unique identifier - /// - private static string columnNameGuid = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_Guid", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The role list column role name - /// - private static string roleListColumnRoleName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Role_List_Column_Role_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The role list column is role mandatory - /// - private static string roleListColumnIsRoleMandatory = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Role_List_Column_Is_Role_Mandatory", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The message no inputs - /// - private static string messageNoInputs = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Message_No_Inputs", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The central repository URL - /// - private static string centralRepositoryUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Central_Repository_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The DMS matter list name - /// - private static string dmsMatterListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "DMS_Matter_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The send mail list name - /// - private static string sendMailListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Send_Mail_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column matter path - /// - private static string shareListColumnMatterPath = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Matter_Path", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - private static string shareListColumnMailList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_List", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - private static string shareListColumnMailBody = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_Body", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The share list column mail list - /// - private static string shareListColumnMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_List_Column_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property practice group - /// - private static string stampedPropertyPracticeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Practice_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property area of law - /// - private static string stampedPropertyAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property sub area of law - /// - private static string stampedPropertySubAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Sub_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property matter name - /// - private static string stampedPropertyMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property matter identifier - /// - private static string stampedPropertyMatterID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property client name - /// - private static string stampedPropertyClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property client identifier - /// - private static string stampedPropertyClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Client_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property responsible attorney - /// - private static string stampedPropertyResponsibleAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Responsible_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property team members - /// - private static string stampedPropertyTeamMembers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property is matter - /// - private static string stampedPropertyIsMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Is_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property open date - /// - private static string stampedPropertyOpenDate = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Open_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property secure matter - /// - private static string stampedPropertySecureMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Secure_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Stamped Property Success - /// - private static string stampedPropertySuccess = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Success", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column client identifier - /// - private static string contentTypeColumnClientId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column client name - /// - private static string contentTypeColumnClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column matter identifier - /// - private static string contentTypeColumnMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The content type column matter name - /// - private static string contentTypeColumnMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Column_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column title - /// - private static string mattersListColumnTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column client name - /// - private static string mattersListColumnClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column client identifier - /// - private static string mattersListColumnClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Client_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column matter name - /// - private static string mattersListColumnMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column matter identifier - /// - private static string mattersListColumnMatterID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Matter_ID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict check by - /// - private static string mattersListColumnConflictCheckBy = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Check_By", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict check on - /// - private static string mattersListColumnConflictCheckOn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Check_On", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column conflict identified - /// - private static string mattersListColumnConflictIdentified = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Conflict_Identified", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column block users - /// - private static string mattersListColumnBlockUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Block_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column managing attorney - /// - private static string mattersListColumnManagingAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Managing_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matters list column support - /// - private static string mattersListColumnSupport = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matters_List_Column_Support", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property responsible attorney - /// - private static string managedPropertyResponsibleAttorney = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Responsible_Attorney", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property team members - /// - private static string managedPropertyTeamMembers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property site name - /// - private static string managedPropertySiteName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Site_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property custom title - /// - private static string managedPropertyCustomTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Custom_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property is matter - /// - private static string managedPropertyIsMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Is_Matter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property title - /// - private static string managedPropertyTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property name - /// - private static string managedPropertyName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property description - /// - private static string managedPropertyDescription = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Description", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property last modified time - /// - private static string managedPropertyLastModifiedTime = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Last_Modified_Time", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property practice group - /// - private static string managedPropertyPracticeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Practice_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property area of law - /// - private static string managedPropertyAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property sub area of law - /// - private static string managedPropertySubAreaOfLaw = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Sub_Area_Of_Law", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property matter identifier - /// - private static string managedPropertyMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property path - /// - private static string managedPropertyPath = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Path", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property matter name - /// - private static string managedPropertyMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property open date - /// - private static string managedPropertyOpenDate = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Open_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property client name - /// - private static string managedPropertyClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The all folders query - /// - private static string allFoldersQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "All_Folders_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned matter list name - /// - private static string userPinnedMatterListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Matter_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column matter details - /// - private static string pinnedListColumnMatterDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_Matter_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned details query - /// - private static string userPinnedDetailsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Details_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column user alias - /// - private static string pinnedListColumnUserAlias = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_User_Alias", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property author - /// - private static string managedPropertyAuthor = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Author", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property author - /// - private static string managedPropertyFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property is document - /// - private static string managedPropertyIsDocument = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Is_Document", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property server relative URL - /// - private static string managedPropertyServerRelativeUrl = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Server_Relative_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property file extension - /// - private static string managedPropertyFileExtension = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_File_Extension", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property created - /// - private static string managedPropertyCreated = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Created", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property UI version string OWSTEXT - /// - private static string managedPropertyUIVersionStringOWSTEXT = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_UI_Version_String_OWSTEXT", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property site title - /// - private static string managedPropertySiteTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Site_Title", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document client identifier - /// - private static string managedPropertyDocumentClientId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document client name - /// - private static string managedPropertyDocumentClientName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Client_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document matter identifier - /// - private static string managedPropertyDocumentMatterId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Matter_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document matter name - /// - private static string managedPropertyDocumentMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Matter_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property document identifier - /// - private static string managedPropertyDocumentId = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property checked out by user - /// - private static string managedPropertyCheckOutByUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_CheckOut_By_User", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user pinned document list name - /// - private static string userPinnedDocumentListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Pinned_Document_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user saved search list name - /// - private static string userSavedSearchListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Saved_Search_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The pinned list column document details - /// - private static string pinnedListColumnDocumentDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pinned_List_Column_Document_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file leaf reference - /// - private static string columnNameFileLeafRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Leaf_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file reference - /// - private static string columnNameFileRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name file DIR reference - /// - private static string columnNameFileDirRef = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_File_Dir_Ref", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name saved matters details - /// - private static string columnNameSavedMattersDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_Saved_Matters_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name saved documents details - /// - private static string columnNameSavedDocumentsDetails = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_Saved_Documents_Details", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The column name user alias - /// - private static string columnNameUserAlias = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Column_Name_User_Alias", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The property name VTI indexed property keys - /// - private static string propertyNameVtiIndexedPropertyKeys = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Property_Name_Vti_Indexed_Property_Keys", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area custom property folder names - /// - private static string subAreaCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area custom property is no folder structure present - /// - private static string subAreaCustomPropertyisNoFolderStructurePresent = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_CustomProperty_isNoFolderStructurePresent", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The area custom property folder names - /// - private static string areaCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Area_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The practice group custom property folder names - /// - private static string practiceGroupCustomPropertyFolderNames = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Practice_Group_CustomProperty_FolderNames", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sub area of law document templates - /// - private static string subAreaOfLawDocumentTemplates = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sub_Area_Of_Law_Document_Templates", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The hidden content type - /// - private static string hiddenContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Hidden_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The stamped property blocked upload users - /// - private static string stampedPropertyBlockedUploadUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Blocked_Upload_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The managed property blocked upload users - /// - private static string managedPropertyBlockedUploadUsers = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Blocked_Upload_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The find document valid extensions - /// - private static string findDocumentInvalidExtensions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Find_Document_Invalid_Extensions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Pin image location - /// - private static string pinImageLocation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Pin_Image_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Unpin image location - /// - private static string unpinImageLocation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Unpin_Image_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// One Note image location - /// - private static string oneNoteImageLocation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "OneNote_Image_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Share image location - /// - private static string shareImageLocation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Share_Image_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page image location - /// - private static string matterLandingPageLogo = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Icon", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Tenant level Web Dashboard location - /// - private static string tenantWebDashboardLink = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Tenant_WebDashboard_Link", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Microsoft Logo publish location - /// - private static string microsoftImageLocation = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Microsoft_Logo_Location", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// HTML chunk of the Default content type for Matter creation mail - /// - private static string matterMailDefaultContentTypeHtmlChunk = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Default_Content_Type_Html_Chunk", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Subject of the matter creation mail - /// - private static string matterMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The valid date format - /// - private static string validDateFormat = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Valid_Date_Format", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Suffix to be appended in calendar name - /// - private static string calendarNameSuffix = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Calendar_Name_Suffix", Enumerators.ResourceFileLocation.App_GlobalResources); - - - /// - /// The manage property Client ID - /// - private static string managedPropertyClientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Client_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter name length - /// - private static string matterNameLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Name_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Id length - /// - private static string matterIdLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Id_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter description length - /// - private static string matterDescriptionLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Description_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Content Type length - /// - private static string contentTypeLength = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Content_Type_Length", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Request Object message - /// - private static string incorrectInputRequestObjectMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Request_Object_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Request Object code - /// - private static string incorrectInputRequestObjectCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Request_Object_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Url message - /// - private static string incorrectInputClientUrlMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Url_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Url code - /// - private static string incorrectInputClientUrlCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Url_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Id message - /// - private static string incorrectInputClientIdMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Id_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client Id code - /// - private static string incorrectInputClientIdCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Id_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client name message - /// - private static string incorrectInputClientNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Client name code - /// - private static string incorrectInputClientNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Client_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Practice Group message - /// - private static string incorrectInputPracticeGroupMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Practice_Group_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Practice Group code - /// - private static string incorrectInputPracticeGroupCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Practice_Group_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Area Of Law message - /// - private static string incorrectInputAreaOfLawMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Area_Of_Law_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Area Of Law code - /// - private static string incorrectInputAreaOfLawCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Area_Of_Law_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Sub Area Of Law message - /// - private static string incorrectInputSubareaOfLawMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Subarea_Of_Law_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Sub Area Of Law code - /// - private static string incorrectInputSubareaOfLawCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Subarea_Of_Law_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Responsible Attorney message - /// - private static string incorrectInputResponsibleAttorneyMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Responsible_Attorney_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Responsible Attorney code - /// - private static string incorrectInputResponsibleAttorneyCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Responsible_Attorney_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter name message - /// - private static string incorrectInputMatterNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter name code - /// - private static string incorrectInputMatterNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter Id message - /// - private static string incorrectInputMatterIdMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Id_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter Id code - /// - private static string incorrectInputMatterIdCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Id_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user name message - /// - private static string incorrectInputUserNamesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Names_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user name code - /// - private static string incorrectInputUserNamesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Names_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user permission message - /// - private static string incorrectInputUserPermissionsMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Permissions_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user permission code - /// - private static string incorrectInputUserPermissionsCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Permissions_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Content Type message - /// - private static string incorrectInputContentTypeMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Content_Type_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Content Type code - /// - private static string incorrectInputContentTypeCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Content_Type_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter description message - /// - private static string incorrectInputMatterDescriptionMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Description_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect Matter description code - /// - private static string incorrectInputMatterDescriptionCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Matter_Description_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict date message - /// - private static string incorrectInputConflictDateMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Date_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict date code - /// - private static string incorrectInputConflictDateCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Date_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict identified message - /// - private static string incorrectInputConflictIdentifiedMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Identified_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict identified code - /// - private static string incorrectInputConflictIdentifiedCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Identified_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user roles message - /// - private static string incorrectInputUserRolesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Roles_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect user roles code - /// - private static string incorrectInputUserRolesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Roles_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict check by message - /// - private static string incorrectInputConflictCheckByMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Check_By_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect conflict check by code - /// - private static string incorrectInputConflictCheckByCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Conflict_Check_By_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect block users message - /// - private static string incorrectInputBlockUserNamesMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Block_User_Names_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect block users code - /// - private static string incorrectInputBlockUserNamesCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Block_User_Names_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Is Read Only User key name, used to determine if user is read-only user for particular matter - /// - private static string isReadOnlyUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Is_Read_Only_User", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect save search name message - /// - private static string incorrectInputSaveSearchNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Save_Search_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect save search name code - /// - private static string incorrectInputSaveSearchNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Save_Search_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect existing search name message - /// - private static string incorrectInputExistingSearchNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Existing_Search_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect existing search name code - /// - private static string incorrectInputExistingSearchNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Existing_Search_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect current search name message - /// - private static string incorrectInputCurrentSearchNameMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Current_Search_Name_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect current search name code - /// - private static string incorrectInputCurrentSearchNameCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Current_Search_Name_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect input code for user access in Provision Matter Group - /// - private static string incorrectInputUserAccessCode = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Access_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Incorrect input code for user access in Provision Matter Group - /// - private static string incorrectInputUserAccessMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_User_Access_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - - /// - /// The Matter Center help section list name - /// - private static string matterCenterHelpSectionListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Help_Section_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The Matter Center help links list name - /// - private static string matterCenterHelpLinksListName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Help_Links_List_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link Title - /// - private static string contextualHelpLinksColumnLinkTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkTitle", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link URL - /// - private static string contextualHelpLinksColumnLinkURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkURL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Link Order - /// - private static string contextualHelpLinksColumnLinkOrder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_LinkOrder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section ID - /// - private static string contextualHelpLinksColumnSectionID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Links_Column_SectionID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section ID - /// - private static string contextualHelpSectionColumnSectionID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section Title - /// - private static string contextualHelpSectionColumnSectionTitle = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionTitle", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Page Name - /// - private static string contextualHelpSectionColumnPageName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_PageName", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Section Order - /// - private static string contextualHelpSectionColumnSectionOrder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_SectionOrder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Name of the column storing Number of Columns - /// - private static string contextualHelpSectionColumnNumberOfColumns = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Section_Column_NumberOfColumns", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query to be used for retrieving contextual help sections - /// - private static string retrieveContextualHelpSectionsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Retrieve_Contextual_Help_Sections_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query to be used for retrieving contextual help links - /// - private static string retrieveContextualHelpLinksQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Retrieve_Contextual_Help_Links_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ';' separated list of page names to be used in contextual help functionality - /// - private static string matterCenterPages = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Pages", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ';' separated list to build OR part of CAMLquery to support include sections (link) - /// - private static string contextualHelpQueryIncludeOrCondition = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Contextual_Help_Query_Include_Or_Condition", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail SOAP request - /// - private static string mailSoapReuqest = - @" - - - - - - - - Default - true - - - - - - - - - - - "; - - /// - /// The attachment SOAP request - /// - private static string attachmentSoapRequest = - @" - - - - - - - - true - - - - - - - - - - - "; - - /// - /// XML definition of the left web part - /// - private static string leftBarWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - MiddleLeftZone - 0 - Normal - - 200px - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - ]]> - - - "; - - /// - /// XML definition of the template web part - /// - private static string templateWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - MiddleLeftZone - 0 - Normal - - 200px - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - Templates - -
- Looking for Templates? - - click here - -
- ]]> -
- -
"; - - /// - /// XML definition of the top menu web part - /// - private static string topMenuWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - MiddleMiddleZone - 0 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - -
Pin
-
Share
- - - - ]]> -
- -
"; - - /// - /// XML definition of the footer web part - /// - private static string footerWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - FooterZone - 0 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - -
- ​​​​​ -
- ]]>
- -
"; - - /// - /// XML definition of the header web part - /// - private static string headerWebPart = @" - - Content Editor - None - Allows authors to enter rich text content. - true - HeaderZone - 0 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - - ]]> - - - - "; - - /// - /// XML definition of the html data - /// - private static string htmlData = @"
-
    -
  • Team
  • -
  • Blocked users
  • -
-
- - "; - - /// - /// Html chunk to be added on the page - /// - private static string htmlChunk = @"

"; - - /// - /// XML definition of the RSS feed web part - /// - private static string rssFeedWebpart = @" - - - - Cannot import this web part. - - - - False - None - - - True - - <ParameterBinding Name=""RequestUrl"" Location=""WPProperty[FeedUrl]""/> - True - False - - - 5 - False - - - 0 - - 600 - 60 - True - http://www.bing.com/search?q={0}&format=rss - True - False - False - False - - - True - False - None - Normal - True - - - False - NotSet - RSS Viewer - 00000000-0000-0000-0000-000000000000 - Displays an RSS feed. - True - - - <%@ Register TagPrefix=""WebControls"" Namespace=""Microsoft.SharePoint.WebControls"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> - <%@ Register TagPrefix=""WebPartPages"" Namespace=""Microsoft.SharePoint.WebPartPages"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> - <WebControls:XmlUrlDataSource runat=""server"" AuthType=""None"" HttpMethod=""GET""> - <DataFileParameters> - <WebPartPages:DataFormParameter Name=""RequestUrl"" ParameterKey=""RequestUrl"" PropertyName=""ParameterValues""/> - </DataFileParameters> - </WebControls:XmlUrlDataSource> - - PAGE_NORMALVIEW - - True - All - 120 - -1 - - - - True - - Cannot import this web part. - Modeless - - - - "; - - /// - /// XML definition of the calendar web part - /// - private static string calendarWebpart = @" - - Calendar - None - - true - wpz - 5 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/itevent.png?rev=35 - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ListViewWebPart - 00000000-0000-0000-0000-000000000000 - <View Name=""{0}"" MobileView=""TRUE"" Type=""CALENDAR"" Hidden=""TRUE"" TabularView=""FALSE"" RecurrenceRowset=""TRUE"" DisplayName="" "" Url=""{1}"" Level=""1"" BaseViewID=""2"" ContentTypeID=""0x"" MobileUrl=""_layouts/15/mobile/viewdaily.aspx"" ImageUrl=""/_layouts/15/images/events.png?rev=37""><Toolbar Type=""None"" /><ViewHeader /><ViewBody /><ViewFooter /><ViewEmpty /><ParameterBindings><ParameterBinding Name=""NoAnnouncements"" Location=""Resource(wss,noXinviewofY_LIST)"" /><ParameterBinding Name=""NoAnnouncementsHowTo"" Location=""Resource(wss,noXinviewofY_DEFAULT)"" /></ParameterBindings><ViewFields><FieldRef Name=""EventDate"" /><FieldRef Name=""EndDate"" /><FieldRef Name=""fRecurrence"" /><FieldRef Name=""EventType"" /><FieldRef Name=""WorkspaceLink"" /><FieldRef Name=""Title"" /><FieldRef Name=""Location"" /><FieldRef Name=""Description"" /><FieldRef Name=""Workspace"" /><FieldRef Name=""MasterSeriesItemID"" /><FieldRef Name=""fAllDayEvent"" /></ViewFields><ViewData><FieldRef Name=""Title"" Type=""CalendarMonthTitle"" /><FieldRef Name=""Title"" Type=""CalendarWeekTitle"" /><FieldRef Name=""Location"" Type=""CalendarWeekLocation"" /><FieldRef Name=""Title"" Type=""CalendarDayTitle"" /><FieldRef Name=""Location"" Type=""CalendarDayLocation"" /></ViewData><Query><Where><DateRangesOverlap><FieldRef Name=""EventDate"" /><FieldRef Name=""EndDate"" /><FieldRef Name=""RecurrenceID"" /><Value Type=""DateTime""><Month /></Value></DateRangesOverlap></Where></Query></View> - {2} - {3} - 8921097 - Html Hidden RecurrenceRowset Calendar Mobile - 0x - "; - - /// - /// XML definition of the list view web part - /// - private static string listviewWebpart = @" - - - - - Cannot import this Web Part. - - - - False - - - True - - - False - - {0} - {1} - False - NotSet - False - Html, TabularView, Hidden, Mobile - True - {2} - - True - Normal - False - - - All - False - True - True - - Modeless - - True - 86400 - None - - - /_layouts/15/images/itdl.png?rev=33 - - True - - -1 - True - - - False - - PAGE_NORMALVIEW - - True - False - 00000000-0000-0000-0000-000000000000 - - main.xsl - False - - False - <View Name=""{3}"" MobileView=""TRUE"" Type=""HTML"" Hidden=""TRUE"" DisplayName="" "" Url=""{4}"" Level=""1"" BaseViewID=""1"" ContentTypeID=""0x"" ImageUrl=""/_layouts/15/images/dlicon.png?rev=37"" ><Query><OrderBy><FieldRef Name=""FileLeafRef""/></OrderBy></Query><ViewFields><FieldRef Name=""DocIcon""/><FieldRef Name=""LinkFilename""/><FieldRef Name=""Modified""/><FieldRef Name=""Editor""/></ViewFields><RowLimit Paged=""TRUE"">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=""TRUE"">main.xsl</XslLink><Toolbar Type=""Standard""/></View> - False - True - - <ParameterBinding Name=""dvt_sortdir"" Location=""Postback;Connection""/> - <ParameterBinding Name=""dvt_sortfield"" Location=""Postback;Connection""/> - <ParameterBinding Name=""dvt_startposition"" Location=""Postback"" DefaultValue="" ""/> - <ParameterBinding Name=""dvt_firstrow"" Location=""Postback;Connection""/> - <ParameterBinding Name=""OpenMenuKeyAccessible"" Location=""Resource(wss,OpenMenuKeyAccessible)"" /> - <ParameterBinding Name=""open_menu"" Location=""Resource(wss,open_menu)"" /> - <ParameterBinding Name=""select_deselect_all"" Location=""Resource(wss,select_deselect_all)"" /> - <ParameterBinding Name=""idPresEnabled"" Location=""Resource(wss,idPresEnabled)"" /><ParameterBinding Name=""NoAnnouncements"" Location=""Resource(wss,noitemsinview_doclibrary)"" /><ParameterBinding Name=""NoAnnouncementsHowTo"" Location=""Resource(wss,noitemsinview_doclibrary_howto2)"" /> - List - 60 - False - - Cannot import this Web Part. - - - False - - - - "; - - /// - /// XML definition of the content editor web part for users - /// - private static string contentEditorWebpartUsers = @" - - User Details - None - Allows authors to enter rich text content. - true - wpz - 0 - Normal - - - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - - - "; - - /// - /// XML definition of content editor web part for metadata - /// - private static string contentEditorWebpartMetadata = @" - - - None - Allows authors to enter rich text content. - true - wpz - 0 - Normal - - 825px - true - true - true - true - true - true - true - - - Modeless - Default - - Cannot import this Web Part. - /_layouts/15/images/mscontl.gif - - Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c - Microsoft.SharePoint.WebPartPages.ContentEditorWebPart - - - - - - "; - - /// - /// The invalid char regex - /// - private static string invalidCharRegex = @"[\*\?\|\\\t/:""'<>#{}%~&]"; - - /// - /// The start end regex - /// - private static string startEndregex = @"^[\. ]|[\. ]$"; - - /// - /// The invalid rule regex - /// - private static string invalidRuleRegex = @"\.{2,}"; - - /// - /// The extra space regex - /// - private static string extraSpaceRegex = " {2,}"; - - /// - /// The invalid file name regex - /// - private static string invalidFileNameRegex = "_fajlovi|.files|-Dateien|_fichiers|_bestanden|_file|_archivos|-filer|_tiedostot|_pliki|_soubory|_elemei|_ficheiros|_arquivos|_dosyalar|_datoteke|_fitxers|_failid|_fails|_bylos|_fajlovi|_fitxategiak$"; - - /// - /// The no mail subject - /// - private static string noMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "No_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The provision DMS matter app URL - /// - private static string provisionMatterAppURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Provision_Matter_App_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The matter configurations list name - /// - private static string matterConfigurationsList = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configurations_List", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The is tenant deployment - /// - private static bool isTenantDeployment = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsTenantDeployment", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is major version enable - /// - private static bool isMajorVersionEnable = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsMajorVersionEnable", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is minor version enable - /// - private static bool isMinorVersionEnable = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsMinorVersionEnable", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The is force check out - /// - private static bool isForceCheckOut = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsForceCheckOut", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// This indicates whether to create calendar or not - /// - private static bool isCreateCalendarEnabled = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsCreateCalendarEnabled", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The brief case items query - /// - private static string briefCaseItemsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Briefcase_Items_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The get item by name query - /// - private static string getItemByNameQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Item_By_Name_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The missing parameters message - /// - private static string missingParametersMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Parameter_Missing_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The invalid parameters message - /// - private static string invalidParametersMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Parameter_Invalid_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The briefcase folder query - /// - private static string briefcaseFolderQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Legal_Briefcase_Folder_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The briefcase folder contents query - /// - private static string briefcaseFolderContentsQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Get_Legal_Briefcase_Folder_Contents", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The legal briefcase folder - /// - private static string legalBriefcaseFolder = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Legal_Briefcase_Folder_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive content type name - /// - private static string oneDriveContentTypeName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The already check out - /// - private static string alreadyCheckOut = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Already_Check_Out_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The send to matter query - /// - private static string sendToMatterQuery = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Send_To_Matter_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user My site not present - /// - private static string userMySiteNotPresent = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_My_Site_Not_Present", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive parent content type - /// - private static string oneDriveParentContentType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Parent_Content_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column schema - /// - private static string oneDriveSiteColumnSchema = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column_Schema", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive content type group - /// - private static string oneDriveContentTypeGroup = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Content_Type_Group", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column - /// - private static string oneDriveSiteColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The OneDrive site column type - /// - private static string oneDriveSiteColumnType = ConstantStrings.GetConfigurationFromResourceFile("Constants", "One_Drive_Site_Column_Type", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail cart mail subject - /// - private static string mailCartMailSubject = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Mail_Cart_Mail_Subject", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The mail cart mail body - /// - private static string mailCartMailBody = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Mail_Cart_Mail_Body", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The exchange service URL - /// - private static string exchangeServiceURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Exchange_Service_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user Permissions on create matter library - /// - private static string userPermissions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Permissions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// jQuery file name - /// - private static string jqueryFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_jQuery_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page JS file name - /// - private static string matterLandingJSFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Script_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page CSS file name - /// - private static string matterLandingCSSFileName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_CSS_File_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Matter Landing page folder name on SharePoint - /// - private static string matterLandingFolderName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Folder", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Link to templates document library on content type hub - /// - private static string templateDocLibraryLink = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Template_Document_Library_Link", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Link to templates document library on content type hub - /// - private static string fileNotAvailableMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "File_Not_Available_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Success message on deletion of matter - /// - private static string matterDeletedSuccessfully = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Deletion_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the number of search results (users) to pull from people picker service based on the search term. This will return email enabled users as well as non-email enabled users. - /// - private static string peoplePickerMaximumEntitySuggestions = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Max_Entity_Suggestions", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the number of records to pull which has email property from client picker service results. - /// - private static string peoplePickerMaxRecords = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Max_Records", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the flag to allow multiple users to be searched using people picker service. - /// - private static string peoplePickerAllowMultipleEntities = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_Allow_Multiple_Entities", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the message for no data returned from people picker control based on the search term. - /// - private static string peoplePickerNoResults = ConstantStrings.GetConfigurationFromResourceFile("Constants", "People_Picker_No_Results_Found", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the relative location for OneNote file that is uploaded upon matter creation - /// - private static string oneNoteRelativeFilePath = "~/Open Notebook.onetoc2"; - - /// - /// Holds the managed property for retrieving version of the document - /// - private static string managedPropertyDocumentVersion = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_Version", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Holds the managed property for retrieving checked out user of the document - /// - private static string managedPropertyDocumentCheckOutUser = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_Document_CheckOutUser", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Property value column of Matter Configurations list - /// - private static string matterConfigurationColumn = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configuration_List_Column_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Content check flag default value - /// - private static bool isContentCheck = Convert.ToBoolean(ConstantStrings.GetConfigurationFromResourceFile("Constants", "Is_Content_Check", Enumerators.ResourceFileLocation.App_GlobalResources), CultureInfo.InvariantCulture); - - /// - /// The tenant url - /// - private static string siteURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Site_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// ENUM operationTypes - /// - internal enum OperationTypes - { - /// - /// The current - /// - Current, - - /// - /// The update - /// - Update, - - /// - /// The checkout - /// - Checkout, - - /// - /// The detach - /// - Detach, - - /// - /// The check in - /// - CheckIn - } - - /// - /// Gets the name of the practice group term set. - /// - /// The name of the practice group term set. - internal static string PracticeGroupTermSetName - { - get - { - return practiceGroupTermSetName; - } - } - - /// - /// Gets the name of the client term set. - /// - /// The name of the client term set. - internal static string ClientTermSetName - { - get - { - return clientTermSetName; - } - } - - /// - /// Gets the name of the log table. - /// - /// The name of the log table. - internal static string LogTableName - { - get - { - return logTableName; - } - } - - /// - /// Gets the name of the DMS role list. - /// - /// The name of the DMS role list. - internal static string DMSRoleListName - { - get - { - return dmsRoleListName; - } - } - - /// - /// Gets the DMS role query. - /// - /// The DMS role query. - internal static string DMSRoleQuery - { - get - { - return dmsRoleQuery; - } - } - - /// - /// Gets the column name unique identifier. - /// - /// The column name unique identifier. - internal static string ColumnNameGuid - { - get - { - return columnNameGuid; - } - } - - /// - /// Gets the name of the role list column role. - /// - /// The name of the role list column role. - internal static string RoleListColumnRoleName - { - get - { - return roleListColumnRoleName; - } - } - - /// - /// Gets the role list column is role mandatory. - /// - /// The role list column is role mandatory. - internal static string RoleListColumnIsRoleMandatory - { - get - { - return roleListColumnIsRoleMandatory; - } - } - - /// - /// Gets the message no inputs. - /// - /// The message no inputs. - internal static string MessageNoInputs - { - get - { - return messageNoInputs; - } - } - - /// - /// Gets the central repository URL. - /// - /// The central repository URL. - internal static string CentralRepositoryUrl - { - get - { - return centralRepositoryUrl; - } - } - - /// - /// Gets the name of the DMS matter list. - /// - /// The name of the DMS matter list. - internal static string DMSMatterListName - { - get - { - return dmsMatterListName; - } - } - - /// - /// Gets the name of the send mail list. - /// - /// The name of the send mail list. - internal static string SendMailListName - { - get - { - return sendMailListName; - } - } - - /// - /// Gets the share list column matter path. - /// - /// The share list column matter path. - internal static string ShareListColumnMatterPath - { - get - { - return shareListColumnMatterPath; - } - } - - /// - /// Gets the stamped property practice group. - /// - /// The stamped property practice group. - internal static string StampedPropertyPracticeGroup - { - get - { - return stampedPropertyPracticeGroup; - } - } - - /// - /// Gets the stamped property area of law. - /// - /// The stamped property area of law. - internal static string StampedPropertyAreaOfLaw - { - get - { - return stampedPropertyAreaOfLaw; - } - } - - /// - /// Gets the stamped property sub area of law. - /// - /// The stamped property sub area of law. - internal static string StampedPropertySubAreaOfLaw - { - get - { - return stampedPropertySubAreaOfLaw; - } - } - - /// - /// Gets the name of the stamped property matter. - /// - /// The name of the stamped property matter. - internal static string StampedPropertyMatterName - { - get - { - return stampedPropertyMatterName; - } - } - - /// - /// Gets the stamped property matter identifier. - /// - /// The stamped property matter identifier. - internal static string StampedPropertyMatterID - { - get - { - return stampedPropertyMatterID; - } - } - - /// - /// Gets the name of the stamped property client. - /// - /// The name of the stamped property client. - internal static string StampedPropertyClientName - { - get - { - return stampedPropertyClientName; - } - } - - /// - /// Gets the stamped property client identifier. - /// - /// The stamped property client identifier. - internal static string StampedPropertyClientID - { - get - { - return stampedPropertyClientID; - } - } - - /// - /// Gets the stamped property responsible attorney. - /// - /// The stamped property responsible attorney. - internal static string StampedPropertyResponsibleAttorney - { - get - { - return stampedPropertyResponsibleAttorney; - } - } - - /// - /// Gets the stamped property team members. - /// - /// The stamped property team members. - internal static string StampedPropertyTeamMembers - { - get - { - return stampedPropertyTeamMembers; - } - } - - /// - /// Gets the stamped property is matter. - /// - /// The stamped property is matter. - internal static string StampedPropertyIsMatter - { - get - { - return stampedPropertyIsMatter; - } - } - - /// - /// Gets the stamped property open date. - /// - /// The stamped property open date. - internal static string StampedPropertyOpenDate - { - get - { - return stampedPropertyOpenDate; - } - } - - /// - /// Gets the stamped property secure matter. - /// - /// The stamped property secure matter. - internal static string StampedPropertySecureMatter - { - get - { - return stampedPropertySecureMatter; - } - } - - /// - /// Gets the stamped property success - /// - /// The stamped property success - internal static string StampedPropertySuccess - { - get - { - return stampedPropertySuccess; - } - } - - - /// - /// Gets the content type column client identifier. - /// - /// The content type column client identifier. - internal static string ContentTypeColumnClientId - { - get - { - return contentTypeColumnClientId; - } - } - - /// - /// Gets the name of the content type column client. - /// - /// The name of the content type column client. - internal static string ContentTypeColumnClientName - { - get - { - return contentTypeColumnClientName; - } - } - - /// - /// Gets the content type column matter identifier. - /// - /// The content type column matter identifier. - internal static string ContentTypeColumnMatterId - { - get - { - return contentTypeColumnMatterId; - } - } - - /// - /// Gets the name of the content type column matter. - /// - /// The name of the content type column matter. - internal static string ContentTypeColumnMatterName - { - get - { - return contentTypeColumnMatterName; - } - } - - /// - /// Gets the matters list column title. - /// - /// The matters list column title. - internal static string MattersListColumnTitle - { - get - { - return mattersListColumnTitle; - } - } - - /// - /// Gets the name of the matters list column client. - /// - /// The name of the matters list column client. - internal static string MattersListColumnClientName - { - get - { - return mattersListColumnClientName; - } - } - - /// - /// Gets the matters list column client identifier. - /// - /// The matters list column client identifier. - internal static string MattersListColumnClientID - { - get - { - return mattersListColumnClientID; - } - } - - /// - /// Gets the name of the matters list column matter. - /// - /// The name of the matters list column matter. - internal static string MattersListColumnMatterName - { - get - { - return mattersListColumnMatterName; - } - } - - /// - /// Gets the matters list column matter identifier. - /// - /// The matters list column matter identifier. - internal static string MattersListColumnMatterID - { - get - { - return mattersListColumnMatterID; - } - } - - /// - /// Gets the matters list column conflict check by. - /// - /// The matters list column conflict check by. - internal static string MattersListColumnConflictCheckBy - { - get - { - return mattersListColumnConflictCheckBy; - } - } - - /// - /// Gets the matters list column conflict check on. - /// - /// The matters list column conflict check on. - internal static string MattersListColumnConflictCheckOn - { - get - { - return mattersListColumnConflictCheckOn; - } - } - - /// - /// Gets the matters list column conflict identified. - /// - /// The matters list column conflict identified. - internal static string MattersListColumnConflictIdentified - { - get - { - return mattersListColumnConflictIdentified; - } - } - - /// - /// Gets the matters list column block users. - /// - /// The matters list column block users. - internal static string MattersListColumnBlockUsers - { - get - { - return mattersListColumnBlockUsers; - } - } - - /// - /// Gets the matters list column managing attorney. - /// - /// The matters list column managing attorney. - internal static string MattersListColumnManagingAttorney - { - get - { - return mattersListColumnManagingAttorney; - } - } - - /// - /// Gets the matters list column support. - /// - /// The matters list column support. - internal static string MattersListColumnSupport - { - get - { - return mattersListColumnSupport; - } - } - - /// - /// Gets the managed property responsible attorney. - /// - /// The managed property responsible attorney. - internal static string ManagedPropertyResponsibleAttorney - { - get - { - return managedPropertyResponsibleAttorney; - } - } - - /// - /// Gets the managed property team members. - /// - /// The managed property team members. - internal static string ManagedPropertyTeamMembers - { - get - { - return managedPropertyTeamMembers; - } - } - - /// - /// Gets the name of the managed property site. - /// - /// The name of the managed property site. - internal static string ManagedPropertySiteName - { - get - { - return managedPropertySiteName; - } - } - - /// - /// Gets the managed property custom title. - /// - /// The managed property custom title. - internal static string ManagedPropertyCustomTitle - { - get - { - return managedPropertyCustomTitle; - } - } - - /// - /// Gets the managed property is matter. - /// - /// The managed property is matter. - internal static string ManagedPropertyIsMatter - { - get - { - return managedPropertyIsMatter; - } - } - - /// - /// Gets the managed property title. - /// - /// The managed property title. - internal static string ManagedPropertyTitle - { - get - { - return managedPropertyTitle; - } - } - - /// - /// Gets the name of the managed property. - /// - /// The name of the managed property. - internal static string ManagedPropertyName - { - get - { - return managedPropertyName; - } - } - - /// - /// Gets the managed property description. - /// - /// The managed property description. - internal static string ManagedPropertyDescription - { - get - { - return managedPropertyDescription; - } - } - - /// - /// Gets the managed property last modified time. - /// - /// The managed property last modified time. - internal static string ManagedPropertyLastModifiedTime - { - get - { - return managedPropertyLastModifiedTime; - } - } - - /// - /// Gets the managed property practice group. - /// - /// The managed property practice group. - internal static string ManagedPropertyPracticeGroup - { - get - { - return managedPropertyPracticeGroup; - } - } - - /// - /// Gets the managed property area of law. - /// - /// The managed property area of law. - internal static string ManagedPropertyAreaOfLaw - { - get - { - return managedPropertyAreaOfLaw; - } - } - - /// - /// Gets the managed property sub area of law. - /// - /// The managed property sub area of law. - internal static string ManagedPropertySubAreaOfLaw - { - get - { - return managedPropertySubAreaOfLaw; - } - } - - /// - /// Gets the managed property matter identifier. - /// - /// The managed property matter identifier. - internal static string ManagedPropertyMatterId - { - get - { - return managedPropertyMatterId; - } - } - - /// - /// Gets the managed property path. - /// - /// The managed property path. - internal static string ManagedPropertyPath - { - get - { - return managedPropertyPath; - } - } - - /// - /// Gets the name of the managed property matter. - /// - /// The name of the managed property matter. - internal static string ManagedPropertyMatterName - { - get - { - return managedPropertyMatterName; - } - } - - /// - /// Gets the managed property open date. - /// - /// The managed property open date. - internal static string ManagedPropertyOpenDate - { - get - { - return managedPropertyOpenDate; - } - } - - /// - /// Gets the name of the managed property client. - /// - /// The name of the managed property client. - internal static string ManagedPropertyClientName - { - get - { - return managedPropertyClientName; - } - } - - /// - /// Gets all folders query. - /// - /// All folders query. - internal static string AllFoldersQuery - { - get - { - return allFoldersQuery; - } - } - - /// - /// Gets the name of the user pinned matter list. - /// - /// The name of the user pinned matter list. - internal static string UserPinnedMatterListName - { - get - { - return userPinnedMatterListName; - } - } - - /// - /// Gets the pinned list column matter details. - /// - /// The pinned list column matter details. - internal static string PinnedListColumnMatterDetails - { - get - { - return pinnedListColumnMatterDetails; - } - } - - /// - /// Gets the user pinned details query. - /// - /// The user pinned details query. - internal static string UserPinnedDetailsQuery - { - get - { - return userPinnedDetailsQuery; - } - } - - /// - /// Gets the pinned list column user alias. - /// - /// The pinned list column user alias. - internal static string PinnedListColumnUserAlias - { - get - { - return pinnedListColumnUserAlias; - } - } - - /// - /// Gets the managed property author. - /// - /// The managed property author. - internal static string ManagedPropertyAuthor - { - get - { - return managedPropertyAuthor; - } - } - - /// - /// Gets the managed property file name. - /// - /// The managed property author. - internal static string ManagedPropertyFileName - { - get - { - return managedPropertyFileName; - } - } - - /// - /// Gets the managed property is document. - /// - /// The managed property is document. - internal static string ManagedPropertyIsDocument - { - get - { - return managedPropertyIsDocument; - } - } - - /// - /// Gets the managed property server relative URL. - /// - /// The managed property server relative URL. - internal static string ManagedPropertyServerRelativeUrl - { - get - { - return managedPropertyServerRelativeUrl; - } - } - - /// - /// Gets the managed property file extension. - /// - /// The managed property file extension. - internal static string ManagedPropertyFileExtension - { - get - { - return managedPropertyFileExtension; - } - } - - /// - /// Gets the managed property created. - /// - /// The managed property created. - internal static string ManagedPropertyCreated - { - get - { - return managedPropertyCreated; - } - } - - /// - /// Gets the managed property UI version string OWS text. - /// - /// The managed property UI version string OWS text. - internal static string ManagedPropertyUIVersionStringOWSTEXT - { - get - { - return managedPropertyUIVersionStringOWSTEXT; - } - } - - /// - /// Gets the managed property site title. - /// - /// The managed property site title. - internal static string ManagedPropertySiteTitle - { - get - { - return managedPropertySiteTitle; - } - } - - /// - /// Gets the managed property document client identifier. - /// - /// The managed property document client identifier. - internal static string ManagedPropertyDocumentClientId - { - get - { - return managedPropertyDocumentClientId; - } - } - - /// - /// Gets the name of the managed property document client. - /// - /// The name of the managed property document client. - internal static string ManagedPropertyDocumentClientName - { - get - { - return managedPropertyDocumentClientName; - } - } - - /// - /// Gets the managed property document matter identifier. - /// - /// The managed property document matter identifier. - internal static string ManagedPropertyDocumentMatterId - { - get - { - return managedPropertyDocumentMatterId; - } - } - - /// - /// Gets the name of the managed property document matter. - /// - /// The name of the managed property document matter. - internal static string ManagedPropertyDocumentMatterName - { - get - { - return managedPropertyDocumentMatterName; - } - } - - /// - /// Gets the managed property document identifier. - /// - /// The managed property document identifier. - internal static string ManagedPropertyDocumentId - { - get - { - return managedPropertyDocumentId; - } - } - - /// - /// Gets the managed property check out by user. - /// - /// The managed property check out by user. - internal static string ManagedPropertyCheckOutByUser - { - get - { - return managedPropertyCheckOutByUser; - } - } - - /// - /// Gets the name of the user pinned document list. - /// - /// The name of the user pinned document list. - internal static string UserPinnedDocumentListName - { - get - { - return userPinnedDocumentListName; - } - } - - /// - /// Gets the name of the user saved search list. - /// - /// The name of the user saved search list. - internal static string UserSavedSearchListName - { - get - { - return userSavedSearchListName; - } - } - - /// - /// Gets the pinned list column document details. - /// - /// The pinned list column document details. - internal static string PinnedListColumnDocumentDetails - { - get - { - return pinnedListColumnDocumentDetails; - } - } - - /// - /// Gets the column name file leaf reference. - /// - /// The column name file leaf reference. - internal static string ColumnNameFileLeafRef - { - get - { - return columnNameFileLeafRef; - } - } - - /// - /// Gets the column name file reference. - /// - /// The column name file reference. - internal static string ColumnNameFileRef - { - get - { - return columnNameFileRef; - } - } - - /// - /// Gets the column name file directory reference. - /// - /// The column name file directory reference. - internal static string ColumnNameFileDirRef - { - get - { - return columnNameFileDirRef; - } - } - - /// - /// Gets the column name saved matters details. - /// - /// The column name saved matters details. - internal static string ColumnNameSavedMattersDetails - { - get - { - return columnNameSavedMattersDetails; - } - } - - /// - /// Gets the column name saved documents details. - /// - /// The column name saved documents details. - internal static string ColumnNameSavedDocumentsDetails - { - get - { - return columnNameSavedDocumentsDetails; - } - } - - /// - /// Gets the column name user alias. - /// - /// The column name user alias. - internal static string ColumnNameUserAlias - { - get - { - return columnNameUserAlias; - } - } - - /// - /// Gets the property name VTI indexed property keys. - /// - /// The property name VTI indexed property keys. - internal static string PropertyNameVtiIndexedPropertyKeys - { - get - { - return propertyNameVtiIndexedPropertyKeys; - } - } - - /// - /// Gets the sub area custom property folder names. - /// - /// The sub area custom property folder names. - internal static string SubAreaCustomPropertyFolderNames - { - get - { - return subAreaCustomPropertyFolderNames; - } - } - - /// - /// Gets the sub area custom property is no folder structure present. - /// - /// The sub area custom property is no folder structure present. - internal static string SubAreaCustomPropertyisNoFolderStructurePresent - { - get - { - return subAreaCustomPropertyisNoFolderStructurePresent; - } - } - - /// - /// Gets the area custom property folder names. - /// - /// The area custom property folder names. - internal static string AreaCustomPropertyFolderNames - { - get - { - return areaCustomPropertyFolderNames; - } - } - - /// - /// Gets the practice group custom property folder names. - /// - /// The practice group custom property folder names. - internal static string PracticeGroupCustomPropertyFolderNames - { - get - { - return practiceGroupCustomPropertyFolderNames; - } - } - - /// - /// Gets the sub area of law document templates. - /// - /// The sub area of law document templates. - internal static string SubAreaOfLawDocumentTemplates - { - get - { - return subAreaOfLawDocumentTemplates; - } - } - - /// - /// Gets the type of the hidden content. - /// - /// The type of the hidden content. - internal static string HiddenContentType - { - get - { - return hiddenContentType; - } - } - - /// - /// Gets the stamped property blocked upload users. - /// - /// The stamped property blocked upload users. - internal static string StampedPropertyBlockedUploadUsers - { - get - { - return stampedPropertyBlockedUploadUsers; - } - } - - /// - /// Gets the managed property blocked upload users. - /// - /// The managed property blocked upload users. - internal static string ManagedPropertyBlockedUploadUsers - { - get - { - return managedPropertyBlockedUploadUsers; - } - } - - /// - /// Gets the stamped property matter description - /// - /// The stamped property matter description. - internal static string StampedPropertyMatterDescription - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Matter_Description", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict check date - /// - /// The stamped property of matter conflict check date. - internal static string StampedPropertyConflictCheckDate - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Conflict_Check_Date", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict check by - /// - /// The stamped property of matter conflict check by. - internal static string StampedPropertyConflictCheckBy - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Conflict_Check_By", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter users - /// - /// The stamped property of matter users. - internal static string StampedPropertyMatterCenterUsers - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter roles - /// - /// The stamped property of matter roles. - internal static string StampedPropertyMatterCenterRoles - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Roles", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter Permissions - /// - /// The stamped property of matter roles. - internal static string StampedPropertyMatterCenterPermissions - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_MatterCenter_Permissions", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - - /// - /// Gets the stamped property of matter default content type - /// - /// The stamped property of matter roles. - internal static string StampedPropertyDefaultContentType - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_DefaultContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter conflict identified flag - /// - /// The stamped property of matter roles. - internal static string StampedPropertyIsConflictIdentified - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_IsConflictIdentified", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter document template count - /// - /// The stamped property of matter roles. - internal static string StampedPropertyDocumentTemplateCount - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_DocumentTempateCount", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the stamped property of matter blocked upload users - /// - /// The stamped property of matter roles. - internal static string StampedPropertyBlockedUsers - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Stamped_Property_Blocked_Users", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the mail SOAP request. - /// - /// The mail SOAP request. - internal static string MailSoapReuqest - { - get - { - return mailSoapReuqest; - } - } - - /// - /// Gets the attachment SOAP request. - /// - /// The attachment SOAP request. - internal static string AttachmentSoapRequest - { - get - { - return attachmentSoapRequest; - } - } - - /// - /// Gets the invalid character regex. - /// - /// The invalid character regex. - internal static string InvalidCharRegex - { - get - { - return invalidCharRegex; - } - } - - /// - /// Gets the start end REGEX. - /// - /// The start end REGEX. - internal static string StartEndregex - { - get - { - return startEndregex; - } - } - - /// - /// Gets the invalid rule REGEX. - /// - /// The invalid rule REGEX. - internal static string InvalidRuleRegex - { - get - { - return invalidRuleRegex; - } - } - - /// - /// Gets the extra space regex. - /// - /// The extra space regex. - internal static string ExtraSpaceRegex - { - get - { - return extraSpaceRegex; - } - } - - /// - /// Gets the invalid file name regex. - /// - /// The invalid file name regex. - internal static string InvalidFileNameRegex - { - get - { - return invalidFileNameRegex; - } - } - - /// - /// Gets the no mail subject. - /// - /// The no mail subject. - internal static string NoMailSubject - { - get - { - return noMailSubject; - } - } - - /// - /// Gets the provision matter application URL. - /// - /// The provision matter application URL. - internal static string ProvisionMatterAppURL - { - get - { - return provisionMatterAppURL; - } - } - - /// - /// Gets the matter configurations list name - /// - /// The matter configurations list name - internal static string MatterConfigurationsList - { - get - { - return matterConfigurationsList; - } - } - - /// - /// Gets a value indicating whether this instance is tenant deployment. - /// - /// true if this instance is tenant deployment; otherwise, false. - internal static bool IsTenantDeployment - { - get - { - return isTenantDeployment; - } - } - - /// - /// Gets a value indicating whether this instance is major version enable. - /// - /// true if this instance is major version enable; otherwise, false. - internal static bool IsMajorVersionEnable - { - get - { - return isMajorVersionEnable; - } - } - - /// - /// Gets a value indicating whether this instance is minor version enable. - /// - /// true if this instance is minor version enable; otherwise, false. - internal static bool IsMinorVersionEnable - { - get - { - return isMinorVersionEnable; - } - } - - /// - /// Gets a value indicating whether this instance is force check out. - /// - /// true if this instance is force check out; otherwise, false. - internal static bool IsForceCheckOut - { - get - { - return isForceCheckOut; - } - } - - /// - /// Gets a value indicating whether to create calendar for matter or not - /// - /// trueif creation of calendar is to be done; otherwise, false - internal static bool IsCreateCalendarEnabled - { - get - { - return isCreateCalendarEnabled; - } - } - - /// - /// Gets the brief case items query. - /// - /// The brief case items query. - internal static string BriefCaseItemsQuery - { - get - { - return briefCaseItemsQuery; - } - } - - /// - /// Gets the get item by name query. - /// - /// The get item by name query. - internal static string GetItemByNameQuery - { - get - { - return getItemByNameQuery; - } - } - - /// - /// Gets the missing parameters message. - /// - /// The missing parameters message. - internal static string MissingParametersMessage - { - get - { - return missingParametersMessage; - } - } - - /// - /// Gets the invalid parameters message. - /// - /// The invalid parameters message. - internal static string InvalidParametersMessage - { - get - { - return invalidParametersMessage; - } - } - - /// - /// Gets the briefcase folder query. - /// - /// The briefcase folder query. - internal static string BriefcaseFolderQuery - { - get - { - return briefcaseFolderQuery; - } - } - - /// - /// Gets the briefcase folder contents query. - /// - /// The briefcase folder contents query. - internal static string BriefcaseFolderContentsQuery - { - get - { - return briefcaseFolderContentsQuery; - } - } - - /// - /// Gets the legal briefcase folder. - /// - /// The legal briefcase folder. - internal static string LegalBriefcaseFolder - { - get - { - return legalBriefcaseFolder; - } - } - - /// - /// Gets the name of the OneDrive content type. - /// - /// The name of the OneDrive content type. - internal static string OneDriveContentTypeName - { - get - { - return oneDriveContentTypeName; - } - } - - /// - /// Gets the already check out. - /// - /// The already check out. - internal static string AlreadyCheckOut - { - get - { - return alreadyCheckOut; - } - } - - /// - /// Gets the send to matter query. - /// - /// The send to matter query. - internal static string SendToMatterQuery - { - get - { - return sendToMatterQuery; - } - } - - /// - /// Gets the user my site not present. - /// - /// The user my site not present. - internal static string UserMySiteNotPresent - { - get - { - return userMySiteNotPresent; - } - } - - /// - /// Gets the type of the OneDrive parent content. - /// - /// The type of the OneDrive parent content. - internal static string OneDriveParentContentType - { - get - { - return oneDriveParentContentType; - } - } - - /// - /// Gets the OneDrive site column schema. - /// - /// The OneDrive site column schema. - internal static string OneDriveSiteColumnSchema - { - get - { - return oneDriveSiteColumnSchema; - } - } - - /// - /// Gets the OneDrive content type group. - /// - /// The OneDrive content type group. - internal static string OneDriveContentTypeGroup - { - get - { - return oneDriveContentTypeGroup; - } - } - - /// - /// Gets the OneDrive site column. - /// - /// The OneDrive site column. - internal static string OneDriveSiteColumn - { - get - { - return oneDriveSiteColumn; - } - } - - /// - /// Gets the type of the OneDrive site column. - /// - /// The type of the OneDrive site column. - internal static string OneDriveSiteColumnType - { - get - { - return oneDriveSiteColumnType; - } - } - - /// - /// Gets the mail cart mail subject. - /// - /// The mail cart mail subject. - internal static string MailCartMailSubject - { - get - { - return mailCartMailSubject; - } - } - - /// - /// Gets the mail cart mail body. - /// - /// The mail cart mail body. - internal static string MailCartMailBody - { - get - { - return mailCartMailBody; - } - } - - /// - /// Gets the exchange service URL. - /// - /// The exchange service URL. - internal static string ExchangeServiceURL - { - get - { - return exchangeServiceURL; - } - } - - /// - /// Gets the share list column mail list. - /// - /// The share list column mail list. - internal static string ShareListColumnMailList - { - get - { - return shareListColumnMailList; - } - } - - /// - /// Gets the share list column mail body. - /// - /// The share list column mail body. - internal static string ShareListColumnMailBody - { - get - { - return shareListColumnMailBody; - } - } - - /// - /// Gets the share list column mail subject - /// - /// The share list column mail subject. - internal static string ShareListColumnMailSubject - { - get - { - return shareListColumnMailSubject; - } - } - - /// - /// Gets the XML chunk for top menu web part - /// - internal static string TopMenuWebPart - { - get - { - return topMenuWebPart; - } - } - - /// - /// Gets the XML chunk for RSS feed web part - /// - internal static string RssFeedWebpart - { - get - { - return rssFeedWebpart; - } - } - - /// - /// Gets the XML chunk for Header Web Part - /// - internal static string HeaderWebPart - { - get - { - return headerWebPart; - } - } - - /// - /// Gets the XML chunk for Left bar web part - /// - internal static string LeftBarWebPart - { - get - { - return leftBarWebPart; - } - } - - /// - /// Gets the XML chunk for Footer Web Part - /// - internal static string FooterWebPart - { - get - { - return footerWebPart; - } - } - - /// - /// Gets the XML chunk for Calendar Web part - /// - internal static string CalendarWebpart - { - get - { - return calendarWebpart; - } - } - - /// - /// Gets the XML chunk for List view Web part - /// - internal static string ListviewWebpart - { - get - { - return listviewWebpart; - } - } - - /// - /// Gets the XML chunk for Content Editor Web part for Metadata - /// - internal static string ContentEditorWebpartMetadata - { - get - { - return contentEditorWebpartMetadata; - } - } - - /// - /// Gets the html chunk for Matter Landing page - /// - internal static string HtmlChunk - { - get - { - return htmlChunk; - } - } - - /// - /// Gets the XML chunk for Content editor web part for users - /// - internal static string ContentEditorWebpartUsers - { - get - { - return contentEditorWebpartUsers; - } - } - - /// - /// Gets the html data for Matter Landing page - /// - internal static string HtmlData - { - get - { - return htmlData; - } - } - - /// - /// Gets the jQuery file name from the Constants file - /// - internal static string JQueryFileName - { - get - { - return jqueryFileName; - } - } - - /// - /// Gets the JS file name from resource file used in Matter Landing page - /// - internal static string MatterLandingJSFileName - { - get - { - return matterLandingJSFileName; - } - } - - /// - /// Gets the CSS file name of the matter landing page - /// - internal static string MatterLandingCSSFileName - { - get - { - return matterLandingCSSFileName; - } - } - - /// - /// Gets the appropriate User Permissions - /// - internal static string UserPermissions - { - get - { - return userPermissions; - } - } - - /// - /// Gets the list of invalid extension not to be displayed in find document app - /// - internal static string FindDocumentInvalidExtensions - { - get - { - return findDocumentInvalidExtensions; - } - } - - /// - /// Gets location of the pin image - /// - internal static string PinImageLocation - { - get - { - return pinImageLocation; - } - } - - /// - /// Gets location of the Unpin image - /// - internal static string UnPinImageLocation - { - get - { - return unpinImageLocation; - } - } - - /// - /// Gets location of the One Note image - /// - internal static string OneNoteImageLocation - { - get - { - return oneNoteImageLocation; - } - } - - /// - /// Gets location of the share image - /// - internal static string ShareImageLocation - { - get - { - return shareImageLocation; - } - } - - /// - /// Gets location of the share image - /// - internal static string MatterLandingPageLogo - { - get - { - return matterLandingPageLogo; - } - } - - /// - /// Gets location of the Microsoft Logo Image - /// - internal static string MicrosoftImageLocation - { - get - { - return microsoftImageLocation; - } - } - - /// - /// Gets the body of the matter mail for matter information - /// - internal static string MatterMailBodyInformation - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Matter_Information", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Gets the body of the matter mail for conflict check - /// - internal static string MatterMailBodyConflictCheck - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Conflict_Check", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the body of the matter mail for Team Members - /// - internal static string MatterMailBodyTeamMembers - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Mail_Body_Team_Members", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets HTML chunk of the Default content type for Matter creation mail - /// - internal static string MatterMailDefaultContentTypeHtmlChunk - { - get - { - return matterMailDefaultContentTypeHtmlChunk; - } - } - - /// - /// Gets the subject of the matter creation mail - /// - internal static string MatterMailSubject - { - get - { - return matterMailSubject; - } - } - - /// - /// Gets the Valid Date format - /// - internal static string ValidDateFormat - { - get - { - return validDateFormat; - } - } - - /// - /// Suffix to be appended in calendar name - /// - internal static string CalendarNameSuffix - { - get - { - return calendarNameSuffix; - } - } - /// - /// Gets the Matter Landing Folder Name - /// - internal static string MatterLandingFolderName - { - get - { - return matterLandingFolderName; - } - } - - /// - /// Gets the Tenant level web dashboard location - /// - internal static string TenantWebDashboardLink - { - get - { - return tenantWebDashboardLink; - } - } - - /// - /// Gets the XML definition of Template Web Part - /// - internal static string TemplateWebPart - { - get - { - return templateWebPart; - } - } - - /// - /// Gets the link of the Template Document library - /// - internal static string TemplateDocLibraryLink - { - get - { - return templateDocLibraryLink; - } - } - - /// - /// Gets the manage property for Client ID - /// - internal static string ManagedPropertyClientID - { - get - { - return managedPropertyClientID; - } - } - - /// - /// Gets File not available Message - /// - /// Message for file not available - internal static string FileNotAvailableMessage - { - get - { - return fileNotAvailableMessage; - } - } - - /// - /// Gets the matter Id length - /// - /// The matter Id length - internal static string MatterIdLength - { - get - { - return matterIdLength; - } - } - - /// - /// Gets the matter name length - /// - /// The matter name length - internal static string MatterNameLength - { - get - { - return matterNameLength; - } - } - - /// - /// Gets the matter description length - /// - /// The matter description length - internal static string MatterDescriptionLength - { - get - { - return matterDescriptionLength; - } - } - - /// - /// Gets the content type length - /// - /// The content type length - internal static string ContentTypeLength - { - get - { - return contentTypeLength; - } - } - - /// - /// Gets the incorrect Request Object message - /// - /// The incorrect Request Object message - internal static string IncorrectInputRequestObjectMessage - { - get - { - return incorrectInputRequestObjectMessage; - } - } - - /// - /// Gets the incorrect Request Object code - /// - /// The incorrect Request Object code - internal static string IncorrectInputRequestObjectCode - { - get - { - return incorrectInputRequestObjectCode; - } - } - - /// - /// Gets the incorrect Client Url message - /// - /// The incorrect Client Url message - internal static string IncorrectInputClientUrlMessage - { - get - { - return incorrectInputClientUrlMessage; - } - } - - /// - /// Gets the incorrect Client Url code - /// - /// The incorrect Client Url code - internal static string IncorrectInputClientUrlCode - { - get - { - return incorrectInputClientUrlCode; - } - } - - /// - /// Gets the incorrect Client id message - /// - /// The incorrect Client id message - internal static string IncorrectInputClientIdMessage - { - get - { - return incorrectInputClientIdMessage; - } - } - - /// - /// Gets the incorrect Client id code - /// - /// The incorrect Client id code - internal static string IncorrectInputClientIdCode - { - get - { - return incorrectInputClientIdCode; - } - } - - /// - /// Gets the incorrect Client name message - /// - /// The incorrect Client name message/value> - internal static string IncorrectInputClientNameMessage - { - get - { - return incorrectInputClientNameMessage; - } - } - - /// - /// Gets the incorrect Client name code - /// - /// The incorrect Client name code/value> - internal static string IncorrectInputClientNameCode - { - get - { - return incorrectInputClientNameCode; - } - } - - /// - /// Gets the incorrect Practice Group message - /// - /// The incorrect Practice Group message - internal static string IncorrectInputPracticeGroupMessage - { - get - { - return incorrectInputPracticeGroupMessage; - } - } - - /// - /// Gets the incorrect Practice Group code - /// - /// The incorrect Practice Group code - internal static string IncorrectInputPracticeGroupCode - { - get - { - return incorrectInputPracticeGroupCode; - } - } - - /// - /// Gets the incorrect Area Of Law message - /// - /// The incorrect Area Of Law message - internal static string IncorrectInputAreaOfLawMessage - { - get - { - return incorrectInputAreaOfLawMessage; - } - } - - /// - /// Gets the incorrect Area Of Law code - /// - /// The incorrect Area Of Law code - internal static string IncorrectInputAreaOfLawCode - { - get - { - return incorrectInputAreaOfLawCode; - } - } - - /// - /// Gets the incorrect Sub Area Of Law message - /// - /// The incorrect Sub Area Of Law message - internal static string IncorrectInputSubareaOfLawMessage - { - get - { - return incorrectInputSubareaOfLawMessage; - } - } - - /// - /// Gets the incorrect Sub Area Of Law code - /// - /// The incorrect Sub Area Of Law code - internal static string IncorrectInputSubareaOfLawCode - { - get - { - return incorrectInputSubareaOfLawCode; - } - } - - /// - /// Gets the incorrect Responsible Attorney message - /// - /// The incorrect Responsible Attorney message - internal static string IncorrectInputResponsibleAttorneyMessage - { - get - { - return incorrectInputResponsibleAttorneyMessage; - } - } - - /// - /// Gets the incorrect Responsible Attorney code - /// - /// The incorrect Responsible Attorney code - internal static string IncorrectInputResponsibleAttorneyCode - { - get - { - return incorrectInputResponsibleAttorneyCode; - } - } - - /// - /// Gets the incorrect Matter name message - /// - /// The incorrect Matter name message - internal static string IncorrectInputMatterNameMessage - { - get - { - return incorrectInputMatterNameMessage; - } - } - - /// - /// Gets the incorrect Matter name code - /// - /// The incorrect Matter name code - internal static string IncorrectInputMatterNameCode - { - get - { - return incorrectInputMatterNameCode; - } - } - - /// - /// Gets the incorrect Matter id message - /// - /// The incorrect Matter id message - internal static string IncorrectInputMatterIdMessage - { - get - { - return incorrectInputMatterIdMessage; - } - } - - /// - /// Gets the incorrect Matter id code - /// - /// The incorrect Matter id code - internal static string IncorrectInputMatterIdCode - { - get - { - return incorrectInputMatterIdCode; - } - } - - /// - /// Gets the incorrect user name message - /// - /// The incorrect user name message - internal static string IncorrectInputUserNamesMessage - { - get - { - return incorrectInputUserNamesMessage; - } - } - - /// - /// Gets the incorrect user name code - /// - /// The incorrect user name code - internal static string IncorrectInputUserNamesCode - { - get - { - return incorrectInputUserNamesCode; - } - } - - /// - /// Gets the incorrect user permission message - /// - /// The incorrect user permission message - internal static string IncorrectInputUserPermissionsMessage - { - get - { - return incorrectInputUserPermissionsMessage; - } - } - - /// - /// Gets the incorrect user permission code - /// - /// The incorrect user permission code - internal static string IncorrectInputUserPermissionsCode - { - get - { - return incorrectInputUserPermissionsCode; - } - } - - /// - /// Gets the incorrect Content Type message - /// - /// The incorrect Content Type message - internal static string IncorrectInputContentTypeMessage - { - get - { - return incorrectInputContentTypeMessage; - } - } - - /// - /// Gets the incorrect Content Type code - /// - /// The incorrect Content Type code - internal static string IncorrectInputContentTypeCode - { - get - { - return incorrectInputContentTypeCode; - } - } - - /// - /// Gets the incorrect Matter description message - /// - /// The incorrect Matter description message - internal static string IncorrectInputMatterDescriptionMessage - { - get - { - return incorrectInputMatterDescriptionMessage; - } - } - - /// - /// Gets the incorrect Matter description code - /// - /// The incorrect Matter description code - internal static string IncorrectInputMatterDescriptionCode - { - get - { - return incorrectInputMatterDescriptionCode; - } - } - - /// - /// Gets the incorrect conflict date message - /// - /// The incorrect conflict date message - internal static string IncorrectInputConflictDateMessage - { - get - { - return incorrectInputConflictDateMessage; - } - } - - /// - /// Gets the incorrect conflict date code - /// - /// The incorrect conflict date code - internal static string IncorrectInputConflictDateCode - { - get - { - return incorrectInputConflictDateCode; - } - } - - /// - /// Gets the incorrect conflict identified message - /// - /// The incorrect conflict identified message - internal static string IncorrectInputConflictIdentifiedMessage - { - get - { - return incorrectInputConflictIdentifiedMessage; - } - } - - /// - /// Gets the incorrect conflict identified code - /// - /// The incorrect conflict identified code - internal static string IncorrectInputConflictIdentifiedCode - { - get - { - return incorrectInputConflictIdentifiedCode; - } - } - - /// - /// Gets the incorrect user roles message - /// - /// The incorrect user roles message - internal static string IncorrectInputUserRolesMessage - { - get - { - return incorrectInputUserRolesMessage; - } - } - - /// - /// Gets the incorrect user roles code - /// - /// The incorrect user roles code - internal static string IncorrectInputUserRolesCode - { - get - { - return incorrectInputUserRolesCode; - } - } - - /// - /// Gets the incorrect conflict check by message - /// - /// The incorrect conflict check by message - internal static string IncorrectInputConflictCheckByMessage - { - get - { - return incorrectInputConflictCheckByMessage; - } - } - - /// - /// Gets the incorrect conflict check by code - /// - /// The incorrect conflict check by code - internal static string IncorrectInputConflictCheckByCode - { - get - { - return incorrectInputConflictCheckByCode; - } - } - - /// - /// Gets the incorrect block users message - /// - /// The incorrect block users message - internal static string IncorrectInputBlockUserNamesMessage - { - get - { - return incorrectInputBlockUserNamesMessage; - } - } - - /// - /// Gets the incorrect block users code - /// - /// The incorrect block users code - internal static string IncorrectInputBlockUserNamesCode - { - get - { - return incorrectInputBlockUserNamesCode; - } - } - - /// - /// Gets the key for read only user flag - /// - /// The key value of read only user flag - internal static string IsReadOnlyUser - { - get - { - return isReadOnlyUser; - } - } - - /// - /// Gets the incorrect save search name message - /// - /// The incorrect save search name message - internal static string IncorrectInputSaveSearchNameMessage - { - get - { - return incorrectInputSaveSearchNameMessage; - } - } - - - /// - /// Gets the incorrect save search name code - /// - /// The incorrect save search name code - internal static string IncorrectInputSaveSearchNameCode - { - get - { - return incorrectInputSaveSearchNameCode; - } - } - - /// - /// Gets the incorrect existing search name message - /// - /// The incorrect existing search name message - internal static string IncorrectInputExistingSearchNameMessage - { - get - { - return incorrectInputExistingSearchNameMessage; - } - } - - /// - /// Gets the incorrect existing search name code - /// - /// The incorrect existing search name code - internal static string IncorrectInputExistingSearchNameCode - { - get - { - return incorrectInputExistingSearchNameCode; - } - } - - /// - /// Gets the incorrect current search name message - /// - /// The incorrect current search name message - internal static string IncorrectInputCurrentSearchNameMessage - { - get - { - return incorrectInputCurrentSearchNameMessage; - } - } - - /// - /// Gets the incorrect current search name code - /// - /// The incorrect current search name code - internal static string IncorrectInputCurrentSearchNameCode - { - get - { - return incorrectInputCurrentSearchNameCode; - } - } - - /// - /// Gets the incorrect input code for user access in Provision Matter Group - /// - /// The incorrect input code for user access in Provision Matter Group - internal static string IncorrectInputUserAccessCode - { - get - { - return incorrectInputUserAccessCode; - } - } - - /// - /// Gets the incorrect input message for user access in Provision Matter Group - /// - /// The incorrect input message for user access in Provision Matter Group - internal static string IncorrectInputUserAccessMessage - { - get - { - return incorrectInputUserAccessMessage; - } - } - - /// - /// Gets the success message on deletion of matter - /// - /// The success message on deletion of matter - internal static string MatterDeletedSuccessfully - { - get - { - return matterDeletedSuccessfully; - } - } - - /// - /// Gets the error code for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - /// - /// Error code when for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - internal static string ErrorCodeContentTypes - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error message for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - /// - /// Error message when for issue when Content Types selected by the users are not present in the Content Type hub or site collection where the matter library is created - internal static string ErrorMessageContentTypes - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageContentType", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error code when there is an issue while creation of matter landing page - /// - /// Error code when there is an issue while creation of matter landing page - internal static string ErrorCodeMatterLandingPage - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeMatterLandingPage", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error message when there is an issue while creation of matter landing page - /// - /// Error message when there is an issue while creation of matter landing page - internal static string ErrorMessageMatterLandingPage - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageMatterLandingPage", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error code when there is an issue while assigning permissions to calendar list - /// - /// Error code when there is an issue while assigning permissions to calendar list - internal static string ErrorCodeCalendarCreation - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeCalendarCreation", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error message when there is an issue while assigning permissions to calendar list - /// - /// Error message when there is an issue while assigning permissions to calendar list - internal static string ErrorMessageCalendarCreation - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageCalendarCreation", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error code when there is an issue while creating calendar list - /// - /// Error code when there is an issue while creating calendar list - internal static string ErrorCodeAddCalendarList - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeAddCalendarList", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error message when there is an issue while creating calendar list - /// - /// Error message when there is an issue while creating calendar list - internal static string ErrorMessageAddCalendarList - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageAddCalendarList", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the error message when matter library is not found when trying to delete - /// - /// Error message when matter library is not found when trying to delete - internal static string MatterNotPresent - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Not_Present", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the name of the custom view. - /// - /// The name of the custom view - internal static string ViewName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the list of columns for the custom view. - /// - /// The list of columns for the custom view - internal static string ViewColumnList - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_Column_List", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the column to set OrderBy for the custom view. - /// - /// The column to set OrderBy for the custom view - internal static string ViewOrderByColumn - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_OrderBy_Column", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the query to set OrderBy for the custom view. - /// - /// The query to set OrderBy for the custom view - internal static string ViewOrderByQuery - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "View_OrderBy_Query", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Holds the number of search results (users) to pull from people picker service based on the search term. This will return email enabled users as well as non-email enabled users. - /// - internal static string PeoplePickerMaximumEntitySuggestions - { - get - { - return peoplePickerMaximumEntitySuggestions; - } - } - - /// - /// Holds the number of records to pull which has email property from client picker service results. - /// - internal static string PeoplePickerMaxRecords - { - get - { - return peoplePickerMaxRecords; - } - } - - /// - /// Holds the flag to allow multiple users to be searched using people picker service. - /// - internal static string PeoplePickerAllowMultipleEntities - { - get - { - return peoplePickerAllowMultipleEntities; - } - } - - /// - /// Holds the message for no data returned from people picker control based on the search term. - /// - internal static string PeoplePickerNoResults - { - get - { - return peoplePickerNoResults; - } - } - - /// - /// Holds the Client ID property for Clients Term Set - /// - internal static string ClientCustomPropertiesId - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Client_Custom_Properties_Id", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Holds the error code for matter landing existence - /// - internal static string ErrorCodeMatterLandingPageExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorCodeMatterLandingPageExists", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Holds the error message for matter landing existence - /// - internal static string ErrorMessageMatterLandingPageExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "ErrorMessageMatterLandingPageExists", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - /// - /// Suffix to be appended in OneNote library name - /// - internal static string OneNoteLibrarySuffix - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "OneNoteLibrary_Name_Suffix", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the library name holding the matter landing pages for the site collection - /// - internal static string MatterLandingPageRepositoryName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Landing_Page_Repository_Name", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the content of the Matter Center Help Section List. - /// - /// The Matter Center help section list name. - internal static string MatterCenterHelpSectionListName - { - get - { - return matterCenterHelpSectionListName; - } - } - - /// - /// Name of the column storing Link Title. - /// - /// Name of the column storing Link Title. - internal static string ContextualHelpLinksColumnLinkTitle - { - get - { - return contextualHelpLinksColumnLinkTitle; - } - } - - /// - /// Name of the column storing Link URL. - /// - /// Name of the column storing Link URL. - internal static string ContextualHelpLinksColumnLinkURL - { - get - { - return contextualHelpLinksColumnLinkURL; - } - } - - /// - /// Name of the column storing Link Order. - /// - /// Name of the column storing Link Order. - internal static string ContextualHelpLinksColumnLinkOrder - { - get - { - return contextualHelpLinksColumnLinkOrder; - } - } - - /// - /// Name of the column storing Section ID. - /// - /// Name of the column storing Section ID. - internal static string ContextualHelpLinksColumnSectionID - { - get - { - return contextualHelpLinksColumnSectionID; - } - } - - /// - /// Name of the column storing Section ID. - /// - /// Name of the column storing Section ID. - internal static string ContextualHelpSectionColumnSectionID - { - get - { - return contextualHelpSectionColumnSectionID; - } - } - - /// - /// Name of the column storing Section Title. - /// - /// Name of the column storing Section Title. - internal static string ContextualHelpSectionColumnSectionTitle - { - get - { - return contextualHelpSectionColumnSectionTitle; - } - } - - /// - /// Name of the column storing Page Name. - /// - /// Name of the column storing Page Name. - internal static string ContextualHelpSectionColumnPageName - { - get - { - return contextualHelpSectionColumnPageName; - } - } - - /// - /// Name of the column storing Section Order. - /// - /// Name of the column storing Section Order. - internal static string ContextualHelpSectionColumnSectionOrder - { - get - { - return contextualHelpSectionColumnSectionOrder; - } - } - - /// - /// Name of the column storing Number of Columns. - /// - /// Name of the column storing Number of Columns. - internal static string ContextualHelpSectionColumnNumberOfColumns - { - get - { - return contextualHelpSectionColumnNumberOfColumns; - } - } - - /// - /// Gets the content of the Matter Center Help links List. - /// - /// The Matter Center help links list name . - internal static string MatterCenterHelpLinksListName - { - get - { - return matterCenterHelpLinksListName; - } - } - - /// - /// Gets contextual help sections. - /// - /// Query to be used for retrieving contextual help sections. - internal static string RetrieveContextualHelpSectionsQuery - { - get - { - return retrieveContextualHelpSectionsQuery; - } - } - - /// - /// Gets contextual help links. - /// - /// Query to be used for retrieving contextual help links. - internal static string RetrieveContextualHelpLinksQuery - { - get - { - return retrieveContextualHelpLinksQuery; - } - } - - /// - /// Represents page names to be used in contextual help functionality - /// - /// ';' separated list of page names to be used in contextual help functionality. - internal static string MatterCenterPages - { - get - { - return matterCenterPages; - } - } - - - /// - /// Represents OR part of CAMLquery to support include sections (link) - /// - /// ';' separated list to build OR part of CAMLquery to support include sections (link). - internal static string ContextualHelpQueryIncludeOrCondition - { - get - { - return contextualHelpQueryIncludeOrCondition; - } - } - /// - /// Represents the SPWebUrl managed property associated with the document - /// - internal static string ManagedPropertySPWebUrl - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Managed_Property_SPWeb_Url", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Gets the relative server path for the OneNote file to upload. - /// - /// The name of the practice group term set. - internal static string OneNoteRelativeFilePath - { - get - { - return oneNoteRelativeFilePath; - } - } - - /// - /// Gets the matter configuration column name of matter configurations list - /// - /// The name of the matter configuration column - internal static string MatterConfigurationColumn - { - get - { - return matterConfigurationColumn; - } - } - - /// - /// Represents the error message when user tries to remove self permission - /// - internal static string EditMatterSelfRemovalError - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Edit_Matter_Self_Removal_Error", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Represents the matter configuration entry title value - /// - internal static string MatterConfigurationTitleValue - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Configurations_Title_Value", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Represents the matter configurations list query - /// - internal static string MatterConfigurationsListQuery - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Configurations_List_Query", Enumerators.ResourceFileLocation.App_GlobalResources); ; - } - } - - /// - /// Represents the error code when user tries to remove self permission - /// - internal static string IncorrectInputSelfPermissionRemoval - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Self_Permission_Removal_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error code when security group exists in team members - /// - internal static string ErrorCodeSecurityGroupExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Security_Group_Exists_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error message when security group exists in team members - /// - internal static string ErrorMessageSecurityGroupExists - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Input_Security_Group_Exists_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the managed property for retrieving version of the document - /// - internal static string ManagedPropertyDocumentVersion - { - get - { - return managedPropertyDocumentVersion; - } - } - - /// - /// Represents the managed property for retrieving checked out user of the document - /// - internal static string ManagedPropertyDocumentCheckOutUser - { - get - { - return managedPropertyDocumentCheckOutUser; - } - } - - /// - /// Represents the error code when team members are not valid - /// - internal static string IncorrectTeamMembersCode - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Team_Members_Code", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Represents the error message when team members are not valid - /// - internal static string IncorrectTeamMembersMessage - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Incorrect_Team_Members_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets the content check flag - /// - /// Content check flag - internal static bool IsContentCheck - { - get - { - return isContentCheck; - } - } - - /// - /// Get the tenant site URL - /// - internal static string SiteURL - { - get - { - return siteURL; - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SettingsHelper.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SettingsHelper.cs deleted file mode 100644 index 7aedc6ce..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SettingsHelper.cs +++ /dev/null @@ -1,116 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 26-02-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file holds all the functions that are called by settings page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.HelperClasses -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.Security.Application; - using Microsoft.SharePoint.Client; - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Reflection; - #endregion - - /// - /// Holds all the functions that are called by settings page - /// - internal static class SettingsHelper - { - /// - /// Gets the user list from the data sent in Matter Configurations - /// - /// Matter Users list - /// Users list - internal static IList> GetUserList(string matterUsers) - { - IList> result = new List>(); - IList temp = null; - string[] resultTemp = matterUsers.Split(new string[] { "$|$" }, StringSplitOptions.None); - foreach (var userItem in resultTemp) - { - temp = new List(); - string[] tempItems = userItem.Split(Convert.ToChar(ConstantStrings.Semicolon, CultureInfo.InvariantCulture)); - foreach (var item in tempItems) - { - if (!string.IsNullOrEmpty(item.Trim())) - { - temp.Add(item.Trim()); - } - } - if (0 < temp.Count) - { - result.Add(temp); - } - temp = null; - } - return result; - } - - /// - /// Save configurations value to SharePoint list - /// - /// Matter configurations - /// ClientContext object - /// Date and time when user loaded the client settings page to configure default values - /// true or error - internal static string SaveConfigurationToList(MatterConfigurations matterConfigurations, ClientContext clientContext, string cachedItemModifiedDate) - { - string result = string.Empty; - try - { - string listQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MatterConfigurationsListQuery, SearchConstants.ManagedPropertyTitle, ServiceConstantStrings.MatterConfigurationTitleValue); - ListItemCollection collection = Lists.GetData(clientContext, ServiceConstantStrings.MatterConfigurationsList, listQuery); - // Set the default value for conflict check flag - matterConfigurations.IsContentCheck = ServiceConstantStrings.IsContentCheck; - if (0 == collection.Count) - { - List columnNames = new List() { ServiceConstantStrings.MatterConfigurationColumn, SearchConstants.ManagedPropertyTitle }; - List columnValues = new List() { Encoder.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)), ServiceConstantStrings.MatterConfigurationTitleValue }; - Web web = clientContext.Web; - List list = web.Lists.GetByTitle(ServiceConstantStrings.MatterConfigurationsList); - Lists.AddItem(clientContext, list, columnNames, columnValues); - } - else - { - bool response = Lists.CheckItemModified(collection, cachedItemModifiedDate); - if (response) - { - foreach (ListItem item in collection) - { - item[ServiceConstantStrings.MatterConfigurationColumn] = Encoder.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)); - item.Update(); - break; - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR); - } - } - if (string.IsNullOrWhiteSpace(result)) - { - clientContext.ExecuteQuery(); - result = ConstantStrings.TRUE; - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SharePointHelper.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SharePointHelper.cs deleted file mode 100644 index 34eba9ea..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/SharePointHelper.cs +++ /dev/null @@ -1,151 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 06-19-2014 -// -// -// Copyright (c) . All rights reserved. -// -// This file provide methods to perform SharePoint functionalities. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.ApplicationPages.ClientPickerQuery; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Utilities; - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - - #endregion - - /// - /// Provide methods to perform SharePoint functionalities. - /// - internal static class SharePointHelper - { - /// - /// Gets the list of content types along with their properties. - /// - /// Client context - /// List of Content Type Names associated with matter - /// Request Object - /// Client Object - /// Matter Object - /// List of content types - internal static IList GetContentTypeData(ClientContext clientContext, IList contentTypesNames, RequestObject requestObject = null, Client client = null, Matter matter = null) - { - ContentTypeCollection contentTypeCollection = null; - IList selectedContentTypeCollection = new List(); - try - { - if (null != clientContext && null != contentTypesNames) - { - Web web = clientContext.Web; - contentTypeCollection = web.ContentTypes; - clientContext.Load(contentTypeCollection, contentType => contentType.Include(thisContentType => thisContentType.Name).Where(currContentType => currContentType.Group == ServiceConstantStrings.OneDriveContentTypeGroup)); - clientContext.ExecuteQuery(); - selectedContentTypeCollection = GetContentTypeList(contentTypesNames, contentTypeCollection.ToList()); - } - } - catch (Exception exception) - { - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return selectedContentTypeCollection; - } - - /// - /// Generates the list of Content Types that are associated with matter. - /// - /// List of Content Type names that user has selected - /// Content Types listed in Content Type hub under Matter Center group - /// List of Content Types associated with matter - private static IList GetContentTypeList(IList contentTypesNames, List contentTypeList) - { - IList selectedContentTypeCollection = new List(); - ContentType selectedContentType = null; - foreach (string contentTypeName in contentTypesNames) - { - selectedContentType = (from currContentType in contentTypeList - where currContentType.Name.ToUpperInvariant().Equals(contentTypeName.ToUpperInvariant()) - select currContentType).ToList().FirstOrDefault(); - if (null != selectedContentType) - { - selectedContentTypeCollection.Add(selectedContentType); - } - } - return selectedContentTypeCollection; - } - - /// - /// Bulk resolves the specified users. - /// - /// Client context - /// Name of the users to be resolved - /// List of resolved users - public static IList ResolveUserNames(ClientContext clientContext, IList userNames) - { - List userList = new List(); - if (null != clientContext && null != userNames) - { - foreach (string userName in userNames) - { - if (!string.IsNullOrWhiteSpace(userName)) - { - User user = clientContext.Web.EnsureUser(userName.Trim()); - ///// Only Fetch the User ID which is required - clientContext.Load(user, u => u.Id); - clientContext.ExecuteQuery(); - ///// Add the user to the first element of the FieldUserValue array. - FieldUserValue tempUser = new FieldUserValue(); - tempUser.LookupId = user.Id; - userList.Add(tempUser); - } - } - } - return userList; - } - - /// - /// Places service call to search user based on the search term. - /// - /// Client context - /// Search term - /// Set of users returned by people picker service based on the search term - internal static IList SearchUsers(ClientContext clientContext, string searchTerm) - { - List userResult = null; - string results = string.Empty; - int peoplePickerMaxRecords; - try - { - ClientPeoplePickerQueryParameters queryParams = new ClientPeoplePickerQueryParameters(); - queryParams.AllowMultipleEntities = Convert.ToBoolean(ServiceConstantStrings.PeoplePickerAllowMultipleEntities, CultureInfo.InvariantCulture); - queryParams.MaximumEntitySuggestions = Convert.ToInt32(ServiceConstantStrings.PeoplePickerMaximumEntitySuggestions, CultureInfo.InvariantCulture); - queryParams.PrincipalSource = PrincipalSource.All; - queryParams.PrincipalType = PrincipalType.User | PrincipalType.SecurityGroup; - queryParams.QueryString = searchTerm; - peoplePickerMaxRecords = Convert.ToInt32(ServiceConstantStrings.PeoplePickerMaxRecords, CultureInfo.InvariantCulture); - - ClientResult clientResult = ClientPeoplePickerWebServiceInterface.ClientPeoplePickerSearchUser(clientContext, queryParams); - clientContext.ExecuteQuery(); - results = clientResult.Value; - userResult = JsonConvert.DeserializeObject>(results).Where(result => (string.Equals(result.EntityType, ConstantStrings.PeoplePickerEntityTypeUser, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.Description)) || (!string.Equals(result.EntityType, ConstantStrings.PeoplePickerEntityTypeUser, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.EntityData.Email))).Take(peoplePickerMaxRecords).ToList(); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return userResult; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/TermStoreHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/TermStoreHelperFunctions.cs deleted file mode 100644 index 6b68eca7..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/TermStoreHelperFunctions.cs +++ /dev/null @@ -1,289 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-rijadh -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provide methods to perform SharePoint term store functionalities. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Taxonomy; - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Reflection; - #endregion - - /// - /// Provide methods to perform SharePoint term store functionalities. - /// - internal static class TermStoreHelperFunctions - { - /// - /// Gets the taxonomy hierarchy. - /// - /// Client object containing Client data - /// Term Store object containing Term store data - /// Fetch Group Terms Status - internal static string GetTaxonomyHierarchy(ClientContext clientContext, TermStoreDetails termStoreDetails) - { - string returnFlag = ConstantStrings.FALSE; - try - { - TaxonomySession taxonomySession = TaxonomySession.GetTaxonomySession(clientContext); - TermStore termStore; - clientContext.Load(taxonomySession.TermStores); - clientContext.ExecuteQuery(); - termStore = taxonomySession.TermStores[0]; - clientContext.Load( - termStore, - store => store.Name, - store => store.Groups.Include( - group => group.Name)); - clientContext.ExecuteQuery(); - returnFlag = GetReturnFlag(clientContext, termStore, termStoreDetails); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return returnFlag; - } - - /// - /// Fetches the term store data for the term group specified - /// - /// Client Context - /// Term Group from the Term store - /// Details of the Term Group - /// hierarchy of the Term Group - /// Hierarchy of the Term Group - internal static string FetchGroupTerms(ClientContext clientContext, TermGroup termGroup, TermStoreDetails termStoreDetails, string returnFlagStatus) - { - clientContext.Load( - termGroup, - group => group.Name, - group => group.TermSets.Include( - termSet => termSet.Name, - termSet => termSet.Id, - termSet => termSet.Terms.Include( - term => term.Name, - term => term.Id, - term => term.CustomProperties, - term => term.Terms.Include( - termArea => termArea.Name, - termArea => termArea.Id, - termArea => termArea.CustomProperties, - termArea => termArea.Terms.Include( - termSubArea => termSubArea.Name, - termSubArea => termSubArea.Id, - termSubArea => termSubArea.CustomProperties))))); - - clientContext.ExecuteQuery(); - foreach (TermSet termSet in termGroup.TermSets) - { - if (termSet.Name == termStoreDetails.TermSetName) - { - if (termStoreDetails.TermSetName == ServiceConstantStrings.PracticeGroupTermSetName) - { - returnFlagStatus = GetPracticeGroupTermSetHierarchy(termSet, termStoreDetails); - } - else if (termStoreDetails.TermSetName == ServiceConstantStrings.ClientTermSetName) - { - returnFlagStatus = GetClientTermSetHierarchy(termSet, termStoreDetails); - } - } - } - - return returnFlagStatus; - } - - /// - /// Iterates through the taxonomy hierarchy for the specified term set group. - /// - /// Client content for specified site - /// Term Store object - /// Term Store object containing Term store data - /// Fetch Group Terms Status - internal static string GetReturnFlag(ClientContext clientContext, TermStore termStore, TermStoreDetails termStoreDetails) - { - string returnFlagStatus = ConstantStrings.FALSE; - - if (ServiceConstantStrings.IsTenantDeployment) - { - foreach (TermGroup termGroup in termStore.Groups) - { - if (termGroup.Name == termStoreDetails.TermGroup) - { - returnFlagStatus = FetchGroupTerms(clientContext, termGroup, termStoreDetails, returnFlagStatus); - } - } - } - else - { - TermGroup termGroup = termStore.GetSiteCollectionGroup(clientContext.Site, false); - returnFlagStatus = FetchGroupTerms(clientContext, termGroup, termStoreDetails, returnFlagStatus); - } - - // Returns the taxonomy hierarchy for the specified term set group - return returnFlagStatus; - } - - /// - /// Gets the practice group term set hierarchy. - /// - /// Term set object holding Practice Group terms - /// Term Store object containing Term store data - /// Serialized Object of Term Set - internal static string GetPracticeGroupTermSetHierarchy(TermSet termSet, TermStoreDetails termStoreDetails) - { - string result = string.Empty; - try - { - TermSets tempTermSet = new TermSets(); - tempTermSet.Name = termSet.Name; - ////Retrieve the Terms - level 1 - tempTermSet.PGTerms = new List(); - TermCollection termColl = termSet.Terms; - foreach (Term term in termColl) - { - PracticeGroupTerm tempTermPG = new PracticeGroupTerm(); - tempTermPG.TermName = term.Name; - tempTermPG.Id = Convert.ToString(term.Id, CultureInfo.InvariantCulture); - tempTermPG.ParentTermName = termSet.Name; - /////Retrieve the custom property for Terms at level 1 - foreach (KeyValuePair customProperty in term.CustomProperties) - { - if (customProperty.Key.Equals(ServiceConstantStrings.PracticeGroupCustomPropertyFolderNames, StringComparison.Ordinal)) - { - tempTermPG.FolderNames = customProperty.Value; - } - } - - tempTermSet.PGTerms.Add(tempTermPG); - ///// Retrieve the Terms - level 2 - tempTermPG.AreaTerms = new List(); - TermCollection termCollArea = term.Terms; - foreach (Term termArea in termCollArea) - { - AreaTerm tempTermArea = new AreaTerm(); - tempTermArea.TermName = termArea.Name; - tempTermArea.Id = Convert.ToString(termArea.Id, CultureInfo.InvariantCulture); - tempTermArea.ParentTermName = term.Name; - /////Retrieve the custom property for Terms at level 2 - foreach (KeyValuePair customProperty in termArea.CustomProperties) - { - if (customProperty.Key.Equals(ServiceConstantStrings.AreaCustomPropertyFolderNames, StringComparison.Ordinal)) - { - tempTermArea.FolderNames = customProperty.Value; - } - } - - tempTermPG.AreaTerms.Add(tempTermArea); - /////Retrieve the Terms - level 3 - tempTermArea.SubareaTerms = new List(); - TermCollection termCollSubArea = termArea.Terms; - foreach (Term termSubArea in termCollSubArea) - { - SubareaTerm tempTermSubArea = new SubareaTerm(); - tempTermSubArea.TermName = termSubArea.Name; - tempTermSubArea.Id = Convert.ToString(termSubArea.Id, CultureInfo.InvariantCulture); - tempTermSubArea.ParentTermName = termArea.Name; - /////Retrieve the custom property for Terms at level 3 - - tempTermSubArea.DocumentTemplates = string.Empty; - foreach (KeyValuePair customProperty in termSubArea.CustomProperties) - { - if (customProperty.Key.Equals(termStoreDetails.CustomPropertyName, StringComparison.Ordinal)) - { - tempTermSubArea.DocumentTemplates = customProperty.Value; - } - else if (customProperty.Key.Equals(ServiceConstantStrings.SubAreaCustomPropertyFolderNames, StringComparison.Ordinal)) - { - tempTermSubArea.FolderNames = customProperty.Value; - } - else if (customProperty.Key.Equals(ServiceConstantStrings.SubAreaCustomPropertyisNoFolderStructurePresent, StringComparison.Ordinal)) - { - tempTermSubArea.IsNoFolderStructurePresent = customProperty.Value; - } - else if (customProperty.Key.Equals(ServiceConstantStrings.SubAreaOfLawDocumentTemplates, StringComparison.Ordinal)) - { - tempTermSubArea.DocumentTemplateNames = customProperty.Value; - } - } - - tempTermArea.SubareaTerms.Add(tempTermSubArea); - } - } - } - /////Serialize the Term set (Practice Group) object to get all terms under it and return it - result = JsonConvert.SerializeObject(tempTermSet); - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Gets the taxonomy hierarchy for client term set. - /// - /// Term set object holding Client terms - /// Term Store object containing Term store data - /// Serialized Object of Client Term Set - internal static string GetClientTermSetHierarchy(TermSet termSet, TermStoreDetails termStoreDetails) - { - string result = string.Empty; - try - { - ClientTermSets tempClientTermSet = new ClientTermSets(); - tempClientTermSet.Name = termSet.Name; - /////Retrieve the Terms - level 1 - tempClientTermSet.ClientTerms = new List(); - TermCollection termColl = termSet.Terms; - foreach (Term term in termColl) - { - Client tempTermPG = new Client(); - tempTermPG.Name = term.Name; - if (term.CustomProperties.Count > 0) - { - tempTermPG.Url = string.Empty; - tempTermPG.Id = string.Empty; - foreach (KeyValuePair customProperty in term.CustomProperties) - { - if (customProperty.Key.Equals(termStoreDetails.CustomPropertyName, StringComparison.Ordinal)) - { - tempTermPG.Url = customProperty.Value; - } - - if (customProperty.Key.Equals(ServiceConstantStrings.ClientCustomPropertiesId, StringComparison.Ordinal)) - { - tempTermPG.Id = customProperty.Value; - } - } - } - - tempClientTermSet.ClientTerms.Add(tempTermPG); - } - /////Serialize the Term set (Practice Group) object to get all terms under it - result = JsonConvert.SerializeObject(tempClientTermSet); - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctions.cs deleted file mode 100644 index f460baa5..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctions.cs +++ /dev/null @@ -1,742 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-diajme -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provide methods to perform document upload functionalities. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Net; - using System.Reflection; - using System.Web; - using System.Xml; - #endregion - - /// - /// Provide methods to perform document transfer functionalities. - /// - internal static class UploadHelperFunctions - { - /// - /// Acts as entry point from service to place the request to upload email/attachment. Reads the web request headers and requests applicable methods based on headers. - /// - /// The request object. - /// The client object - /// The Service request object - /// The SOAP request - /// The attachment or mail identifier. - /// Mail upload check - /// Name of the file. - /// The folder path. - /// Determines if it is first call or not - /// Reference object for the message to be returned - /// Original file name of the attachment - /// It returns a string object, that contains the execution status of the function. - internal static string Upload(RequestObject requestObject, Client client, ServiceRequest serviceRequest, string soapRequest, string attachmentOrMailID, bool isMailUpload, string fileName, string folderPath, bool isFirstCall, ref string message, string originalFileName) - { - string result = ConstantStrings.UploadFailed; - try - { - if (null != requestObject && null != client && null != serviceRequest && !string.IsNullOrWhiteSpace(soapRequest) && !string.IsNullOrWhiteSpace(attachmentOrMailID) && !string.IsNullOrWhiteSpace(fileName) && !string.IsNullOrWhiteSpace(folderPath)) - { - string documentLibraryName = serviceRequest.DocumentLibraryName; - - //// Make the request to the Exchange server and get the response. - HttpWebResponse webResponse = UploadHelperFunctionsUtility.GetWebResponse(serviceRequest.EwsUrl, serviceRequest.AttachmentToken, soapRequest, attachmentOrMailID); - - if (!isFirstCall) - { - XmlDocument xmlDocument = RetrieveXMLDocument(webResponse); - string attachmentID = string.Empty; - //// Check original file name is empty - if (!string.IsNullOrWhiteSpace(originalFileName)) - { - attachmentID = UploadHelperFunctionsUtility.GetAttachmentID(xmlDocument, originalFileName); - } - else - { - attachmentID = UploadHelperFunctionsUtility.GetAttachmentID(xmlDocument, fileName); - } - if (!string.IsNullOrWhiteSpace(attachmentID)) - { - attachmentOrMailID = attachmentID; - } - - //// Make the request to the Exchange server and get the response. - webResponse = UploadHelperFunctionsUtility.GetWebResponse(serviceRequest.EwsUrl, serviceRequest.AttachmentToken, ServiceConstantStrings.AttachmentSoapRequest, attachmentOrMailID); - } - - //// If the response is okay, create an XML document from the response and process the request. - if (webResponse.StatusCode == HttpStatusCode.OK) - { - result = UploadFilesMail(serviceRequest.Overwrite, serviceRequest.PerformContentCheck, serviceRequest.AllowContentCheck, documentLibraryName, webResponse, isMailUpload, requestObject, client, fileName, folderPath, ref message); - } - if (string.IsNullOrWhiteSpace(message) && result.Equals(ConstantStrings.UploadFailed) && isFirstCall) - { - result = Upload(requestObject, client, serviceRequest, ServiceConstantStrings.MailSoapRequest, serviceRequest.MailId, isMailUpload, fileName, folderPath, false, ref message, originalFileName); - } - } - else - { - result = ConstantStrings.UploadFailed; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = ConstantStrings.UploadFailed; - } - return result; - } - - /// - /// Reads the XMLDocument and determines whether the request is to upload entire mail/attachment/.eml file/.msg file and calls respective method. - /// - /// Overwrite check - /// Name of the document library - /// Name of the folder - /// HTTP web response to get the response stream - /// Mail Upload Flag - /// request object for web - /// Service Client Object - /// Name of the file - /// upload folder path - /// Reference object for the message to be returned - /// Returns whether File Uploaded successfully or failed - internal static string UploadFilesMail(bool isOverwrite, bool isContentCheckRequired, bool allowContentCheck, string documentLibraryName, HttpWebResponse webResponse, bool isMailUpload, RequestObject requestObject, Client client, string fileName, string folderPath, ref string message) - { - bool isMsg = true; - MailMetaData mailMetaData = new MailMetaData(); - var bytes = (dynamic)null; - string mailMessage = string.Empty; - string originalName = string.Empty; - string xmlPath = string.Empty; - string result = ConstantStrings.UploadSucceeded; - ContentCheckDetails contentCheck = null; - try - { - XmlDocument xmlDocument = RetrieveXMLDocument(webResponse); - XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); - nsmgr.AddNamespace("s", ConstantStrings.SoapEnvelopURI); - nsmgr.AddNamespace("m", ConstantStrings.ExchangeServiceMessage); - nsmgr.AddNamespace("t", ConstantStrings.ExchangeServiceTypes); - string extension = System.IO.Path.GetExtension(fileName).Trim(); - string uploadFileName = UploadHelperFunctionsUtility.RemoveSpecialChar(fileName); - if (xmlDocument.SelectSingleNode("/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:FileAttachment/t:Content", nsmgr) != null) - { - isMsg = false; - } - if (string.IsNullOrEmpty(extension) && isMsg) - { - uploadFileName = uploadFileName + ConstantStrings.EmailFileExtension; - } - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - if (isMailUpload) - { - bytes = GetEmailProperties(xmlDocument, ref mailMetaData); - } - else - { - bytes = UploadHelperFunctionsUtility.GetStream(xmlDocument, nsmgr, isMailUpload, extension, isMsg); - } - if (null != bytes) - { - using (MemoryStream memoryStream = new MemoryStream(bytes)) - { - contentCheck = new ContentCheckDetails(uploadFileName, mailMetaData.mailSubject, memoryStream.Length, mailMetaData.mailSender, mailMetaData.sentDate); - } - } - if (!isOverwrite && !isContentCheckRequired && UploadHelperFunctionsUtility.CheckDuplicateDocument(clientContext, documentLibraryName, isMailUpload, folderPath, contentCheck, uploadFileName, allowContentCheck, ref message)) - { - result = ConstantStrings.UploadFailed; - } - else if (isContentCheckRequired) - { - message = UploadHelperFunctionsUtility.PerformContentCheckUtility(isMailUpload, folderPath, isMsg, xmlDocument, nsmgr, extension, uploadFileName, clientContext); - result = ConstantStrings.UploadFailed; - } - else - { - if (isMailUpload) //Upload entire Email - { - UploadMail(requestObject, client, folderPath, fileName, documentLibraryName, xmlDocument, ref message); - } - else - { - if (string.IsNullOrEmpty(extension) && isMsg) //Upload .msg file - { - UploadAttachedMailExtBlank(requestObject, client, folderPath, fileName, documentLibraryName, xmlDocument, ref message); - } - else - { - if (string.Equals(extension, ConstantStrings.EmailFileExtension, StringComparison.OrdinalIgnoreCase)) - { - UploadEMLFile(documentLibraryName, requestObject, client, folderPath, fileName, ref message, xmlDocument, nsmgr, ref mailMetaData, ref bytes, extension); - } - else - { - //get original name - xmlPath = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:FileAttachment/t:Name"; - originalName = RetrieveNodeValue(xmlDocument, nsmgr, xmlPath, true); - //get attachment content - xmlPath = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:FileAttachment/t:Content"; - mailMessage = RetrieveNodeValue(xmlDocument, nsmgr, xmlPath, false); - - bytes = Convert.FromBase64String(mailMessage); - using (MemoryStream memoryStream = new MemoryStream(bytes)) - { - mailMetaData.mailImportance = string.Empty; - mailMetaData.mailSubject = string.Empty; - mailMetaData.originalName = originalName; - if (!UploadToFolder(requestObject, client, folderPath, fileName, string.Empty, memoryStream, documentLibraryName, mailMetaData, ref message)) - { - result = ConstantStrings.UploadFailed; - } - } - } - } - } - if (!string.IsNullOrEmpty(message)) - { - result = ConstantStrings.UploadFailed; - } - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = ConstantStrings.UploadFailed; - } - return result; - } - - /// - /// Retrieves the specified node value from XML document - /// - /// XML document object having information for the attachment - /// XML namespace object - /// xPath for getting the specific property of mail - /// Flag to check if node value requires HTML decoding - /// string containing property value specified in xmlPath - private static string RetrieveNodeValue(XmlDocument xmlDocument, XmlNamespaceManager nsmgr, string xmlPath, bool decodeNodeValue) - { - string xmlNodeValue = string.Empty; - XmlNode nodeToFetch = xmlDocument.SelectSingleNode(xmlPath, nsmgr); - if (null != nodeToFetch) - { - xmlNodeValue = nodeToFetch.InnerXml; - if (decodeNodeValue && !string.IsNullOrWhiteSpace(xmlNodeValue)) - { - xmlNodeValue = HttpUtility.HtmlDecode(xmlNodeValue); - } - } - return xmlNodeValue; - } - - /// - /// Retrieves stream from web page and loads in XML document. - /// - /// HTTP web response to get the response stream - /// XML Document containing read values from Request - internal static XmlDocument RetrieveXMLDocument(HttpWebResponse webResponse) - { - Stream responseStream = webResponse.GetResponseStream(); - XmlDocument xmlDocument = new XmlDocument(); - XmlReader xmlReader = XmlReader.Create(responseStream); - XmlReaderSettings readerSettings = new XmlReaderSettings(); - readerSettings.DtdProcessing = DtdProcessing.Ignore; - xmlDocument.Load(xmlReader); - responseStream.Close(); - webResponse.Close(); - return xmlDocument; - } - - /// - /// Uploads the .eml file to specified folder in matter library. - /// - /// Name of the document library - /// web request object - /// Provider Service client Object - /// target folder path for upload - /// File name - /// Reference object for the message to be returned - /// XML document object having information for the attachment - /// XML Namespace object - /// Mail metadata object storing property values - /// Array of bytes - /// File extension object contains extension of file to be uploaded. - private static void UploadEMLFile(string documentLibraryName, RequestObject requestObject, Client client, string folderPath, string fileName, ref string message, XmlDocument xmlDocument, XmlNamespaceManager nsmgr, ref MailMetaData mailMetaData, ref dynamic bytes, string extension) - { - string mailMessage = xmlDocument.SelectSingleNode("/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:FileAttachment/t:Content", nsmgr).InnerXml; - bytes = Convert.FromBase64String(mailMessage); - using (MemoryStream memoryStream = new MemoryStream(bytes)) - { - mailMetaData.mailSender = string.Empty; - mailMetaData.mailReceiver = string.Empty; - mailMetaData.receivedDate = string.Empty; - mailMetaData.cc = string.Empty; - Dictionary mailProperties = new Dictionary - { - { ConstantStrings.MailSenderKey, mailMetaData.mailSender }, - { ConstantStrings.MailReceiverKey, mailMetaData.mailReceiver }, - { ConstantStrings.MailReceivedDateKey, mailMetaData.receivedDate }, - { ConstantStrings.MailCCAddressKey, mailMetaData.cc }, - { ConstantStrings.MailCategoriesKey, string.Empty }, - { ConstantStrings.MailSensitivityKey, string.Empty }, - { ConstantStrings.MailAttachmentKey, string.Empty }, - { ConstantStrings.MailSearchEmailSubject, string.Empty }, - { ConstantStrings.MailFileExtensionKey, extension }, - { ConstantStrings.MailImportanceKey, string.Empty}, - { ConstantStrings.MailConversationIdKey, string.Empty}, - { ConstantStrings.MailConversationTopicKey, string.Empty}, - { ConstantStrings.MailSentDateKey, string.Empty}, - { ConstantStrings.MailHasAttachmentsKey, string.Empty}, - { ConstantStrings.MailOriginalName, string.Empty} - }; - - mailProperties = MailMessageParser.GetMailFileProperties(memoryStream, mailProperties); - mailMetaData.mailImportance = mailProperties[ConstantStrings.MailImportanceKey]; - mailMetaData.mailReceiver = mailProperties[ConstantStrings.MailReceiverKey]; - mailMetaData.receivedDate = mailProperties[ConstantStrings.MailReceivedDateKey]; - mailMetaData.cc = mailProperties[ConstantStrings.MailCCAddressKey]; - mailMetaData.categories = mailProperties[ConstantStrings.MailCategoriesKey]; - mailMetaData.mailSubject = mailProperties[ConstantStrings.MailSearchEmailSubject]; - mailMetaData.attachment = mailProperties[ConstantStrings.MailAttachmentKey]; - mailMetaData.mailSender = mailProperties[ConstantStrings.MailSenderKey]; - mailMetaData.sentDate = mailProperties[ConstantStrings.MailSentDateKey]; - mailMetaData.originalName = mailProperties[ConstantStrings.MailSearchEmailSubject]; - UploadToFolder(requestObject, client, folderPath, fileName, mailProperties[ConstantStrings.MailFileExtensionKey], memoryStream, documentLibraryName, mailMetaData, ref message); - } - } - - /// - /// Uploads the email to specified folder in matter library. - /// - /// web request object - /// Provider Service client Object - /// target folder path for upload - /// Name of the file - /// Name of the document library - /// Mail XML Content - /// Reference object for the message to be returned - internal static void UploadMail(RequestObject requestObject, Client client, string folderPath, string fileName, string documentLibraryName, XmlDocument xmlDocument, ref string message) - { - var bytes = (dynamic)null; - - try - { - XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); - nsmgr.AddNamespace("s", ConstantStrings.SoapEnvelopURI); - nsmgr.AddNamespace("m", ConstantStrings.ExchangeServiceMessage); - nsmgr.AddNamespace("t", ConstantStrings.ExchangeServiceTypes); - MailMetaData mailMetaData = new MailMetaData(); - - bytes = GetEmailProperties(xmlDocument, ref mailMetaData); - - using (MemoryStream memoryStream = new MemoryStream(bytes)) - { - using (MailMimeReader mime = new MailMimeReader()) - { - MailMessageParser messageParser = mime.GetEmail(memoryStream); - mailMetaData.mailImportance = (string.IsNullOrWhiteSpace(messageParser.MailImportance)) ? ConstantStrings.MailDefaultImportance : messageParser.MailImportance; - mailMetaData.receivedDate = (string.IsNullOrWhiteSpace(messageParser.ReceivedDate.Date.ToShortDateString())) ? string.Empty : Convert.ToString(messageParser.ReceivedDate, CultureInfo.InvariantCulture); - UploadToFolder(requestObject, client, folderPath, fileName, string.Empty, memoryStream, documentLibraryName, mailMetaData, ref message); - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Get properties of the Email being uploaded - /// - /// XML Document containing read values from Request - /// Mail metadata object - /// Array of bytes - private static dynamic GetEmailProperties(XmlDocument xmlDocument, ref MailMetaData mailMetaData) - { - var bytes = (dynamic)null; - XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); - nsmgr.AddNamespace("s", ConstantStrings.SoapEnvelopURI); - nsmgr.AddNamespace("m", ConstantStrings.ExchangeServiceMessage); - nsmgr.AddNamespace("t", ConstantStrings.ExchangeServiceTypes); - MailXPath mailXPath = new MailXPath(); - mailXPath.mailReceiver = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:ToRecipients/t:Mailbox"; - mailXPath.mailCC = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:CcRecipients/t:Mailbox"; - mailXPath.mailSentDate = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:DateTimeSent"; - mailXPath.mailFromName = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:From/t:Mailbox/t:Name"; - mailXPath.mailFromAddress = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:From/t:Mailbox/t:EmailAddress"; - mailXPath.mailSubject = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:Subject"; - mailXPath.mailCategories = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:Categories"; - mailXPath.mailConversationId = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:ConversationId"; - mailXPath.mailConversationTopic = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:ConversationTopic"; - mailXPath.mailSensitivity = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:Sensitivity"; - mailXPath.mailHasAttachments = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:HasAttachments"; - mailXPath.mailImportance = string.Empty; - bytes = Convert.FromBase64String(xmlDocument.SelectSingleNode("/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:MimeContent", nsmgr).InnerXml); - GetMailProperties(mailXPath, ref mailMetaData, xmlDocument); - - return bytes; - } - - /// - /// Uploads the .msg file to specified folder in matter library. - /// - /// web request object - /// service client object - /// target folder path - /// Name of the file. - /// Name of the document library - /// XML Document containing read values from Request - /// Reference object for the message to be returned - internal static void UploadAttachedMailExtBlank(RequestObject requestObject, Client client, string folderPath, string fileName, string documentLibraryName, XmlDocument xmlDocument, ref string message) - { - var bytes = (dynamic)null; - MailMetaData mailMetaData = new MailMetaData(); - - try - { - XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); - nsmgr.AddNamespace("s", ConstantStrings.SoapEnvelopURI); - nsmgr.AddNamespace("m", ConstantStrings.ExchangeServiceMessage); - nsmgr.AddNamespace("t", ConstantStrings.ExchangeServiceTypes); - MailXPath xPath = new MailXPath(); - xPath.mailReceiver = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:ToRecipients/t:Mailbox"; - xPath.mailCC = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:CcRecipients/t:Mailbox"; - xPath.mailRecieved = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:DateTimeReceived"; - xPath.mailFromName = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:From/t:Mailbox/t:Name"; - xPath.mailFromAddress = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:From/t:Mailbox/t:EmailAddress"; - xPath.mailImportance = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:Importance"; - xPath.mailSubject = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:Subject"; - xPath.mailCategories = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:Categories"; - xPath.mailConversationId = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:ConversationId"; - xPath.mailConversationTopic = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:ConversationTopic"; - xPath.mailSensitivity = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:Sensitivity"; - xPath.mailHasAttachments = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:HasAttachments"; - xPath.mailSentDate = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:DateTimeSent"; - bytes = Convert.FromBase64String(xmlDocument.SelectSingleNode("/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:MimeContent", nsmgr).InnerXml); - GetMailProperties(xPath, ref mailMetaData, xmlDocument); - mailMetaData.mailImportance = (string.IsNullOrWhiteSpace(mailMetaData.mailImportance)) ? ConstantStrings.MailDefaultImportance : mailMetaData.mailImportance; - using (MemoryStream memoryStream = new MemoryStream(bytes)) - { - UploadToFolder(requestObject, client, folderPath, fileName + ConstantStrings.EmailFileExtension, string.Empty, memoryStream, documentLibraryName, mailMetaData, ref message); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Get properties of the mail file to be uploaded - /// - /// Mail Xpath object - /// Mail metadata object - /// XML Document containing read values from Request - private static void GetMailProperties(MailXPath mailXPath, ref MailMetaData mailMetaData, XmlDocument xmlDocument) - { - - XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDocument.NameTable); - nsmgr.AddNamespace("s", ConstantStrings.SoapEnvelopURI); - nsmgr.AddNamespace("m", ConstantStrings.ExchangeServiceMessage); - nsmgr.AddNamespace("t", ConstantStrings.ExchangeServiceTypes); - - XmlNode checkMailFromAddressField = xmlDocument.SelectSingleNode(mailXPath.mailFromAddress, nsmgr); - XmlNode xmlNode = null; - XmlNodeList xmlNodeList = null; - - mailMetaData.sentDate = GetPropertyValueFromXml(mailXPath.mailSentDate, xmlDocument, nsmgr); - mailMetaData.mailImportance = GetPropertyValueFromXml(mailXPath.mailImportance, xmlDocument, nsmgr); - mailMetaData.mailSubject = GetPropertyValueFromXml(mailXPath.mailSubject, xmlDocument, nsmgr); - mailMetaData.receivedDate = GetPropertyValueFromXml(mailXPath.mailRecieved, xmlDocument, nsmgr); - mailMetaData.sensitivity = GetPropertyValueFromXml(mailXPath.mailSensitivity, xmlDocument, nsmgr); - mailMetaData.conversationTopic = GetPropertyValueFromXml(mailXPath.mailConversationTopic, xmlDocument, nsmgr); - mailMetaData.hasAttachments = GetPropertyValueFromXml(mailXPath.mailHasAttachments, xmlDocument, nsmgr); - //Subject is kept as the original name of the mail - mailMetaData.originalName = GetPropertyValueFromXml(mailXPath.mailSubject, xmlDocument, nsmgr); - - xmlNode = xmlDocument.SelectSingleNode(mailXPath.mailFromName, nsmgr); - if (null != xmlNode && null != xmlNode) - { - mailMetaData.mailSender = xmlNode.InnerXml; - mailMetaData.mailSender += ConstantStrings.Semicolon + checkMailFromAddressField.InnerXml; - } - - xmlNodeList = xmlDocument.SelectNodes(mailXPath.mailReceiver, nsmgr); - mailMetaData.mailReceiver = GetRecipientsField(xmlNodeList); - - xmlNodeList = xmlDocument.SelectNodes(mailXPath.mailCC, nsmgr); - mailMetaData.cc = GetRecipientsField(xmlNodeList); - - xmlNode = xmlDocument.SelectSingleNode(mailXPath.mailConversationId, nsmgr); - if (null != xmlNode) - { - mailMetaData.conversationId = Convert.ToString(xmlNode.Attributes["Id"].Value, CultureInfo.InvariantCulture); - } - - - xmlNode = xmlDocument.SelectSingleNode(mailXPath.mailCategories, nsmgr); - if (null != xmlNode) - { - foreach (XmlNode node in xmlNode.ChildNodes) - { - mailMetaData.categories += node.InnerText + ConstantStrings.Semicolon; - } - } - - XmlNodeList xnlist = xmlDocument.GetElementsByTagName("t:Name"); - foreach (XmlNode node in xnlist) - { - if (null != node.PreviousSibling && "t:AttachmentId" == node.PreviousSibling.Name) - { - mailMetaData.attachment += node.InnerText + ConstantStrings.Semicolon; - } - } - } - - /// - /// To get recipients field from the Email headers - /// - /// Collection of nodes - /// Property value - private static string GetRecipientsField(XmlNodeList xmlNodeList) - { - string result = string.Empty; - if (null != xmlNodeList) - { - foreach (XmlNode node in xmlNodeList) - { - if (null != node["t:Name"]) - { - result += node["t:Name"].InnerXml + ConstantStrings.Semicolon + node["t:EmailAddress"].InnerXml + ConstantStrings.Semicolon; - } - } - } - return result; - } - - /// - /// To get property value from the XML node - /// - /// XPath query - /// XML Document containing read values from Request - /// Namespace manager object - /// Property value - private static string GetPropertyValueFromXml(string xPath, XmlDocument document, XmlNamespaceManager namespaceManager) - { - string propertyValue = string.Empty; - XmlNode xmlNode = null; - if (null != xPath && !string.IsNullOrWhiteSpace(xPath)) - { - xmlNode = document.SelectSingleNode(xPath, namespaceManager); - if (null != xmlNode) - { - propertyValue = xmlNode.InnerText; - } - } - return propertyValue; - } - - /// - /// To get the short date from the field retrieved from headers - /// - /// Representing node from XML document - /// Short date format - private static string GetShortDateFromField(string value) - { - string result = string.Empty; - if (!string.IsNullOrWhiteSpace(value)) - { - DateTime parsedDate = Convert.ToDateTime(value, CultureInfo.CurrentCulture); - result = parsedDate.ToShortDateString(); - } - return result; - } - - /// - /// Validates the email/attachment and request call to upload the content to specified folder in matter library. - /// - /// The Web request object. - /// The Service client. - /// The folder path. - /// The filename - /// File extension - /// Memory stream object - /// MailMetadata object - /// Name of the document library - /// Reference object for the message to be returned - /// - /// Returns True if upload is successful or False if upload fails - /// - internal static bool UploadToFolder(RequestObject requestObject, Client client, string folderPath, string filename, string extension, MemoryStream memoryStream, string documentLibraryName, MailMetaData mailMetaData, ref string message) - { - bool isUploadSuccessful = false; - try - { - if (null != memoryStream && null != requestObject && null != client && !string.IsNullOrWhiteSpace(folderPath) && !string.IsNullOrWhiteSpace(filename)) - { - if (0 == memoryStream.Length) - { - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.ErrorEmptyFile, ConstantStrings.DOLLAR, documentLibraryName); - } - else - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - isUploadSuccessful = UploadFolderUtility(requestObject, client, folderPath, ref filename, extension, memoryStream, mailMetaData, documentLibraryName, ref message, clientContext); - } - } - } - } - catch (Exception exception) - { - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", exception.Message, ConstantStrings.DOLLAR, documentLibraryName); - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return isUploadSuccessful; - } - - /// - /// Checks for folder existence and uploads the mail/attachment to specified folder in matter library. Returns the operation status (success/failure). - /// - /// The Web request object. - /// The Service client object. - /// The folder path object containing path for specified folder. - /// The filename object contains name of file to be uploaded. - /// File extension object contains extension of file to be uploaded. - /// Memory stream object - /// MailMetadata object - /// Name of the document library - /// Reference object for the message to be returned - /// Client context object for connection between SP & client - /// Returns True if upload operation is successful or False if operation fails - private static bool UploadFolderUtility(RequestObject requestObject, Client client, string folderPath, ref string filename, string extension, MemoryStream memoryStream, MailMetaData mailMetadata, string documentLibraryName, ref string message, ClientContext clientContext) - { - bool isUploadSuccessful = true; - string folderName = folderPath.Substring(folderPath.LastIndexOf(ConstantStrings.ForwardSlash, StringComparison.OrdinalIgnoreCase) + 1); - try - { - if (UIUtility.FolderExists(folderPath, clientContext, documentLibraryName)) - { - filename = CreateFileInsideFolder(folderPath, filename, extension, memoryStream, clientContext); - SaveFields(requestObject, client, folderPath, filename, mailMetadata, documentLibraryName); - } - else - { - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", - string.Format(CultureInfo.InvariantCulture, ConstantStrings.FolderStructureModified, folderName), - ConstantStrings.DOLLAR, folderName); - isUploadSuccessful = false; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - isUploadSuccessful = false; - } - return isUploadSuccessful; - } - - /// - /// To create file inside SharePoint folder - /// - /// Folder path - /// Filename - /// Extension - /// Stream of the memory - /// ClientContext object - /// filename - private static string CreateFileInsideFolder(string folderPath, string filename, string extension, MemoryStream memoryStream, ClientContext clientContext) - { - FileCreationInformation newFile = new FileCreationInformation(); - filename = UploadHelperFunctionsUtility.RemoveSpecialChar(filename); - using (var stream = memoryStream) - { - stream.Seek(0, SeekOrigin.Begin); - newFile.ContentStream = stream; - - if (!string.Equals(extension, ConstantStrings.EmailFileExtension, StringComparison.Ordinal)) - { - filename += extension; - } - newFile.Url = filename; - newFile.Overwrite = true; - - Folder destinationFolder = clientContext.Web.GetFolderByServerRelativeUrl(folderPath); - clientContext.Load(destinationFolder); - clientContext.ExecuteQuery(); - Microsoft.SharePoint.Client.File fileToUpload = destinationFolder.Files.Add(newFile); - clientContext.Load(fileToUpload); - clientContext.ExecuteQuery(); - } - return filename; - } - - /// - /// Saves the fields for uploaded item in SharePoint library. - /// - /// Web request object - /// Provider Service client - /// folder path - /// Name of the file - /// MailMetadata object - /// Name of the document library - public static void SaveFields(RequestObject requestObject, Client client, string folderPath, string fileName, MailMetaData mailMetadata, string documentLibraryName) - { - try - { - if (null != requestObject && null != client && !string.IsNullOrWhiteSpace(folderPath) && !string.IsNullOrWhiteSpace(fileName)) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.Web web = clientContext.Web; - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - Dictionary mailProperties = new Dictionary - { - { ConstantStrings.MailSenderKey, mailMetadata.mailSender }, - { ConstantStrings.MailReceiverKey, string.IsNullOrEmpty(mailMetadata.mailReceiver) ? string.Empty : mailMetadata.mailReceiver }, - { ConstantStrings.MailReceivedDateKey, mailMetadata.receivedDate }, - { ConstantStrings.MailCCAddressKey, string.IsNullOrEmpty(mailMetadata.cc) ? string.Empty : mailMetadata.cc }, - { ConstantStrings.MailAttachmentKey, string.IsNullOrEmpty(mailMetadata.attachment) ? string.Empty : mailMetadata.attachment }, - { ConstantStrings.MailSearchEmailFromMailboxKey, currentUserDetail.Name }, - { ConstantStrings.MailSearchEmailSubject, string.IsNullOrEmpty(mailMetadata.mailSubject) ? string.Empty : mailMetadata.mailSubject }, - { ConstantStrings.MailImportanceKey, string.IsNullOrEmpty(mailMetadata.mailImportance) ? string.Empty : mailMetadata.mailImportance }, - { ConstantStrings.MailSensitivityKey, string.IsNullOrEmpty(mailMetadata.sensitivity) ? string.Empty : mailMetadata.sensitivity }, - { ConstantStrings.MailHasAttachmentsKey, string.IsNullOrEmpty(mailMetadata.hasAttachments) ? string.Empty : mailMetadata.hasAttachments }, - { ConstantStrings.MailConversationIdKey, string.IsNullOrEmpty(mailMetadata.conversationId) ? string.Empty : mailMetadata.conversationId }, - { ConstantStrings.MailConversationTopicKey, string.IsNullOrEmpty(mailMetadata.conversationTopic) ? string.Empty : mailMetadata.conversationTopic }, - { ConstantStrings.MailCategoriesKey, string.IsNullOrEmpty(mailMetadata.categories) ? string.Empty : mailMetadata.categories } , - { ConstantStrings.MailSentDateKey, string.IsNullOrEmpty(mailMetadata.sentDate) ? string.Empty : mailMetadata.sentDate }, - { ConstantStrings.MailOriginalName, string.IsNullOrEmpty(mailMetadata.originalName) ? string.Empty : mailMetadata.originalName } - - }; - ServiceUtility.SetUploadItemProperties(clientContext, web, documentLibraryName, fileName, folderPath, mailProperties); - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctionsUtility.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctionsUtility.cs deleted file mode 100644 index 8a115127..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/UploadHelperFunctionsUtility.cs +++ /dev/null @@ -1,232 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-akdigh -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provide methods to perform document transfer functionalities. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Net; - using System.Reflection; - using System.Text; - using System.Text.RegularExpressions; - using System.Xml; - using System.Xml.Linq; - #endregion - - /// - /// Provide methods to perform document transfer functionalities. - /// - internal class UploadHelperFunctionsUtility - { - /// - /// Check if duplicate document exists - /// - /// SP client context - /// Name of the document library - /// Name of the folder - /// Mail upload check - /// The folder path. - /// Content check object - /// Name of the file. - /// message as per duplicate exists or not - internal static bool CheckDuplicateDocument(ClientContext clientContext, string documentLibraryName, bool isMailUpload, string folderPath, ContentCheckDetails contentCheck, string uploadFileName, bool allowContentCheck, ref string message) - { - DuplicateDocument duplicateDocument = ServiceUtility.DocumentExists(clientContext, contentCheck, documentLibraryName, folderPath, isMailUpload); - if (duplicateDocument.DocumentExists) - { - string documentPath = string.Concat(ServiceConstantStrings.SiteURL, folderPath, ConstantStrings.ForwardSlash, uploadFileName); - string duplicateMessage = (allowContentCheck && duplicateDocument.HasPotentialDuplicate) ? ConstantStrings.FilePotentialDuplicateMessage : ConstantStrings.FileAlreadyExistMessage; - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", string.Format(CultureInfo.InvariantCulture, duplicateMessage, uploadFileName, documentPath), ConstantStrings.SymbolAt, duplicateDocument.HasPotentialDuplicate.ToString()); - } - return duplicateDocument.DocumentExists; - } - - /// - /// Performs content check - /// - /// Mail upload check - /// The folder path. - /// Is .msg file - /// XML document object having information for the attachment - /// XML Namespace object - /// File extension - /// Name of the file. - /// SP client context - /// result message as per document matches or not - internal static string PerformContentCheckUtility(bool isMailUpload, string folderPath, bool isMsg, XmlDocument xmlDocument, XmlNamespaceManager nsmgr, string extension, string uploadFileName, ClientContext clientContext) - { - dynamic bytes = GetStream(xmlDocument, nsmgr, isMailUpload, extension, isMsg); - string message = string.Empty; - using (MemoryStream targetStream = new MemoryStream(bytes, 0, bytes.Length, false, true)) - { - try - { - string serverFileUrl = folderPath + ConstantStrings.ForwardSlash + uploadFileName; - if (ServiceUtility.PerformContentCheck(clientContext, targetStream, serverFileUrl)) - { - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.FoundIdenticalContent, ConstantStrings.Pipe, ConstantStrings.TRUE); - } - else - { - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.FoundNonIdenticalContent, ConstantStrings.Pipe, ConstantStrings.FALSE); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - message = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.ContentCheckFailed, ConstantStrings.Pipe, ConstantStrings.TRUE); - } - } - return message; - } - - /// - /// returns stream from exchange - /// - /// XML document object having information for the attachment - /// XML Namespace object - /// Mail upload check - /// File extension - /// Is .msg file - /// stream in byte array - internal static byte[] GetStream(XmlDocument xmlDocument, XmlNamespaceManager nsmgr, bool isMailUpload, string extension, bool isMsg) - { - string xPath = string.Empty; - string mailMessage = string.Empty; - var bytes = (dynamic)null; - if (isMailUpload) - { - xPath = "/s:Envelope/s:Body/m:GetItemResponse/m:ResponseMessages/m:GetItemResponseMessage/m:Items/t:Message/t:MimeContent"; - } - else if (string.IsNullOrWhiteSpace(extension) && isMsg) - { - xPath = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:ItemAttachment/t:Message/t:MimeContent"; - } - else - { - xPath = "/s:Envelope/s:Body/m:GetAttachmentResponse/m:ResponseMessages/m:GetAttachmentResponseMessage/m:Attachments/t:FileAttachment/t:Content"; - } - mailMessage = xmlDocument.SelectSingleNode(xPath, nsmgr).InnerXml; - bytes = Convert.FromBase64String(mailMessage); - return bytes; - } - - /// - /// Make the request to the Exchange server and get the response. - /// - /// Exchange Web Service URL. - /// The attachment token. - /// The SOAP request. - /// The attachment or mail identifier. - /// HTTP-specific response from Exchange server - internal static HttpWebResponse GetWebResponse(Uri ewsUrl, string attachmentToken, string soapRequest, string attachmentOrMailID) - { - HttpWebRequest webRequest = WebRequest.CreateHttp(ewsUrl); - webRequest.Headers.Add(ServiceConstantStrings.RequestHeaderName, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.RequestHeaderValue, attachmentToken)); - webRequest.PreAuthenticate = true; - webRequest.KeepAlive = false; - webRequest.ProtocolVersion = HttpVersion.Version10; - webRequest.AllowAutoRedirect = false; - webRequest.Method = ServiceConstantStrings.RequestMethod; - webRequest.ContentType = ServiceConstantStrings.RequestContentType; - - //// Construct the SOAP message for the GetMailSoap operation. - byte[] bodyBytes = Encoding.UTF8.GetBytes(string.Format(CultureInfo.InvariantCulture, soapRequest, attachmentOrMailID)); - webRequest.ContentLength = bodyBytes.Length; - Stream requestStream = webRequest.GetRequestStream(); - requestStream.Write(bodyBytes, 0, bodyBytes.Length); - requestStream.Close(); - - //// Make the request to the Exchange server and get the response. - return (HttpWebResponse)webRequest.GetResponse(); - } - - /// - /// Get the Attachment ID from the web response - /// - /// XML document object having information for mail contents - /// Name of the file. - /// The attachment identifier retrieved from the web response. - internal static string GetAttachmentID(XmlDocument xmlDocument, string fileName) - { - XNamespace exchangeServiceTypes = ConstantStrings.ExchangeServiceTypes; - XName attachmentsTag = exchangeServiceTypes + ServiceConstantStrings.AttachmentsTag; - XName fileAttachmentTag = exchangeServiceTypes + ServiceConstantStrings.FileAttachmentTag; - XName itemAttachmentTag = exchangeServiceTypes + ServiceConstantStrings.ItemAttachmentTag; - XName fileNameTag = exchangeServiceTypes + ServiceConstantStrings.FileNameTag; - XName attachmentIdTag = exchangeServiceTypes + ServiceConstantStrings.AttachmentIdTag; - XDocument xDocument = XDocument.Parse(xmlDocument.InnerXml); - //// Get the attachmentID from the web response received for the itemID. Initial lookup is in the File Attachment - string attachmentID = xDocument.Descendants(attachmentsTag) - .Descendants(fileAttachmentTag) - .Where((element => RemoveSpecialChar(element.Element(fileNameTag).Value) == fileName)) - .Select(element => element.Element(attachmentIdTag) - .Attribute(ServiceConstantStrings.IdAttribute).Value) - .SingleOrDefault(); - if (string.IsNullOrWhiteSpace(attachmentID)) - { - //// If attachmentID is null, check if the file is an Item Attachment and get the attachmentID from the web response received for the itemID - attachmentID = xDocument.Descendants(attachmentsTag) - .Descendants(itemAttachmentTag) - .Where((element => RemoveSpecialChar(element.Element(fileNameTag).Value) == fileName)) - .Select(element => element.Element(attachmentIdTag) - .Attribute(ServiceConstantStrings.IdAttribute).Value) - .SingleOrDefault(); - } - return attachmentID; - } - - /// - /// Removes not allowed characters from SharePoint file name. - /// - /// file name to be updated - /// Updated file name - internal static string RemoveSpecialChar(string filename) - { - string result = string.Empty; - try - { - if (!string.IsNullOrWhiteSpace(filename)) - { - Regex invalidCharsRegex = new Regex(ServiceConstantStrings.InvalidCharRegex, RegexOptions.Compiled); - Regex startEndRegex = new Regex(ServiceConstantStrings.StartEndregex, RegexOptions.Compiled); - Regex invalidRulesRegex = new Regex(ServiceConstantStrings.InvalidRuleRegex, RegexOptions.Compiled); - Regex extraSpacesRegex = new Regex(ServiceConstantStrings.ExtraSpaceRegex, RegexOptions.Compiled); - Regex invalidFileName = new Regex(ServiceConstantStrings.InvalidFileNameRegex, RegexOptions.Compiled & RegexOptions.IgnoreCase); - result = invalidFileName.Replace( - extraSpacesRegex.Replace( - invalidRulesRegex.Replace( - startEndRegex.Replace( - invalidCharsRegex.Replace(filename, string.Empty).Trim() - , string.Empty) - , string.Empty) - , string.Empty) - , string.Empty); - } - else - { - result = TextConstants.NoMailSubject; - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ValidationHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ValidationHelperFunctions.cs deleted file mode 100644 index 9b01eb62..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/HelperClasses/ValidationHelperFunctions.cs +++ /dev/null @@ -1,444 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-nikhid -// Created : 06-19-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file validates the inputs for matter provision app and returns the validation status (success/failure). -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService.HelperClasses -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - using System.ServiceModel.Web; - using System.Text.RegularExpressions; - #endregion - - /// - /// Provides methods to perform validations. - /// - internal static class ValidationHelperFunctions - { - /// - /// Validates the inputs for matter provision app and returns the validation status (success/failure). - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Client context object for SharePoint - /// Matter object containing Matter data - /// Matter details object which has data of properties to be stamped - /// Number indicating which method needs to be validated - /// A string value indicating whether validations passed or fail - internal static string ProvisionMatterValidation(RequestObject requestObject, Client client, ClientContext clientContext, Matter matter, MatterDetails matterDetails, int methodNumber, MatterConfigurations matterConfigurations) - { - if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) <= methodNumber && int.Parse(ConstantStrings.EditMatterPermission, CultureInfo.InvariantCulture) >= methodNumber && !Lists.CheckPermissionOnList(ServiceUtility.GetClientContext(null, new Uri(ConstantStrings.ProvisionMatterAppURL), requestObject.RefreshToken), ConstantStrings.SendMailListName, PermissionKind.EditListItems)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectInputUserAccessCode, ServiceConstantStrings.IncorrectInputUserAccessMessage); - } - else - { - if (null != requestObject) - { - if (string.IsNullOrWhiteSpace(requestObject.RefreshToken) && string.IsNullOrWhiteSpace(requestObject.SPAppToken)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputRequestObjectCode, TextConstants.IncorrectInputRequestObjectMessage); - } - } - if (null != client) - { - string result = ValidateClientInformation(client, methodNumber); - if (!string.IsNullOrEmpty(result)) - { - return result; - } - } - if (null != matter) - { - string MatterMetadataValidationResponse = MatterMetadataValidation(matter, clientContext, methodNumber, matterConfigurations); - if (!string.IsNullOrEmpty(MatterMetadataValidationResponse)) - { - return MatterMetadataValidationResponse; - } - if (int.Parse(ConstantStrings.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) - { - string roleCheck = ValidationHelperFunctions.RoleCheck(requestObject, matter, client); - if (!string.IsNullOrEmpty(roleCheck)) - { - return roleCheck; - } - } - if (null != matter.Permissions) - { - bool isFullControlPresent = EditMatterHelperFunctions.ValidateFullControlPermission(matter); - if (!isFullControlPresent) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectInputUserAccessCode, ServiceConstantStrings.ErrorEditMatterMandatoryPermission); - } - } - } - if (null != matterDetails && !(int.Parse(ConstantStrings.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber)) - { - if (string.IsNullOrWhiteSpace(matterDetails.PracticeGroup)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputPracticeGroupCode, TextConstants.IncorrectInputPracticeGroupMessage); - } - if (string.IsNullOrWhiteSpace(matterDetails.AreaOfLaw)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputAreaOfLawCode, TextConstants.IncorrectInputAreaOfLawMessage); - } - if (string.IsNullOrWhiteSpace(matterDetails.SubareaOfLaw)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputSubareaOfLawCode, TextConstants.IncorrectInputSubareaOfLawMessage); - } - try - { - if (string.IsNullOrWhiteSpace(matterDetails.ResponsibleAttorney)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputResponsibleAttorneyCode, TextConstants.IncorrectInputResponsibleAttorneyMessage); - } - else - { - IList userNames = matterDetails.ResponsibleAttorney.Split(';').ToList(); - SharePointHelper.ResolveUserNames(clientContext, userNames).FirstOrDefault(); - } - } - catch (Exception) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputResponsibleAttorneyCode, TextConstants.IncorrectInputResponsibleAttorneyMessage); - } - } - } - return string.Empty; - } - - /// - /// Validate email address with REGEX pattern - /// - /// Email address - /// Boolean result indicating whether the email address is of a valid format - internal static bool ValidateExternalUserInput(string email) - { - return Regex.IsMatch(email.Trim(), TextConstants.EmailValidationRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)); - } - - /// - /// Validates meta-data of a matter and returns the validation status (success/failure). - /// - /// Matter object containing Matter data - /// Client context object for SharePoint - /// Number indicating which method needs to be validated - /// A string value indicating whether validations passed or fail - internal static string MatterMetadataValidation(Matter matter, ClientContext clientContext, int methodNumber, MatterConfigurations matterConfigurations) - { - string matterNameValidation = MatterNameValidation(matter); - if (!string.IsNullOrWhiteSpace(matterNameValidation)) - { - return matterNameValidation; - } - if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) - { - if (string.IsNullOrWhiteSpace(matter.Id)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterIdCode, TextConstants.IncorrectInputMatterIdMessage); - } - else - { - var matterId = Regex.Match(matter.Id, ConstantStrings.SpecialCharacterExpressionMatterId, RegexOptions.IgnoreCase); - if (int.Parse(ServiceConstantStrings.MatterIdLength, CultureInfo.InvariantCulture) < matter.Id.Length || !matterId.Success) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterIdCode, TextConstants.IncorrectInputMatterIdMessage); - } - } - } - if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber) - { - string matterDetailsValidationResponse = MatterDetailsValidation(matter, clientContext, methodNumber, matterConfigurations); - if (!string.IsNullOrEmpty(matterDetailsValidationResponse)) - { - return matterDetailsValidationResponse; - } - } - try - { - if (!(int.Parse(ConstantStrings.ProvisionMatterCheckMatterExists, CultureInfo.InvariantCulture) == methodNumber) && !(int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber)) - { - if (0 >= matter.AssignUserEmails.Count()) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserNamesCode, TextConstants.IncorrectInputUserNamesMessage); - } - else - { - IList userList = matter.AssignUserEmails.SelectMany(x => x).Distinct().ToList(); - SharePointHelper.ResolveUserNames(clientContext, userList).FirstOrDefault(); - } - } - } - catch (Exception) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserNamesCode, TextConstants.IncorrectInputUserNamesMessage); - } - - if (int.Parse(ConstantStrings.ProvisionMatterAssignUserPermissions, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) - { - string CheckUserPermissionResponse = CheckUserPermission(matter); - if (!string.IsNullOrEmpty(CheckUserPermissionResponse)) - { - return CheckUserPermissionResponse; - } - } - if (int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber) - { - string validateContentTypeResponse = ValidateContentType(matter); - if (!string.IsNullOrEmpty(validateContentTypeResponse)) - { - return validateContentTypeResponse; - } - } - return string.Empty; - } - - /// - /// Validates the matter name. - /// - /// Matter details - /// Matter details validation result - private static string MatterNameValidation(Matter matter) - { - string matterNameValidation = string.Empty; - if (string.IsNullOrWhiteSpace(matter.Name)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterNameCode, TextConstants.IncorrectInputMatterNameMessage); - } - var matterName = Regex.Match(matter.Name, ConstantStrings.SpecialCharacterExpressionMatterTitle, RegexOptions.IgnoreCase); - if (int.Parse(ServiceConstantStrings.MatterNameLength, CultureInfo.InvariantCulture) < matter.Name.Length || matter.Name.Length != matterName.Length) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterNameCode, TextConstants.IncorrectInputMatterNameMessage); - } - return matterNameValidation; - } - - /// - /// Validates the permissions assigned to the users. - /// - /// Matter object containing Matter data - /// A string value indicating whether validations passed or fail - private static string CheckUserPermission(Matter matter) - { - if (0 >= matter.Permissions.Count()) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserPermissionsCode, TextConstants.IncorrectInputUserPermissionsMessage); - } - else - { - string userAllowedPermissions = ServiceConstantStrings.UserPermissions; - if (!string.IsNullOrEmpty(userAllowedPermissions)) - { - List userPermissions = userAllowedPermissions.ToUpperInvariant().Trim().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); - foreach (string Permissions in matter.Permissions) - if (!userPermissions.Contains(Permissions.Trim().ToUpperInvariant())) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserPermissionsCode, TextConstants.IncorrectInputUserPermissionsMessage); - } - - } - } - return string.Empty; - } - - /// - /// Validates content type for the matter. - /// - /// Matter object containing Matter data - /// A string value indicating whether validations passed or fail - private static string ValidateContentType(Matter matter) - { - if ((0 >= matter.ContentTypes.Count()) || string.IsNullOrWhiteSpace(matter.DefaultContentType)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputContentTypeCode, TextConstants.IncorrectInputContentTypeMessage); - } - else - { - foreach (string contentType in matter.ContentTypes) - { - var contentTypeCheck = Regex.Match(contentType, ConstantStrings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); - if (contentTypeCheck.Success || int.Parse(ServiceConstantStrings.ContentTypeLength, CultureInfo.InvariantCulture) < contentType.Length) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputContentTypeCode, TextConstants.IncorrectInputContentTypeMessage); - } - } - var defaultContentTypeCheck = Regex.Match(matter.DefaultContentType, ConstantStrings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); - if (defaultContentTypeCheck.Success || int.Parse(ServiceConstantStrings.ContentTypeLength, CultureInfo.InvariantCulture) < matter.DefaultContentType.Length) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputContentTypeCode, TextConstants.IncorrectInputContentTypeMessage); - } - } - return string.Empty; - } - - /// - /// Validates details of a matter and returns the validation status. - /// - /// Matter object containing Matter data - /// Client context object for SharePoint - /// Number indicating which method needs to be validated - /// A string value indicating whether validations passed or fail - internal static string MatterDetailsValidation(Matter matter, ClientContext clientContext, int methodNumber, MatterConfigurations matterConfigurations) - { - if (matterConfigurations.IsMatterDescriptionMandatory) - { - if (string.IsNullOrWhiteSpace(matter.Description)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterDescriptionCode, TextConstants.IncorrectInputMatterDescriptionMessage); - } - else - { - var matterDescription = Regex.Match(matter.Description, ConstantStrings.SpecialCharacterExpressionMatterDescription, RegexOptions.IgnoreCase); - if (int.Parse(ServiceConstantStrings.MatterDescriptionLength, CultureInfo.InvariantCulture) < matter.Description.Length || !matterDescription.Success) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputMatterDescriptionCode, TextConstants.IncorrectInputMatterDescriptionMessage); - } - } - } - if (matterConfigurations.IsConflictCheck) - { - DateTime conflictCheckedOnDate; - bool isValidDate = DateTime.TryParse(matter.Conflict.CheckOn, out conflictCheckedOnDate); - if (!isValidDate || 0 > DateTime.Compare(DateTime.Now, conflictCheckedOnDate)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictDateCode, TextConstants.IncorrectInputConflictDateMessage); - } - if (string.IsNullOrWhiteSpace(matter.Conflict.Identified)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictIdentifiedCode, TextConstants.IncorrectInputConflictIdentifiedMessage); - } - else - { - try - { - if (0 > string.Compare(ConstantStrings.FALSE, matter.Conflict.Identified, StringComparison.OrdinalIgnoreCase)) - { - if (0 >= matter.BlockUserNames.Count()) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputBlockUserNamesCode, TextConstants.IncorrectInputBlockUserNamesMessage); - } - else - { - SharePointHelper.ResolveUserNames(clientContext, matter.BlockUserNames).FirstOrDefault(); - } - } - } - catch (Exception) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputBlockUserNamesCode, TextConstants.IncorrectInputBlockUserNamesMessage); - } - - } - if (string.IsNullOrWhiteSpace(matter.Conflict.CheckBy)) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictCheckByCode, TextConstants.IncorrectInputConflictCheckByMessage); - } - else - { - try - { - SharePointHelper.ResolveUserNames(clientContext, new List() { matter.Conflict.CheckBy }).FirstOrDefault(); - } - catch (Exception) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictCheckByCode, TextConstants.IncorrectInputConflictCheckByMessage); - } - } - } - if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber && 0 >= matter.Roles.Count()) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserRolesCode, TextConstants.IncorrectInputUserRolesMessage); - } - return string.Empty; - } - - /// - /// Validates the roles for the matter and returns the validation status. - /// - /// Request Object containing SharePoint App Token - /// Matter object containing Matter data - /// Client Object - /// A string value indicating whether validations passed or fail - internal static string RoleCheck(RequestObject requestObject, Matter matter, Client client) - { - string returnValue = string.Empty; - try - { - using (ClientContext context = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(ServiceConstantStrings.CentralRepositoryUrl), requestObject.RefreshToken)) - { - if (0 >= matter.Roles.Count()) - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserRolesCode, TextConstants.IncorrectInputUserRolesMessage); - } - ListItemCollection collListItem = Lists.GetData(context, ServiceConstantStrings.DMSRoleListName, ServiceConstantStrings.DMSRoleQuery); - IList roles = new List(); - roles = collListItem.AsEnumerable().Select(roleList => Convert.ToString(roleList[ServiceConstantStrings.RoleListColumnRoleName], CultureInfo.InvariantCulture)).ToList(); - if (matter.Roles.Except(roles).Count() > 0) - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserRolesCode, TextConstants.IncorrectInputUserRolesMessage); - } - } - } - catch (Exception exception) - { - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return returnValue; - } - - /// - /// Validates request token in headers. - /// - /// Boolean value returns whether validations passed or fail - internal static bool CheckRequestValidatorToken() - { - string requestValidationTokens = WebOperationContext.Current.IncomingRequest.Headers["RequestValidationToken"]; - return ServiceUtility.ValidateRequestToken(requestValidationTokens); - } - - /// - /// Function to validate client information - /// - /// Client object - /// Number indicating which method needs to be validated - /// String that contains error message - internal static string ValidateClientInformation(Client client, int methodNumber) - { - string result = string.Empty; - if (string.IsNullOrWhiteSpace(client.Url)) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputClientUrlCode, TextConstants.IncorrectInputClientUrlMessage); - } - else if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || int.Parse(ConstantStrings.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) - { - if (string.IsNullOrWhiteSpace(client.Id)) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputClientIdCode, TextConstants.IncorrectInputClientIdMessage); - } - else if (string.IsNullOrWhiteSpace(client.Name)) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputClientNameCode, TextConstants.IncorrectInputClientNameMessage); - } - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LCADMSKey.snk b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LCADMSKey.snk deleted file mode 100644 index 76c37175..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LCADMSKey.snk and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc deleted file mode 100644 index 04722dac..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc +++ /dev/null @@ -1 +0,0 @@ -<%@ ServiceHost Language="C#" Debug="true" Service="Microsoft.Legal.MatterCenter.ProviderService.LegalBriefcase" CodeBehind="LegalBriefcase.svc.cs" %> diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc.cs deleted file mode 100644 index 3cefd90f..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/LegalBriefcase.svc.cs +++ /dev/null @@ -1,757 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 24-06-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file provides the operation contracts for performing various actions from user's OneDrive. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.ProviderService.CommonHelper; - using Microsoft.Legal.MatterCenter.ProviderService.HelperClasses; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Reflection; - using System.ServiceModel; - using System.ServiceModel.Activation; - using System.ServiceModel.Web; - #endregion - - /// - /// Provides the operation contracts for performing various actions from user's OneDrive. - /// - [ServiceContract(Namespace = "")] - [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] - public class LegalBriefcase - { - #region Operation Contracts - /// - /// Sends attachments to users briefcase (OneDrive). - /// - /// Request Object containing SharePoint App Token - /// Mail attachment details object containing attachment data - /// Boolean value indicating whether check out needs to be performed or not - /// JSON string specifying success or failure - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string SendToBriefcase(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails, bool doCheckOut) - { - string status = ConstantStrings.FALSE; - string result = string.Empty; - try - { - if (null != requestObject && null != mailAttachmentDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - Dictionary collectionOfAttachments = new Dictionary(); - Dictionary collectionOfOriginalAttachments = new Dictionary(); - string[] allAttachmentUrl = mailAttachmentDetails.FullUrl.Split(ConstantStrings.Semicolon[0]); - ClientContext clientContext = null; - string usersMySite = string.Empty; - usersMySite = BriefcaseHelperFunction.GetPersonalURL(requestObject); - if (!usersMySite.ToUpperInvariant().Contains(ServiceConstantStrings.OneDriveNotSetupUrl.ToUpperInvariant())) - { - foreach (string attachmentUrl in allAttachmentUrl) - { - if (!string.IsNullOrWhiteSpace(attachmentUrl)) - { - // Do not use 'using' to generate client context here since it will dispose the object before other functions get executed - clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken); - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1]); - ClientResult clientResultStream = file.OpenBinaryStream(); - ///// Load the Stream data for the file - clientContext.Load(file); - clientContext.ExecuteQuery(); - Guid uniqueKey = Guid.NewGuid(); - collectionOfAttachments.Add(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].Substring(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].LastIndexOf(Convert.ToChar(ConstantStrings.ForwardSlash, CultureInfo.InvariantCulture)) + 1) + ConstantStrings.DOLLAR + uniqueKey, clientResultStream.Value); - collectionOfOriginalAttachments.Add(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].Substring(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].LastIndexOf(Convert.ToChar(ConstantStrings.ForwardSlash, CultureInfo.InvariantCulture)) + 1) + ConstantStrings.DOLLAR + uniqueKey, attachmentUrl); - MailAttachmentDetails sendDocumentUrl = new MailAttachmentDetails(); - sendDocumentUrl.FullUrl = attachmentUrl; - if (doCheckOut) - { - this.CheckOutDocument(requestObject, sendDocumentUrl); - } - } - } - status = BriefcaseHelperFunction.UploadtoBriefcase(requestObject, collectionOfAttachments, collectionOfOriginalAttachments, usersMySite, allAttachmentUrl, mailAttachmentDetails.IsOverwrite); - //// If error not occurred while sending documents to OneDrive - if (!status.Contains(ConstantStrings.Code) && !status.Contains(ConstantStrings.Value)) - { - status = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, 0, status); - } - } - else - { - status = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.ErrorCodeOneDriveNotConfigured, usersMySite); - } - result = status; - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, 0, status); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return result; - } - - /// - /// Sends attachments from users briefcase (OneDrive) to DMS system. - /// - /// Request Object containing SharePoint App Token - /// Briefcase details object containing document data - /// The version information of the document - /// The comments associated with the upload - /// Retain Check out option - /// Convenience Copy option - /// JSON string specifying success or failure - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string SendToMatter(RequestObject requestObject, BriefcaseDetails[] briefcaseDetails, int versionInfo, string comments, bool retainCheckout, bool convenienceCopy) - { - CommonResponse checkInResponse = new CommonResponse(); - string status = string.Empty; - try - { - if (null != requestObject && null != briefcaseDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ClientContext clientContext = null; - string usersMySite = BriefcaseHelperFunction.GetPersonalURL(requestObject); - if (!string.IsNullOrEmpty(usersMySite)) - { - for (int iterator = 0; iterator < briefcaseDetails.Length; iterator++) - { - if (!string.IsNullOrWhiteSpace(briefcaseDetails[iterator].DocumentUrl) && !string.IsNullOrWhiteSpace(briefcaseDetails[iterator].DocumentId)) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(usersMySite), requestObject.RefreshToken)) - { - ClientResult data = Lists.GetStreamFromFile(clientContext, briefcaseDetails[iterator].DocumentUrl); - string briefcaseItemQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.SendToMatterQuery, ServiceConstantStrings.OneDriveSiteColumn, briefcaseDetails[iterator].DocumentId); - ListItemCollection listItems = Lists.GetData(clientContext, ServiceConstantStrings.OneDriveDocumentLibraryTitle, briefcaseItemQuery); - string sourceUrl = string.Empty; - foreach (var listItem in listItems) - { - sourceUrl = Convert.ToString(listItem[ServiceConstantStrings.OneDriveSiteColumn], CultureInfo.InvariantCulture); - } - if (!string.IsNullOrWhiteSpace(sourceUrl)) - { - status = BriefcaseHelperFunction.UploadtoMatter(requestObject, sourceUrl, data.Value, versionInfo, comments, retainCheckout); - checkInResponse.Status.Add(Convert.ToBoolean(status.Split(ConstantStrings.Comma[0])[0], CultureInfo.InvariantCulture)); - if (checkInResponse.Status[iterator]) - { - checkInResponse.FileNames.Add(status.Split(ConstantStrings.Comma[0])[1]); - if (!retainCheckout) - { - if (!convenienceCopy) - { - foreach (var listitem in listItems) - { - listitem.DeleteObject(); - clientContext.ExecuteQuery(); - } - } - } - } - else - { - checkInResponse.ErrorMessage += ConstantStrings.Space + status.Split(ConstantStrings.Comma[0])[1]; - } - } - } - } - } - } - else - { - checkInResponse.ErrorMessage = ServiceConstantStrings.UserMySiteNotPresent; - } - } - else - { - checkInResponse.Status.Add(false); - checkInResponse.ErrorMessage += ConstantStrings.Space + TextConstants.MissingParametersMessage; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - checkInResponse.Status.Add(false); - checkInResponse.ErrorMessage += ConstantStrings.Space + ServiceUtility.RemoveEscapeCharacter(exception.Message); - } - return BriefcaseHelperFunction.GetSerializeResponse(checkInResponse); - } - - /// - /// Check out document from Matter Center. - /// - /// Request Object containing SharePoint App Token - /// Mail attachment details object containing attachment data - /// JSON string specifying success or failure - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string CheckOutDocument(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails) - { - string returnFlag = ConstantStrings.FALSE; - if (null != requestObject && null != mailAttachmentDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string result = ConstantStrings.FALSE; - ClientContext clientContext; - try - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(mailAttachmentDetails.FullUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(mailAttachmentDetails.FullUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].TrimEnd(ConstantStrings.Semicolon[0])); - clientContext.Load(file); - clientContext.ExecuteQuery(); - if (file.CheckOutType == CheckOutType.None) - { - file.CheckOut(); - result = string.Concat(ConstantStrings.TRUE, ConstantStrings.Comma, ConstantStrings.Space, file.Name); - } - else - { - result = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ServiceConstantStrings.AlreadyCheckOut); - } - clientContext.ExecuteQuery(); - returnFlag = result; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - returnFlag = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - } - else - { - returnFlag = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, TextConstants.InvalidParametersMessage); - } - return returnFlag; - } - - /// - /// Returns user who has checked out the document. - /// - /// RequestObject object - /// mailAttachmentDetails object - /// User who has checked out the document - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string[] CheckedOutDocumentByUser(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails) - { - string[] result = null; - if (null != requestObject && null != mailAttachmentDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string fileException; - User checkedOutByUser = null; - try - { - List checkedOutByUserTitle = new List(); - if (null != requestObject && null != mailAttachmentDetails) - { - // full URL, relative URL - string[] allAttachmentUrl = mailAttachmentDetails.FullUrl.Split(ConstantStrings.Semicolon[0]); - ClientContext clientContext; - foreach (string attachmentUrl in allAttachmentUrl) - { - try // To continue retrieve the document status for all documents even if one of the document is not present - { - if (!string.IsNullOrWhiteSpace(attachmentUrl)) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - string relativePath = attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1]; - string[] folderPath = relativePath.Split(Convert.ToChar(ConstantStrings.ForwardSlash, CultureInfo.InvariantCulture)); - bool checkExists = false; - Folder folder = clientContext.Web.GetFolderByServerRelativeUrl(relativePath.Substring(0, relativePath.Length - folderPath[folderPath.Length - 1].Length - 1)); - FileCollection files = folder.Files; - clientContext.Load(folder); - clientContext.Load(files); - clientContext.ExecuteQuery(); - foreach (Microsoft.SharePoint.Client.File file in files) - { - if (file.Name.ToUpperInvariant() == folderPath[folderPath.Length - 1].ToUpperInvariant()) - { - checkExists = true; - break; - } - } - - if (checkExists) - { - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1]); - clientContext.Load(file); - clientContext.ExecuteQuery(); - if (file.CheckOutType == CheckOutType.None) - { - checkedOutByUserTitle.Add(string.Empty); - } - else - { - clientContext.ExecuteQuery(); - checkedOutByUser = file.CheckedOutByUser; - clientContext.Load(checkedOutByUser); - clientContext.ExecuteQuery(); - checkedOutByUserTitle.Add(checkedOutByUser.Title); - } - } - else - { - checkedOutByUserTitle.Add(TextConstants.FileNotAvailableMessage); - } - } - } - } - catch (Exception exception) - { - fileException = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - checkedOutByUserTitle.Add(fileException); - } - } - } - result = checkedOutByUserTitle.ToArray(); - } - catch (Exception exception) - { - fileException = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = new[] { fileException }; - } - } - else - { - result = new[] { TextConstants.MessageNoInputs }; - } - return result; - } - - /// - /// Checks whether normal documents are present in the selected document set. - /// - /// Request Object - /// Sync Details object - /// True if there are no normal documents else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public bool CheckNormalDocuments(RequestObject requestObject, SyncDetails syncDetails) - { - ClientContext clientContext = null; - bool response = false; - try - { - if (null != requestObject && null != syncDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string usersMySite = BriefcaseHelperFunction.GetPersonalURL(requestObject); - if (!string.IsNullOrEmpty(usersMySite)) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(usersMySite), requestObject.RefreshToken)) - { - List sourceURL = BriefcaseHelperFunction.CheckSourceURL(clientContext, syncDetails, 1); - if (0 == sourceURL.Count) - { - response = true; - } - } - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return response; - } - - /// - /// Checks and returns version information about the files. - /// - /// RequestObject object - /// SyncDetails object - /// Status of the operation - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetVersion(RequestObject requestObject, SyncDetails syncDetails) - { - string response = string.Empty; - VersionDetails versionDetails = new VersionDetails(); - try - { - if (null != requestObject && null != syncDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - versionDetails.Status = false; - ClientContext clientContext = null; - string usersMySite = BriefcaseHelperFunction.GetPersonalURL(requestObject); - if (!string.IsNullOrEmpty(usersMySite)) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(usersMySite), requestObject.RefreshToken)) - { - List sourceURL = BriefcaseHelperFunction.CheckSourceURL(clientContext, syncDetails, 1); - - if (sourceURL.Count != 0) - { - return BriefcaseHelperFunction.GetNotSupportedMessage(sourceURL); - } - - sourceURL = BriefcaseHelperFunction.CheckSourceURL(clientContext, syncDetails, 2); - List relativeURLList = BriefcaseHelperFunction.CheckSourceURL(clientContext, syncDetails, 3); - versionDetails.RelativeURL = relativeURLList; - for (int iterator = 0; iterator < sourceURL.Count; iterator++) - { - string url = sourceURL[iterator]; - string relativeURL = Convert.ToString(url.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1], CultureInfo.InvariantCulture); - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(url.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken)) - { - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(relativeURL); - string documentLibraryName = BriefcaseHelperFunction.getLibraryName(clientContext, file); - List docLib = clientContext.Web.Lists.GetByTitle(documentLibraryName); - clientContext.Load(docLib); - clientContext.ExecuteQuery(); - versionDetails.IsMajorVersion.Add(docLib.EnableVersioning); - versionDetails.IsMinorVersion.Add(docLib.EnableMinorVersions); - versionDetails.Status = true; - if (versionDetails.IsMajorVersion[iterator] || versionDetails.IsMinorVersion[iterator]) - { - versionDetails.CurrentMajorVersion.Add(Convert.ToString(file.MajorVersion, CultureInfo.InvariantCulture)); - - if (file.CheckOutType != CheckOutType.None) - { - if (0 == file.MinorVersion) - { - versionDetails.CurrentMinorVersion.Add(Convert.ToString(file.MinorVersion, CultureInfo.InvariantCulture)); - } - else - { - int currentMinorVersion = file.MinorVersion - 1; - versionDetails.CurrentMinorVersion.Add(Convert.ToString(currentMinorVersion, CultureInfo.InvariantCulture)); - } - - clientContext.Load(file.CheckedOutByUser); - clientContext.ExecuteQuery(); - User user = clientContext.Web.CurrentUser; - clientContext.Load(user); - clientContext.ExecuteQuery(); - if (user.Title == file.CheckedOutByUser.Title) - { - versionDetails.CheckOutStatus.Add(Convert.ToString(file.CheckedOutByUser.Title, CultureInfo.InvariantCulture)); - } - else - { - versionDetails.Status = false; - versionDetails.ErrorMessage = ServiceConstantStrings.AlreadyCheckOut; - } - } - else - { - versionDetails.CurrentMinorVersion.Add(Convert.ToString(file.MinorVersion, CultureInfo.InvariantCulture)); - versionDetails.CheckOutStatus.Add(ConstantStrings.Space); - } - } - } - } - } - } - else - { - versionDetails.ErrorMessage = ServiceConstantStrings.UserMySiteNotPresent; - } - } - else - { - versionDetails.Status = false; - versionDetails.ErrorMessage = TextConstants.MessageNoInputs; - } - } - catch (Exception exception) - { - versionDetails.Status = false; - versionDetails.ErrorMessage += ServiceUtility.RemoveEscapeCharacter(exception.Message); - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - response = BriefcaseHelperFunction.GetSerializeResponse(versionDetails); - return response; - } - - /// - /// Obtains and returns relative URL of the files. - /// - /// Request object used for creating context - /// List Id - /// Array of list item id - /// URL of the site collection - /// Relative URL of files or false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetFileRelativeLocation(RequestObject requestObject, string listId, string[] listItemId, string currentLocation) - { - string response = string.Empty; - bool hasFolder = false; - try - { - if (null != requestObject && null != listId && null != listItemId && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ClientContext clientContext = null; - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(currentLocation), requestObject.RefreshToken)) - { - List list = clientContext.Web.Lists.GetById(new Guid(listId)); - int iterator = 0, length = listItemId.Length; - for (iterator = 0; iterator < length; iterator++) - { - ListItem listItem = list.GetItemById(listItemId[iterator]); - clientContext.Load(listItem, item => item.File.ServerRelativeUrl, item => item.FileSystemObjectType); - clientContext.ExecuteQuery(); - if (listItem.FileSystemObjectType == FileSystemObjectType.File) - { - response += currentLocation + ConstantStrings.DOLLAR + listItem.File.ServerRelativeUrl; - if (iterator < length - 1) - { - response += ConstantStrings.Semicolon; - } - } - else - { - hasFolder = true; - break; - } - } - - if (hasFolder) - { - response = ConstantStrings.FALSE; - } - } - } - } - catch (Exception exception) - { - ////Generic Exception - response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - - return response; - } - - /// - /// Performs legal briefcase operations mainly Check Out, Detach and Update document functionality. - /// - /// RequestObject object - /// SyncDetails object - /// Status of the operation in JSON format - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string SyncBriefcase(RequestObject requestObject, SyncDetails syncDetails) - { - CommonResponse commonResponse = new CommonResponse(); - try - { - if (null != requestObject && null != syncDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string usersMySite = string.Empty; - ClientContext clientContext = null; - usersMySite = BriefcaseHelperFunction.GetPersonalURL(requestObject); - if (!string.IsNullOrEmpty(usersMySite)) - { - using (clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(usersMySite), requestObject.RefreshToken)) - { - string status = string.Empty; - List sourceURL = BriefcaseHelperFunction.CheckSourceURL(clientContext, syncDetails, 1); - if (sourceURL.Count != 0) - { - return BriefcaseHelperFunction.GetNotSupportedMessage(sourceURL); - } - - GetContextInList(requestObject, syncDetails, ref commonResponse, clientContext, ref status); - } - } - else - { - commonResponse.ErrorMessage = ServiceConstantStrings.UserMySiteNotPresent; - } - } - else - { - commonResponse.Status.Add(false); - commonResponse.ErrorMessage = TextConstants.InvalidParametersMessage; - } - } - catch (Exception exception) - { - commonResponse.Status.Add(false); - commonResponse.ErrorMessage = ServiceUtility.RemoveEscapeCharacter(exception.Message); - } - - return BriefcaseHelperFunction.GetSerializeResponse(commonResponse); - } - - /// - /// Helper function to perform Check Out, Detach, and Update document functionality. - /// - /// The Web request object. - /// SyncDetails object - /// Holds response for briefcase detach operation - /// Client context object for connection between SP & client - /// Sets status for send to briefcase operation - private void GetContextInList(RequestObject requestObject, SyncDetails syncDetails, ref CommonResponse commonResponse, ClientContext clientContext, ref string status) - { - List list = clientContext.Web.Lists.GetById(new Guid(syncDetails.ListId)); - foreach (int itemid in syncDetails.ItemId) - { - ListItemCollection listItems = BriefcaseHelperFunction.GetListItemCollection(clientContext, itemid); - MailAttachmentDetails mailattachmentDetails = new MailAttachmentDetails(); - ServiceConstantStrings.OperationTypes operationType = (ServiceConstantStrings.OperationTypes)syncDetails.Operation; - if (operationType == ServiceConstantStrings.OperationTypes.Detach) - { - commonResponse = BriefcaseHelperFunction.DetachOperation(commonResponse, clientContext, list, listItems); - } - else - { - foreach (var listItem in listItems) - { - mailattachmentDetails.FullUrl = Convert.ToString(listItem[ServiceConstantStrings.OneDriveSiteColumn], CultureInfo.InvariantCulture); - mailattachmentDetails.IsOverwrite = 1; - } - - switch (operationType) - { - case ServiceConstantStrings.OperationTypes.Update: - status = this.SendToBriefcase(requestObject, mailattachmentDetails, false); - commonResponse = BriefcaseHelperFunction.UpdateOperationStatus(commonResponse, status); - break; - case ServiceConstantStrings.OperationTypes.Checkout: - status = this.CheckOutDocument(requestObject, mailattachmentDetails); - commonResponse = BriefcaseHelperFunction.CheckoutOperationStatus(commonResponse, status); - commonResponse.Status.Add(Convert.ToBoolean(status.Split(',')[0], CultureInfo.InvariantCulture)); - break; - } - } - } - } - - /// - /// Generates the mail object with attachments and send it as a stream. - /// - /// Request Object containing SharePoint App Token - /// Mail attachment details object containing attachment data - /// Memory stream of the created mail object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public Stream SaveEmail(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails) - { - Stream result = null; - try - { - if (null != requestObject && null != mailAttachmentDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ///// filename, stream - Dictionary collectionOfAttachments = new Dictionary(); - ///// full URL, relative URL - string[] allAttachmentUrl = mailAttachmentDetails.FullUrl.Split(';'); - ClientContext clientContext; - bool attachmentFlag = mailAttachmentDetails.IsAttachmentCall; - if (attachmentFlag) - { - foreach (string attachmentUrl in allAttachmentUrl) - { - if (!string.IsNullOrWhiteSpace(attachmentUrl)) - { - // Do not use 'using' to generate client context here since it will dispose the object before other functions get executed - clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[0]), requestObject.RefreshToken); - Microsoft.SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1]); - ClientResult fileStream = file.OpenBinaryStream(); - ///// Load the Stream data for the file - clientContext.Load(file); - clientContext.ExecuteQuery(); - - ///// In order to allow for multiple files with the same name, we provide a GUID tag to ensure unique keys in the dictionary - string uniqueKeyWithDate = attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].Substring(attachmentUrl.Split(Convert.ToChar(ConstantStrings.DOLLAR, CultureInfo.InvariantCulture))[1].LastIndexOf(Convert.ToChar(ConstantStrings.BackwardSlash, CultureInfo.InvariantCulture)) + 1) + ConstantStrings.DOLLAR + Guid.NewGuid(); - collectionOfAttachments.Add(uniqueKeyWithDate, fileStream.Value); - } - } - } - - result = MailHelperFunctions.GenerateEmail(collectionOfAttachments, allAttachmentUrl, attachmentFlag); - } - else - { - result = BriefcaseHelperFunction.ReturnErrorFile(TextConstants.MessageNoInputs); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = BriefcaseHelperFunction.ReturnErrorFile(string.Concat(ConstantStrings.ServiceResponse, exception.HResult, exception.Message)); - } - return result; - } - - /// - /// Discards checkout from the documents - /// - /// Request object - /// List of attachment URL - /// Status of discarding check out - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string DiscardCheckOutChanges(RequestObject requestObject, MailAttachmentDetails mailAttachmentDetails) - { - string result = null; - try - { - if (null != requestObject && null != mailAttachmentDetails && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ///// full URL, relative URL - string[] allAttachmentUrl = mailAttachmentDetails.FullUrl.Split(';'); - - foreach (string attachmentUrl in allAttachmentUrl) - { - if (!string.IsNullOrWhiteSpace(attachmentUrl)) - { - MailAttachmentDetails sendDocumentUrl = new MailAttachmentDetails(); - sendDocumentUrl.FullUrl = attachmentUrl; - result = BriefcaseHelperFunction.DiscardCheckout(requestObject, sendDocumentUrl); - } - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = string.Concat(ConstantStrings.FALSE, ConstantStrings.Comma, ConstantStrings.Space, ServiceUtility.RemoveEscapeCharacter(exception.Message)); - } - return result; - } - #endregion - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc deleted file mode 100644 index 40547554..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc +++ /dev/null @@ -1 +0,0 @@ -<%@ ServiceHost Language="C#" Debug="true" Service="Microsoft.Legal.MatterCenter.ProviderService.MatterProvision" CodeBehind="MatterProvision.svc.cs" %> diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc.cs deleted file mode 100644 index 59c7ec5a..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/MatterProvision.svc.cs +++ /dev/null @@ -1,1123 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-prd -// Created : 03-06-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines service for Matter Provision App. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.ProviderService.CommonHelper; - using Microsoft.Legal.MatterCenter.ProviderService.HelperClasses; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.WebParts; - using Newtonsoft.Json; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - using System.ServiceModel; - using System.ServiceModel.Activation; - using System.ServiceModel.Web; - using System.Web; - #endregion - - /// - /// Provides the operation contracts used for provisioning a matter. - /// - [ServiceContract(Namespace = "")] - [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] - public class MatterProvision - { - #region Operation Contracts - /// - /// Gets the hierarchy of terms along with the specific custom properties of each term from term store. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Term Store object containing Term store data - /// Serialized string of Term store JSON object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetTaxonomyData(RequestObject requestObject, Client client, TermStoreDetails details) - { - string returnValue = ConstantStrings.FALSE; - try - { - if (null != requestObject && null != client & null != details && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, null, null, null, int.Parse(ConstantStrings.ProvisionMatterCommonValidation, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - string cacheValue = string.Empty, key = string.Empty; - if (details.TermSetName == ServiceConstantStrings.PracticeGroupTermSetName) - { - key = ServiceConstantStrings.CACHE_MATTER_TYPE; - } - else if (details.TermSetName == ServiceConstantStrings.ClientTermSetName) - { - key = ServiceConstantStrings.CACHE_CLIENTS; - } - cacheValue = ServiceUtility.GetOrSetCachedValue(key); - if (cacheValue.Equals(ConstantStrings.FALSE)) - { - returnValue = TermStoreHelperFunctions.GetTaxonomyHierarchy(clientContext, details); - //// Check if error has returned while processing data - if (!ServiceUtility.CheckValueHasErrors(returnValue)) - { - ServiceUtility.GetOrSetCachedValue(key, returnValue); - } - } - else - { - returnValue = cacheValue; - } - } - } - else - { - returnValue = ProvisionMatterValidation; - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - } - catch (Exception exception) - { - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - return returnValue; - } - - /// - /// Get roles from the SharePoint list. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Serialized string of Roles JSON object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetRoleData(RequestObject requestObject, Client client) - { - string returnValue = ConstantStrings.FALSE; - if (null != requestObject && null != client && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, null, null, null, int.Parse(ConstantStrings.ProvisionMatterCommonValidation, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - try - { - // SharePoint Helper Method to retrieve list items - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - returnValue = ServiceUtility.GetOrSetCachedValue(ServiceConstantStrings.CACHE_ROLES); - if (returnValue.Equals(ConstantStrings.FALSE)) - { - IList roles = new List(); - ListItemCollection collListItem = Lists.GetData(clientContext, ServiceConstantStrings.DMSRoleListName, ServiceConstantStrings.DMSRoleQuery); - ///// Check if NULL and greater than 0 - roles = ProvisionHelperFunctions.GetRoleDataUtility(roles, collListItem); - returnValue = JsonConvert.SerializeObject(roles); - //// Check if return value has errors - if (!ServiceUtility.CheckValueHasErrors(returnValue)) - { - //// Cache the value if there is no error in return value - ServiceUtility.GetOrSetCachedValue(ServiceConstantStrings.CACHE_ROLES, returnValue); - } - } - } - } - catch (Exception exception) - { - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - returnValue = ProvisionMatterValidation; - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return returnValue; - } - - /// - /// Gets different permission levels to be used on the site. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Serialized string of Permissions JSON object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetPermissionLevels(RequestObject requestObject, Client client) - { - string returnValue = ConstantStrings.FALSE; - if (null != requestObject && null != client && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, null, null, null, int.Parse(ConstantStrings.ProvisionMatterCommonValidation, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - returnValue = ProvisionHelperFunctions.GetPermissionLevelUtility(requestObject, client, returnValue); - } - else - { - returnValue = ProvisionMatterValidation; - } - } - else - { - return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return returnValue; - } - - /// - /// Gets users from the site based on the search term. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Search object containing search term - /// Serialized string of Users JSON object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetUsers(RequestObject requestObject, Client client, SearchObject searchObject) - { - string returnValue = ConstantStrings.FALSE; - if (null != requestObject && null != client && null != searchObject && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, null, null, null, int.Parse(ConstantStrings.ProvisionMatterCommonValidation, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - try - { - searchObject.SearchTerm = (!string.IsNullOrWhiteSpace(searchObject.SearchTerm)) ? searchObject.SearchTerm : string.Empty; - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - IList foundUsers = SharePointHelper.SearchUsers(clientContext, searchObject.SearchTerm); - IList users = new List(); - if (null != foundUsers && 0 != foundUsers.Count) - { - users = ProvisionHelperFunctions.FilterUsers(users, foundUsers); - } - else - { - Users noResult = new Users() - { - Name = TextConstants.PeoplePickerNoResults, - LogOnName = string.Empty, - Email = string.Empty, - EntityType = string.Empty, - ProviderName = string.Empty, - EntityData = new EntityData() - { - Department = string.Empty, - Email = string.Empty, - Title = string.Empty - } - }; - users.Add(noResult); - } - returnValue = JsonConvert.SerializeObject(users); - } - } - catch (Exception exception) - { - ///// SharePoint Specific Exception - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - returnValue = ProvisionMatterValidation; - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return returnValue; - } - - /// - /// Checks if a matter with a specific name exists already for a particular client. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// true if success else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string CheckMatterExists(RequestObject requestObject, Client client, Matter matter, bool hasErrorOccurred, MatterConfigurations matterConfigurations = null) - { - string returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.DeleteMatterCode, ConstantStrings.TRUE); - if (null != requestObject && null != client && null != matter && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, null, matter, null, int.Parse(ConstantStrings.ProvisionMatterCheckMatterExists, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - try - { - if (!hasErrorOccurred) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - List listExists = ProvisionHelperFunctions.CheckListsExist(clientContext, matter.Name, matterConfigurations); - if (0 < listExists.Count) - { - string listName = !string.Equals(matter.Name, listExists[0]) ? listExists[0].Contains(ConstantStrings.Underscore) ? listExists[0].Split(ConstantStrings.Underscore[0]).Last() : ConstantStrings.Matter : ConstantStrings.Matter; - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.MatterLibraryExistsCode, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.ErrorDuplicateMatter, listName) + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + ConstantStrings.MatterPrerequisiteCheck.LibraryExists); - } - else - { - Uri clientUri = new Uri(client.Url); - string requestedUrl = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}", clientUri.AbsolutePath, ConstantStrings.ForwardSlash, ServiceConstantStrings.MatterLandingPageRepositoryName.Replace(ConstantStrings.Space, string.Empty), ConstantStrings.ForwardSlash, matter.Name, ConstantStrings.AspxExtension); - if (ConstantStrings.TRUE == SearchHelperFunctions.PageExists(requestedUrl, clientContext)) - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.MatterLandingExistsCode, ServiceConstantStrings.ErrorDuplicateMatterLandingPage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + ConstantStrings.MatterPrerequisiteCheck.MatterLandingPageExists); // Return when matter landing page is present - } - } - } - } - else - { - returnValue = ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - } - } - catch (Exception exception) - { - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - returnValue = ProvisionMatterValidation; - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return returnValue; - } - - /// - /// Creates a matter (document library) using specified matter details. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Matter Configurations object - /// CSS Ids of the assigned users - /// JSON object with matter URL and true or false flag - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string CreateMatter(RequestObject requestObject, Client client, Matter matter, MatterConfigurations matterConfigurations, IList userId, bool isErrorOccurred) - { - try - { - string result = string.Empty; - if (null != requestObject && null != client && null != matter && (null != requestObject.RefreshToken || null != requestObject.SPAppToken || null != client.Url) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - if (Lists.CheckPermissionOnList(ServiceUtility.GetClientContext(null, new Uri(client.Url), requestObject.RefreshToken), ServiceConstantStrings.MatterConfigurationsList, PermissionKind.EditListItems)) - { - string matterURL = ConstantStrings.FALSE; - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, null, int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture), matterConfigurations); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - string matterValidation = CheckMatterExists(requestObject, client, matter, isErrorOccurred, matterConfigurations); - if (matterValidation.ToUpperInvariant().Contains(ConstantStrings.TRUE.ToUpperInvariant())) - { - if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.Identified)) - { - if (Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)) - { - matterURL = EditMatterHelperFunctions.CheckSecurityGroupInTeamMembers(clientContext, matter, userId); - if (string.Equals(matterURL, ConstantStrings.FALSE, StringComparison.OrdinalIgnoreCase)) - { - matterURL = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictIdentifiedCode, TextConstants.IncorrectInputConflictIdentifiedMessage); - } - } - else - { - matterURL = ConstantStrings.TRUE; - } - if (string.Equals(matterURL, ConstantStrings.TRUE, StringComparison.OrdinalIgnoreCase)) - { - matterURL = ProvisionHelperFunctions.CreateMatterUtility(requestObject, client, matter, clientContext, matterURL, matterConfigurations); - } - } - } - else - { - matterURL = matterValidation; - } - result = matterURL; - } - else - { - result = ProvisionMatterValidation; - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.UserNotSiteOwnerCode, ServiceConstantStrings.UserNotSiteOwnerMessage); - } - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - catch (Exception exception) - { - return Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - - /// - /// Assigns specified permission to the list of users on specified matter. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Matter Configurations object - /// true if success else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string AssignUserPermissions(RequestObject requestObject, Client client, Matter matter, MatterConfigurations matterConfigurations) - { - string returnValue = ConstantStrings.FALSE; - if (null != requestObject && null != client && null != matter && null != client.Url && null != matterConfigurations && (null != requestObject.RefreshToken || null != requestObject.SPAppToken) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - string calendarName = string.Concat(matter.Name, ServiceConstantStrings.CalendarNameSuffix); - string oneNoteLibraryName = string.Concat(matter.Name, ServiceConstantStrings.OneNoteLibrarySuffix); - string taskLibraryName = string.Concat(matter.Name, ServiceConstantStrings.TaskNameSuffix); - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, null, int.Parse(ConstantStrings.ProvisionMatterAssignUserPermissions, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - - if (!string.IsNullOrWhiteSpace(matter.Name)) - { - //Assign permission for Matter library - returnValue = Convert.ToString(Lists.SetPermission(clientContext, matter.AssignUserEmails, matter.Permissions, matter.Name), CultureInfo.CurrentCulture); - - //Assign permission for OneNote library - Lists.SetPermission(clientContext, matter.AssignUserEmails, matter.Permissions, oneNoteLibraryName); - - // Assign permission to calendar list if it is selected - if (ServiceConstantStrings.IsCreateCalendarEnabled && matterConfigurations.IsCalendarSelected) - { - string returnValueCalendar = Convert.ToString(Lists.SetPermission(clientContext, matter.AssignUserEmails, matter.Permissions, calendarName), CultureInfo.CurrentCulture); - if (!Convert.ToBoolean(returnValueCalendar, CultureInfo.InvariantCulture)) - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeCalendarCreation, TextConstants.ErrorMessageCalendarCreation); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - - // Assign permission to task list if it is selected - if (matterConfigurations.IsTaskSelected) - { - string returnValueTask = Convert.ToString(Lists.SetPermission(clientContext, matter.AssignUserEmails, matter.Permissions, taskLibraryName), CultureInfo.CurrentCulture); - if (!Convert.ToBoolean(returnValueTask, CultureInfo.InvariantCulture)) - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorMessageTaskCreation, TextConstants.ErrorCodeAddTaskList); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - } - } - else - { - returnValue = ProvisionMatterValidation; - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - } - } - } - catch (Exception exception) - { - ///// Web Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - // To avoid the invalid symbol error while parsing the JSON, return the response in lower case - return returnValue.ToLower(CultureInfo.CurrentUICulture); - } - - /// - /// Creates matter landing page on matter creation. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Matter Configurations object - /// true if success else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string CreateMatterLandingPage(RequestObject requestObject, Client client, Matter matter, MatterConfigurations matterConfigurations) - { - int matterLandingPageId; - string response = string.Empty; - string result = string.Empty; - if (null != requestObject && null != client && null != matter && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, null, int.Parse(ConstantStrings.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture), matterConfigurations); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - Uri uri = new Uri(client.Url); - Web web = clientContext.Web; - - //// Create Matter Landing Web Part Page - string pageName = string.Format(CultureInfo.InvariantCulture, "{0}{1}", matter.MatterGuid, ConstantStrings.AspxExtension); - matterLandingPageId = Page.CreateWebPartPage(clientContext, pageName, ConstantStrings.DefaultLayout, ConstantStrings.MasterPageGallery, ServiceConstantStrings.MatterLandingPageRepositoryName, matter.Name); - if (0 <= matterLandingPageId) - { - bool isCopyRoleAssignment = ProvisionHelperFunctions.CopyRoleAssignment(matter.Conflict.Identified, matter.Conflict.SecureMatter); - Lists.BreakItemPermission(clientContext, ServiceConstantStrings.MatterLandingPageRepositoryName, matterLandingPageId, isCopyRoleAssignment); - Lists.SetItemPermission(clientContext, matter.AssignUserEmails, ServiceConstantStrings.MatterLandingPageRepositoryName, matterLandingPageId, matter.Permissions); - //// Configure All Web Parts - string[] webParts = MatterLandingHelperFunction.ConfigureXMLCodeOfWebParts(requestObject, client, matter, clientContext, pageName, uri, web, matterConfigurations); - Microsoft.SharePoint.Client.File file = web.GetFileByServerRelativeUrl(string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}", uri.AbsolutePath, ConstantStrings.ForwardSlash, ServiceConstantStrings.MatterLandingPageRepositoryName.Replace(ConstantStrings.Space, string.Empty), ConstantStrings.ForwardSlash, pageName)); - clientContext.Load(file); - clientContext.ExecuteQuery(); - LimitedWebPartManager limitedWebPartManager = file.GetLimitedWebPartManager(PersonalizationScope.Shared); - WebPartDefinition webPartDefinition = null; - string[] zones = { ConstantStrings.HeaderZone, ConstantStrings.TopZone, ConstantStrings.RightZone, ConstantStrings.TopZone, ConstantStrings.RightZone, ConstantStrings.RightZone, ConstantStrings.FooterZone, ConstantStrings.RightZone, ConstantStrings.RightZone }; - Page.AddWebPart(clientContext, limitedWebPartManager, webPartDefinition, webParts, zones); - response = ConstantStrings.TRUE; - } - else - { - MatterCenterException customException = new MatterCenterException(ServiceConstantStrings.ErrorCodeMatterLandingPageExists, ServiceConstantStrings.ErrorCodeMatterLandingPageExists); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - else - { - response = ProvisionMatterValidation; - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - } - } - - result = response; - } - catch (Exception exception) - { - ////Generic Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - - /// - /// Assigns specified content types to the specified matter (document library). - /// - /// Request Object containing SharePoint App Token - /// Object containing metadata for Matter - /// true if success else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string AssignContentType(RequestObject requestObject, MatterMetadata matterMetadata) - { - string returnValue = ConstantStrings.FALSE; - if (null != requestObject && null != matterMetadata && null != matterMetadata.Client && null != matterMetadata.Matter && (null != requestObject.RefreshToken || null != requestObject.SPAppToken) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - // For each value in the list of Content Type Names - // Add that content Type to the Library - Matter matter = matterMetadata.Matter; - Client client = matterMetadata.Client; - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - string ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, null, int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - // Returns the selected Content types from the Site Content Types - IList contentTypeCollection = SharePointHelper.GetContentTypeData(clientContext, matter.ContentTypes, requestObject, client, matter); - - if (null != contentTypeCollection && matter.ContentTypes.Count == contentTypeCollection.Count && !string.IsNullOrWhiteSpace(matter.Name)) - { - returnValue = ProvisionHelperFunctions.AssignContentTypeHelper(requestObject, matterMetadata, clientContext, contentTypeCollection, client, matter); - } - else - { - MatterCenterException customException = new MatterCenterException(TextConstants.ErrorCodeContentTypes, TextConstants.ErrorMessageContentTypes); - throw customException; // Throw will direct to current function's catch block (if present). If not present then it will direct to parent catch block. Parent will be the calling function - } - } - else - { - returnValue = ProvisionMatterValidation; - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - } - } - } - catch (Exception exception) - { - ///// SharePoint Specific Exception - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return returnValue; - } - - /// - /// Stamps properties to the created matter. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object - /// Matter details object which has data of properties to be stamped - /// Matter provision flag object which hold boolean values - /// Object Holding configuration for the matter - /// true if success else false - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string UpdateMetadataForList(RequestObject requestObject, Client client, Matter matter, MatterDetails matterDetails, MatterProvisionFlags matterProvisionChecks, MatterConfigurations matterConfigurations) - { - string result = ConstantStrings.FALSE; - string properties = ConstantStrings.FALSE; - string ProvisionMatterValidation = string.Empty; - if (null != requestObject && null != client && null != matter && null != matterDetails && (null != requestObject.RefreshToken || null != requestObject.SPAppToken) && (null != matterProvisionChecks) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - string shareMatterFlag = string.Empty; - ProvisionMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, matterDetails, int.Parse(ConstantStrings.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture), matterConfigurations); - if (string.IsNullOrWhiteSpace(ProvisionMatterValidation)) - { - try - { - var props = clientContext.Web.Lists.GetByTitle(matter.Name).RootFolder.Properties; - Dictionary propertyList = new Dictionary(); - propertyList = ProvisionHelperFunctions.SetStampProperty(client, matter, matterDetails); - clientContext.Load(props); - clientContext.ExecuteQuery(); - Lists.SetPropertBagValuesForList(clientContext, props, matter.Name, propertyList); - if (matterProvisionChecks.SendEmailFlag) - { - shareMatterFlag = ProvisionHelperFunctions.ShareMatter(requestObject, client, matter, matterDetails, matterProvisionChecks.MatterLandingFlag, matterConfigurations); - } - else - { - shareMatterFlag = ConstantStrings.TRUE; - } - properties = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, shareMatterFlag); - } - - catch (Exception exception) - { - properties = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - } - } - else - { - ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); - properties = ProvisionMatterValidation; - } - result = properties; - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - - /// - /// Retrieves the stamped properties from matter library property bag. - /// - /// Request Object containing SharePoint App Token - /// Client object containing Client data - /// Matter object - /// Matter stamped properties - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string RetrieveMatterStampedProperties(RequestObject requestObject, Client client, Matter matter) - { - string result = string.Empty; - if (null != requestObject && null != client && null != matter && !string.IsNullOrWhiteSpace(matter.Name) && (null != requestObject.RefreshToken || null != requestObject.SPAppToken) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - PropertyValues matterStampedProperties = null; - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - // Get all the stamped properties from matter library - matterStampedProperties = EditMatterHelperFunctions.FetchMatterStampedProperties(clientContext, matter.Name); - - Dictionary stampedPropertyValues = matterStampedProperties.FieldValues; - if (0 < stampedPropertyValues.Count) - { - string matterCenterUsers = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterCenterUsers); - string matterCenterUserEmails = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterCenterUserEmails); - List> matterCenterUserCollection = new List>(); - List> matterCenterUserEmailsCollection = new List>(); - if (!string.IsNullOrWhiteSpace(matterCenterUsers)) - { - matterCenterUserCollection = EditMatterHelperFunctions.GetMatterAssignedUsers(matterCenterUsers); - } - if (!string.IsNullOrWhiteSpace(matterCenterUserEmails)) - { - matterCenterUserEmailsCollection = EditMatterHelperFunctions.GetMatterAssignedUsers(matterCenterUserEmails); - } - MatterStampedDetails matterStampedDetails = new MatterStampedDetails() - { - IsNewMatter = stampedPropertyValues.ContainsKey(ServiceConstantStrings.StampedPropertyIsConflictIdentified) ? ConstantStrings.TRUE : ConstantStrings.FALSE, - MatterObject = new Matter() - { - Id = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterID), - Name = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterName), - Description = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterDescription), - DefaultContentType = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyDefaultContentType), - DocumentTemplateCount = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyDocumentTemplateCount).Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries).ToList(), - Roles = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterCenterRoles).Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries).ToList(), - Permissions = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyMatterCenterPermissions).Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries).ToList(), - BlockUserNames = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyBlockedUsers).Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries).ToList(), - AssignUserNames = matterCenterUserCollection.ToList>(), - AssignUserEmails = matterCenterUserEmailsCollection.ToList>(), - Conflict = new Conflict() - { - CheckBy = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyConflictCheckBy), - CheckOn = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyConflictCheckDate), - Identified = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyIsConflictIdentified), - SecureMatter = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertySecureMatter), - } - }, - MatterDetailsObject = EditMatterHelperFunctions.ExtractMatterDetails(stampedPropertyValues), - ClientObject = new Client() - { - Id = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyClientID), - Name = EditMatterHelperFunctions.GetStampPropertyValue(stampedPropertyValues, ServiceConstantStrings.StampedPropertyClientName), - } - }; - result = JsonConvert.SerializeObject(matterStampedDetails); - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - return result; - } - - /// - /// Used to get the default matter values for the client from the SharePoint list - /// - /// Request object - /// Site collection path - /// JSON structure with default values of matters for the client - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetDefaultMatterConfigurations(RequestObject requestObject, string siteCollectionPath) - { - string result = string.Empty, settingsUpdatedDate = string.Empty; - int errorCodeModifiedDate = 0; // Error code to be set if no list item found in Matter Configuration list - if (null != requestObject && !string.IsNullOrWhiteSpace(siteCollectionPath) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(siteCollectionPath), requestObject.RefreshToken)) - { - if (Lists.CheckPermissionOnList(ServiceUtility.GetClientContext(null, new Uri(siteCollectionPath), requestObject.RefreshToken), ServiceConstantStrings.MatterConfigurationsList, PermissionKind.EditListItems)) - { - string listQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MatterConfigurationsListQuery, SearchConstants.ManagedPropertyTitle, ServiceConstantStrings.MatterConfigurationTitleValue); - ListItem settingsItem = Lists.GetData(clientContext, ServiceConstantStrings.MatterConfigurationsList, listQuery).FirstOrDefault(); - if (null != settingsItem) - { - settingsUpdatedDate = Convert.ToString(settingsItem[ServiceConstantStrings.ColumnNameModifiedDate], CultureInfo.InvariantCulture); - result = HttpUtility.HtmlDecode(string.Concat(Convert.ToString(settingsItem[ServiceConstantStrings.MatterConfigurationColumn], CultureInfo.InvariantCulture), ConstantStrings.Pipe, ConstantStrings.DOLLAR, ConstantStrings.Pipe, settingsUpdatedDate)); - } - else - { - settingsUpdatedDate = Convert.ToString(errorCodeModifiedDate, CultureInfo.InvariantCulture); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.UserNotSiteOwnerCode, ServiceConstantStrings.UserNotSiteOwnerMessage); - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - - if (string.IsNullOrEmpty(result)) - { - MatterConfigurations configurations = new MatterConfigurations(); - configurations.IsCalendarSelected = true; - configurations.IsConflictCheck = true; - configurations.IsEmailOptionSelected = true; - configurations.IsMatterDescriptionMandatory = true; - configurations.IsRestrictedAccessSelected = true; - configurations.IsRSSSelected = true; - configurations.IsTaskSelected = true; - result = JsonConvert.SerializeObject(configurations); - result = string.Concat(result, ConstantStrings.Pipe, ConstantStrings.DOLLAR, ConstantStrings.Pipe, settingsUpdatedDate); - } - return result; - } - - /// - /// Save Matter Configurations back to SharePoint list - /// - /// Request object - /// Site Collection Path - /// Matter Configurations object - /// User Ids - /// Date and time when user loaded the client settings page to configure default values - /// Error message or success - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string SaveMatterConfigurations(RequestObject requestObject, string siteCollectionPath, MatterConfigurations matterConfigurations, IList userId, string cachedItemModifiedDate) - { - string result = string.Empty; - if (null != requestObject && !string.IsNullOrWhiteSpace(siteCollectionPath) && null != matterConfigurations && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(siteCollectionPath), requestObject.RefreshToken)) - { - Matter matter = new Matter(); - matter.AssignUserNames = SettingsHelper.GetUserList(matterConfigurations.MatterUsers); - matter.AssignUserEmails = SettingsHelper.GetUserList(matterConfigurations.MatterUserEmails); - - if (0 < matter.AssignUserNames.Count) - { - result = EditMatterHelperFunctions.ValidateTeamMembers(clientContext, matter, userId); - } - if (string.IsNullOrEmpty(result)) - { - result = SettingsHelper.SaveConfigurationToList(matterConfigurations, clientContext, cachedItemModifiedDate); - bool tempResult = false; - if (Boolean.TryParse(result, out tempResult)) - { - if (tempResult) - { - string listQuery = string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.MatterConfigurationsListQuery, SearchConstants.ManagedPropertyTitle, ServiceConstantStrings.MatterConfigurationTitleValue); - ListItem settingsItem = Lists.GetData(clientContext, ServiceConstantStrings.MatterConfigurationsList, listQuery).FirstOrDefault(); - if (null != settingsItem) - { - cachedItemModifiedDate = Convert.ToString(settingsItem[ServiceConstantStrings.ColumnNameModifiedDate], CultureInfo.InvariantCulture); - } - result = string.Concat(result, ConstantStrings.Pipe, ConstantStrings.DOLLAR, ConstantStrings.Pipe, cachedItemModifiedDate); - } - } - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - - } - - /// - /// Updated matter permission details. - /// - /// Request object - /// Client object - /// Matter object - /// Matter Object containing Matter metadata - /// Edit/Add mode - /// User Id information - /// Status of operation - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string UpdateMatterDetails(RequestObject requestObject, Client client, Matter matter, MatterDetails matterDetails, string editMode, IList userId) - { - string result = ConstantStrings.TRUE; - if (null != requestObject && null != client && null != matter && null != matterDetails && (null != requestObject.RefreshToken || null != requestObject.SPAppToken) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - IEnumerable userPermissionOnLibrary = null; - PropertyValues matterStampedProperties = null; - int listItemId = -1; - bool isEditMode = false; - string editMatterValidation = string.Empty; - string loggedInUserName = string.Empty; - try - { - isEditMode = Convert.ToBoolean(editMode, CultureInfo.InvariantCulture); - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - List listExists = ProvisionHelperFunctions.CheckListsExist(clientContext, matter.Name); - bool hasFullPermission = false; - try - { - editMatterValidation = ValidationHelperFunctions.ProvisionMatterValidation(requestObject, client, clientContext, matter, matterDetails, int.Parse(ConstantStrings.EditMatterPermission, CultureInfo.InvariantCulture), null); - if (string.IsNullOrWhiteSpace(editMatterValidation)) - { - if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.Identified)) - { - if (0 == matter.AssignUserEmails.Count()) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserNamesCode, TextConstants.IncorrectInputUserNamesMessage); - } - else - { - result = EditMatterHelperFunctions.ValidateTeamMembers(clientContext, matter, userId); - if (string.IsNullOrEmpty(result)) - { - result = ConstantStrings.TRUE; - if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.Identified)) - { - if (Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)) - { - result = EditMatterHelperFunctions.CheckSecurityGroupInTeamMembers(clientContext, matter, userId); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictIdentifiedCode, TextConstants.IncorrectInputConflictIdentifiedMessage); - } - } - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictIdentifiedCode, TextConstants.IncorrectInputConflictIdentifiedMessage); - } - if (string.Equals(result, ConstantStrings.TRUE, StringComparison.OrdinalIgnoreCase)) - { - // Get matter stamped properties - matterStampedProperties = EditMatterHelperFunctions.FetchMatterStampedProperties(clientContext, matter.Name); - loggedInUserName = EditMatterHelperFunctions.GetUserUpdatingMatter(clientContext); - bool isFullControlPresent = EditMatterHelperFunctions.ValidateFullControlPermission(matter); - if (isFullControlPresent) - { - // Get matter library current permissions - userPermissionOnLibrary = EditMatterHelperFunctions.FetchUserPermission(clientContext, matter.Name); - // Check if OneNote library, calendar, and matter landing page exists as separate objects - string originalMatterName = EditMatterHelperFunctions.GetMatterName(clientContext, matter.Name); - listItemId = Lists.RetrieveItemId(clientContext, ServiceConstantStrings.MatterLandingPageRepositoryName, originalMatterName); - List usersToRemove = EditMatterHelperFunctions.RetrieveMatterUsers(userPermissionOnLibrary); - // Provide logged in user as full control on matter - // Check whether logged in user has full permission on new permission changes - hasFullPermission = EditMatterHelperFunctions.CheckFullPermissionInAssignList(matter.AssignUserEmails, matter.Permissions, loggedInUserName); - EditMatterHelperFunctions.AssignRemoveFullControl(clientContext, matter, loggedInUserName, listItemId, listExists, true, hasFullPermission); - if (listExists.Contains(matter.Name)) - { - result = EditMatterHelperFunctions.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name, -1, isEditMode); - } - if (listExists.Contains(matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix)) - { - result = EditMatterHelperFunctions.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix, -1, isEditMode); - } - if (listExists.Contains(matter.Name + ServiceConstantStrings.CalendarNameSuffix)) - { - result = EditMatterHelperFunctions.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + ServiceConstantStrings.CalendarNameSuffix, -1, isEditMode); - } - if (listExists.Contains(matter.Name + ServiceConstantStrings.TaskNameSuffix)) - { - result = EditMatterHelperFunctions.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + ServiceConstantStrings.TaskNameSuffix, -1, isEditMode); - } - result = EditMatterHelperFunctions.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, true, ServiceConstantStrings.MatterLandingPageRepositoryName, listItemId, isEditMode); - // Update matter metadata - result = EditMatterHelperFunctions.UpdateMatterStampedProperties(clientContext, matterDetails, matter, matterStampedProperties, isEditMode); - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectInputSelfPermissionRemoval, ServiceConstantStrings.ErrorEditMatterMandatoryPermission); - } - } - } - else - { - result = editMatterValidation; - } - } - catch (Exception exception) - { - MatterRevertList matterRevertListObject = new MatterRevertList() - { - MatterLibrary = matter.Name, - MatterOneNoteLibrary = matter.Name + ServiceConstantStrings.OneNoteLibrarySuffix, - MatterCalendar = matter.Name + ServiceConstantStrings.CalendarNameSuffix, - MatterTask = matter.Name + ServiceConstantStrings.TaskNameSuffix, - MatterSitePages = ServiceConstantStrings.MatterLandingPageRepositoryName - }; - EditMatterHelperFunctions.RevertMatterUpdates(requestObject, client, matter, clientContext, matterRevertListObject, loggedInUserName, userPermissionOnLibrary, listItemId, isEditMode); - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - finally - { - // Remove full control for logged in users - EditMatterHelperFunctions.AssignRemoveFullControl(clientContext, matter, loggedInUserName, listItemId, listExists, false, hasFullPermission); - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - - /// - /// Checks if security group exists in team members list in case conflict are identified. - /// - /// Request object - /// Client object - /// Matter object - /// Validation result - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string CheckSecurityGroupExists(RequestObject requestObject, Client client, Matter matter, IList userId) - { - string result = ConstantStrings.TRUE; - if (null != requestObject && null != client && null != matter && (null != requestObject.RefreshToken || null != requestObject.SPAppToken || null != client.Url) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - if (0 == matter.AssignUserEmails.Count()) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserNamesCode, TextConstants.IncorrectInputUserNamesMessage); - } - else - { - result = EditMatterHelperFunctions.ValidateTeamMembers(clientContext, matter, userId); - } - if (string.IsNullOrEmpty(result)) - { - result = ConstantStrings.TRUE; - if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.Identified)) - { - if (0 == matter.AssignUserEmails.Count()) - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserNamesCode, TextConstants.IncorrectInputUserNamesMessage); - } - else - { - if (Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)) - { - result = EditMatterHelperFunctions.CheckSecurityGroupInTeamMembers(clientContext, matter, userId); - } - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputConflictIdentifiedCode, TextConstants.IncorrectInputConflictIdentifiedMessage); - } - } - else - { - return result; - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - #endregion - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj deleted file mode 100644 index 96675d60..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj +++ /dev/null @@ -1,288 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {7CD80126-EBC1-48CE-A0B1-4B15C42C0A4C} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Microsoft.Legal.MatterCenter.ProviderService - Microsoft.Legal.MatterCenter.ProviderService - v4.5 - true - 9796 - enabled - disabled - false - True - SAK - SAK - SAK - SAK - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - true - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - true - false - - - - ..\packages\AntiXSS.4.3.0\lib\net40\AntiXssLibrary.dll - - - ..\External\DocumentFormat.OpenXml.dll - True - - - ..\packages\AntiXSS.4.3.0\lib\net40\HtmlSanitizationLibrary.dll - - - True - - - ..\External\Microsoft.Exchange.WebServices.dll - True - - - True - - - True - - - ..\External\Microsoft.SharePoint.Client.dll - True - - - ..\External\Microsoft.SharePoint.Client.Runtime.dll - True - - - ..\External\Microsoft.SharePoint.Client.Search.dll - True - - - ..\External\Microsoft.SharePoint.Client.Taxonomy.dll - True - - - ..\External\Microsoft.SharePoint.Client.UserProfiles.dll - True - - - False - ..\External\Microsoft.WindowsAzure.ServiceRuntime.dll - True - - - False - ..\External\Microsoft.WindowsAzure.Storage.dll - True - - - ..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - - - - - - Designer - - - - - - - - - - False - - - - - - - - - - - - - True - True - Constants.resx - - - - - - LegalBriefcase.svc - - - Search.svc - - - - MatterProvision.svc - - - - - - - - - - Web.config - - - Web.config - - - - - ResXFileCodeGenerator - Constants.Designer.cs - Designer - - - - - {04b6e5ba-de44-4e40-9496-ee12f658de67} - Microsoft.Legal.MatterCenter.Entity - - - {c1760739-9eb8-4f21-bb8d-14e6eacc7ce1} - Microsoft.Legal.MatterCenter.DataLayer - - - {8232f5f2-a0f9-4608-b7f3-22a321eca1b0} - Microsoft.Legal.MatterCenter.Utility - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - - - LCADMSKey.snk - - - - - - - - - False - True - 9796 - / - http://localhost:9799/ - False - False - - - False - - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj.vspscc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj.vspscc deleted file mode 100644 index b6d32892..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Microsoft.Legal.MatterCenter.ProviderService.csproj.vspscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/AssemblyInfo.cs deleted file mode 100644 index d8d24aeb..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,51 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-rijadh -// Created : 05-16-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains assembly information for current project. -// *********************************************************************** - -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.ProviderService")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.ProviderService")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("39c02b8a-ef24-42a5-af5b-23bd33579a33")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/PS.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/PS.pubxml deleted file mode 100644 index badb1a06..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/PS.pubxml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - FileSystem - Release - Any CPU - - True - False - D:\Projects\Matter Center\Main\Microsoft.Legal.MatterCenter\Deployment\Service Publish - True - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/matteruatservice.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/matteruatservice.pubxml deleted file mode 100644 index 3533c919..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/matteruatservice.pubxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MSDeploy - Release - Any CPU - http://matteruatservice.azurewebsites.net - True - False - matteruatservice.scm.azurewebsites.net:443 - matteruatservice - - False - WMSVC - True - $matteruatservice - <_SavePWD>True - <_DestinationType>AzureWebSite - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/sunnyservice.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/sunnyservice.pubxml deleted file mode 100644 index 62b4a13b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Properties/PublishProfiles/sunnyservice.pubxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MSDeploy - Release - Any CPU - http://sunnyservice.azurewebsites.net - True - False - sunnyservice.scm.azurewebsites.net:443 - sunnyservice - - True - WMSVC - False - $sunnyservice - <_SavePWD>True - <_DestinationType>AzureWebSite - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc deleted file mode 100644 index c2d07fd3..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc +++ /dev/null @@ -1 +0,0 @@ -<%@ ServiceHost Language="C#" Debug="true" Service="Microsoft.Legal.MatterCenter.ProviderService.Search" CodeBehind="Search.svc.cs" %> diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc.cs deleted file mode 100644 index a9b400e2..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Search.svc.cs +++ /dev/null @@ -1,686 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.ProviderService -// Author : v-akdigh -// Created : 03-06-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines service for Search(Find matter/Find document) App. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.ProviderService -{ - #region using - using Microsoft.Legal.MatterCenter.DataLayer; - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.ProviderService.HelperClasses; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.Security.Application; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.Search.Query; - using Newtonsoft.Json; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Reflection; - using System.ServiceModel; - using System.ServiceModel.Activation; - using System.ServiceModel.Web; - using System.Web; - #endregion - - /// - /// Holds the operation contracts used for searching matters and documents. - /// - [ServiceContract(Namespace = "")] - [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] - public class Search - { - #region Operation Contracts - /// - /// Gets the matters based on search criteria. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Search object containing Search, Filter and Sort data - /// Serialized string of Matter JSON object - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string FindMatter(RequestObject requestObject, Client client, SearchObject searchObject) - { - string result = string.Empty; - if (null != requestObject && null != client & null != searchObject && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - // Encode all fields which are coming from js - SearchHelperFunctions.EncodeSearchDetails(searchObject.Filters, true); - // Encode Search Term - searchObject.SearchTerm = (null != searchObject.SearchTerm) ? Encoder.HtmlEncode(searchObject.SearchTerm).Replace(ConstantStrings.ENCODEDDOUBLEQUOTES, ConstantStrings.DoubleQuote) : string.Empty; - - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - KeywordQuery keywordQuery = new KeywordQuery(clientContext); - if (string.IsNullOrWhiteSpace(searchObject.SearchTerm)) - { - searchObject.SearchTerm = ConstantStrings.Asterisk; - } - - if (null != searchObject.Filters) - { - if (1 == searchObject.Filters.FilterByMe) - { - ////Get logged in user alias - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - string userTitle = currentUserDetail.Name; - searchObject.SearchTerm = string.Concat(searchObject.SearchTerm, ConstantStrings.Space, ConstantStrings.OperatorAnd, ConstantStrings.Space, ConstantStrings.OpeningBracket, SearchConstants.ManagedPropertyResponsibleAttorney, ConstantStrings.COLON, ConstantStrings.Space, ConstantStrings.DoubleQuote, userTitle, ConstantStrings.DoubleQuote, ConstantStrings.Space, ConstantStrings.OperatorOR, ConstantStrings.Space, SearchConstants.ManagedPropertyTeamMembers, ConstantStrings.COLON, ConstantStrings.Space, ConstantStrings.DoubleQuote, userTitle, ConstantStrings.DoubleQuote, ConstantStrings.Space, ConstantStrings.ClosingBracket); - } - - keywordQuery = SearchHelperFunctions.FilterMatters(searchObject, keywordQuery); - } - - keywordQuery = SearchHelperFunctions.KeywordQueryMetrics(client, searchObject, keywordQuery, ConstantStrings.DocumentLibraryFilterCondition, SearchConstants.ManagedPropertyIsMatter, true); - - // Create a list of managed properties which are required to be present in search results - List managedProperties = new List(); - managedProperties.Add(SearchConstants.ManagedPropertyTitle); - managedProperties.Add(SearchConstants.ManagedPropertyName); - managedProperties.Add(SearchConstants.ManagedPropertyDescription); - managedProperties.Add(SearchConstants.ManagedPropertySiteName); - managedProperties.Add(SearchConstants.ManagedPropertyLastModifiedTime); - managedProperties.Add(SearchConstants.ManagedPropertyPracticeGroup); - managedProperties.Add(SearchConstants.ManagedPropertyAreaOfLaw); - managedProperties.Add(SearchConstants.ManagedPropertySubAreaOfLaw); - managedProperties.Add(SearchConstants.ManagedPropertyMatterId); - managedProperties.Add(SearchConstants.ManagedPropertyCustomTitle); - managedProperties.Add(SearchConstants.ManagedPropertyPath); - managedProperties.Add(SearchConstants.ManagedPropertyMatterName); - managedProperties.Add(SearchConstants.ManagedPropertyOpenDate); - managedProperties.Add(SearchConstants.ManagedPropertyClientName); - managedProperties.Add(SearchConstants.ManagedPropertyBlockedUploadUsers); - managedProperties.Add(SearchConstants.ManagedPropertyResponsibleAttorney); - managedProperties.Add(SearchConstants.ManagedPropertyClientID); - managedProperties.Add(SearchConstants.ManagedPropertyMatterGuid); - - //Filter on Result source to fetch only Matter Center specific results - keywordQuery.SourceId = new Guid(SearchConstants.SearchResultSourceID); - - keywordQuery = SearchHelperFunctions.AssignKeywordQueryValues(keywordQuery, managedProperties); - - keywordQuery.BypassResultTypes = true; - - result = SearchHelperFunctions.FillResultData(clientContext, keywordQuery, searchObject, true, managedProperties); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - return result; - } - - /// - /// Gets the folder hierarchy of the specified matter. - /// - /// Request object containing SharePoint App Token - /// Matter object containing Matter data - /// Serialized string of folder hierarchy JSON object - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetFolderHierarchy(RequestObject requestObject, MatterData matterData) - { - string result = string.Empty; - if (null != requestObject && null != matterData && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - if (!string.IsNullOrWhiteSpace(matterData.MatterName) && !string.IsNullOrWhiteSpace(matterData.MatterUrl)) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(matterData.MatterUrl), requestObject.RefreshToken)) - { - List list = clientContext.Web.Lists.GetByTitle(matterData.MatterName); - clientContext.Load(list.RootFolder); - ListItemCollection listItems = Lists.GetData(clientContext, matterData.MatterName, string.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.AllFoldersQuery, matterData.MatterName)); - List allFolders = new List(); - allFolders = SearchHelperFunctions.GetFolderAssignment(list, listItems, allFolders); - - result = JsonConvert.SerializeObject(allFolders); - } - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, 0, TextConstants.MessageNoInputs); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Gets user specific pinned matters. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// JSON structure with the meta-data of pinned matter for requested user - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string FindUserPinnedMatter(RequestObject requestObject, Client client) - { - string result = string.Empty; - if (null != requestObject && null != client && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - result = SearchHelperFunctions.ShowPinData(requestObject, client, ServiceConstantStrings.UserPinnedMatterListName, ServiceConstantStrings.PinnedListColumnMatterDetails, false); - // Decode pinned documents - result = HttpUtility.HtmlDecode(result); - } - else - { - result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, string.Empty, TextConstants.MessageNoInputs); - } - - return result; - } - - /// - /// Adds matter in user pinned details. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string PinMatterForUser(RequestObject requestObject, Client client, MatterData matterData) - { - string status = string.Empty; - if (null != requestObject && null != client && null != matterData && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ////Create matter object and populate meta-data - MatterData userPinnedMatterData = new MatterData() - { - MatterName = SearchHelperFunctions.EncodeValues(matterData.MatterName), - MatterDescription = SearchHelperFunctions.EncodeValues(matterData.MatterDescription), - MatterCreatedDate = SearchHelperFunctions.EncodeValues(matterData.MatterCreatedDate), - MatterUrl = SearchHelperFunctions.EncodeValues(matterData.MatterUrl), - MatterPracticeGroup = SearchHelperFunctions.EncodeValues(matterData.MatterPracticeGroup), - MatterAreaOfLaw = SearchHelperFunctions.EncodeValues(matterData.MatterAreaOfLaw), - MatterSubAreaOfLaw = SearchHelperFunctions.EncodeValues(matterData.MatterSubAreaOfLaw), - MatterClientUrl = SearchHelperFunctions.EncodeValues(matterData.MatterClientUrl), - MatterClient = SearchHelperFunctions.EncodeValues(matterData.MatterClient), - MatterClientId = SearchHelperFunctions.EncodeValues(matterData.MatterClientId), - HideUpload = SearchHelperFunctions.EncodeValues(matterData.HideUpload), - MatterID = SearchHelperFunctions.EncodeValues(matterData.MatterID), - MatterResponsibleAttorney = SearchHelperFunctions.EncodeValues(matterData.MatterResponsibleAttorney), - MatterModifiedDate = SearchHelperFunctions.EncodeValues(matterData.MatterModifiedDate), - MatterGuid = SearchHelperFunctions.EncodeValues(matterData.MatterGuid) - }; - status = SearchHelperFunctions.PopulateMetadeta(requestObject, client, userPinnedMatterData, null); - } - else - { - status = TextConstants.MessageNoInputs; - } - return status; - } - - /// - /// Removes pinned matter from user pinned details. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Matter object containing Matter data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string RemovePinnedMatter(RequestObject requestObject, Client client, MatterData matterData) - { - - string status = string.Empty; - if (null != requestObject && null != client && null != matterData && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - status = SearchHelperFunctions.UnpinItem(requestObject, client, matterData, null); - } - else - { - status = TextConstants.MessageNoInputs; - } - return status; - } - - /// - /// Gets the documents based on search criteria. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Search object containing Search, Filter and Sort data - /// Serialized string of Document JSON object - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string FindDocument(RequestObject requestObject, Client client, SearchObject searchObject) - { - string result = string.Empty; - if (null != requestObject && null != client & null != searchObject && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - // Encode all fields which are coming from js - SearchHelperFunctions.EncodeSearchDetails(searchObject.Filters, false); - // Encode Search Term - searchObject.SearchTerm = (null != searchObject.SearchTerm) ? Encoder.HtmlEncode(searchObject.SearchTerm).Replace(ConstantStrings.ENCODEDDOUBLEQUOTES, ConstantStrings.DoubleQuote) : string.Empty; - - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - KeywordQuery keywordQuery = new KeywordQuery(clientContext); - if (string.IsNullOrWhiteSpace(searchObject.SearchTerm)) - { - searchObject.SearchTerm = ConstantStrings.Asterisk; - } - - if (null != searchObject.Filters) - { - if (1 == searchObject.Filters.FilterByMe) - { - // Get the current logged in User - clientContext.Load(clientContext.Web.CurrentUser); - clientContext.ExecuteQuery(); - string currentLoggedInUser = clientContext.Web.CurrentUser.Title; - searchObject.SearchTerm = String.Concat(searchObject.SearchTerm, ConstantStrings.Space, ConstantStrings.OperatorAnd, ConstantStrings.Space, SearchConstants.ManagedPropertyAuthor, ConstantStrings.COLON, currentLoggedInUser); - } - keywordQuery = SearchHelperFunctions.FilterDocuments(searchObject, keywordQuery); - } - - keywordQuery = SearchHelperFunctions.KeywordQueryMetrics(client, searchObject, keywordQuery, ConstantStrings.DocumentItemFilterCondition, SearchConstants.ManagedPropertyIsDocument, false); - - //// Create a list of managed properties which are required to be present in search results - List managedProperties = new List(); - managedProperties.Add(SearchConstants.ManagedPropertyFileName); - managedProperties.Add(SearchConstants.ManagedPropertyTitle); - managedProperties.Add(SearchConstants.ManagedPropertyCreated); - managedProperties.Add(SearchConstants.ManagedPropertyUIVersionStringOWSTEXT); - managedProperties.Add(SearchConstants.ManagedPropertyServerRelativeUrl); - managedProperties.Add(SearchConstants.ManagedPropertyFileExtension); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentMatterId); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentLastModifiedTime); - managedProperties.Add(SearchConstants.ManagedPropertySiteTitle); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentClientId); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentClientName); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentMatterName); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentId); - managedProperties.Add(SearchConstants.ManagedPropertyCheckOutByUser); - managedProperties.Add(SearchConstants.ManagedPropertySiteName); - managedProperties.Add(SearchConstants.ManagedPropertySPWebUrl); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentVersion); - managedProperties.Add(SearchConstants.ManagedPropertyDocumentCheckOutUser); - managedProperties.Add(SearchConstants.ManagedPropertySPWebUrl); - managedProperties.Add(SearchConstants.ManagedPropertyAuthor); - - //Filter on Result source to fetch only Matter Center specific results - keywordQuery.SourceId = new Guid(SearchConstants.SearchResultSourceID); - - keywordQuery = SearchHelperFunctions.AssignKeywordQueryValues(keywordQuery, managedProperties); - - result = SearchHelperFunctions.FillResultData(clientContext, keywordQuery, searchObject, false, managedProperties); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Adds document in user pinned details. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Document object containing Document data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string PinDocumentForUser(RequestObject requestObject, Client client, DocumentData documentData) - { - string status = string.Empty; - if (null != requestObject && null != client && null != documentData && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ////Create document object and populate meta-data - DocumentData userPinnedDocumentData = new DocumentData() - { - DocumentName = SearchHelperFunctions.EncodeValues(documentData.DocumentName), - DocumentVersion = SearchHelperFunctions.EncodeValues(documentData.DocumentVersion), - DocumentClient = SearchHelperFunctions.EncodeValues(documentData.DocumentClient), - DocumentClientId = SearchHelperFunctions.EncodeValues(documentData.DocumentClientId), - DocumentClientUrl = SearchHelperFunctions.EncodeValues(documentData.DocumentClientUrl), - DocumentMatter = SearchHelperFunctions.EncodeValues(documentData.DocumentMatter), - DocumentMatterId = SearchHelperFunctions.EncodeValues(documentData.DocumentMatterId), - DocumentOwner = SearchHelperFunctions.EncodeValues(documentData.DocumentOwner), - DocumentUrl = SearchHelperFunctions.EncodeValues(documentData.DocumentUrl), - DocumentOWAUrl = SearchHelperFunctions.EncodeValues(documentData.DocumentOWAUrl), - DocumentExtension = SearchHelperFunctions.EncodeValues(documentData.DocumentExtension), - DocumentCreatedDate = SearchHelperFunctions.EncodeValues(documentData.DocumentCreatedDate), - DocumentModifiedDate = SearchHelperFunctions.EncodeValues(documentData.DocumentModifiedDate), - DocumentCheckoutUser = SearchHelperFunctions.EncodeValues(documentData.DocumentCheckoutUser), - DocumentMatterUrl = SearchHelperFunctions.EncodeValues(documentData.DocumentMatterUrl), - DocumentParentUrl = SearchHelperFunctions.EncodeValues(documentData.DocumentParentUrl), - DocumentID = SearchHelperFunctions.EncodeValues(documentData.DocumentID) - }; - status = SearchHelperFunctions.PopulateMetadeta(requestObject, client, null, userPinnedDocumentData); - } - else - { - status = TextConstants.MessageNoInputs; - } - return status; - } - - /// - /// Removes pinned document from user pinned details. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Document object containing Document data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string RemovePinnedDocument(RequestObject requestObject, Client client, DocumentData documentData) - { - string status = string.Empty; - if (null != requestObject && null != client && null != documentData && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - status = SearchHelperFunctions.UnpinItem(requestObject, client, null, documentData); - } - else - { - status = TextConstants.MessageNoInputs; - } - return status; - } - - /// - /// Gets user specific pinned documents. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// JSON structure with the meta-data of pinned document for requested user - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string FindUserPinnedDocument(RequestObject requestObject, Client client) - { - string result = string.Empty; - if (null != requestObject && null != client && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - result = SearchHelperFunctions.ShowPinData(requestObject, client, ServiceConstantStrings.UserPinnedDocumentListName, ServiceConstantStrings.PinnedListColumnDocumentDetails, true); - // Decode pinned documents - result = HttpUtility.HtmlDecode(result); - } - else - { - result = TextConstants.MessageNoInputs; - } - - return result; - } - - /// - /// Uploads mail to SharePoint library. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Service request object containing mail data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string UploadMail(RequestObject requestObject, Client client, ServiceRequest serviceRequest) - { - string message = string.Empty; - string result = "True"; - if (null != requestObject && null != client && null != serviceRequest && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - if (UploadHelperFunctions.Upload(requestObject, client, serviceRequest, ServiceConstantStrings.MailSoapRequest, serviceRequest.MailId, true, serviceRequest.Subject, serviceRequest.FolderPath[0], true, ref message, string.Empty).Equals(ConstantStrings.UploadFailed)) - { - if (!string.IsNullOrEmpty(message)) - { - result = message; - } - else - { - result = "False"; - } - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Uploads attachment to SharePoint library. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// Service request object containing mail data - /// Status of update - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string UploadAttachment(RequestObject requestObject, Client client, ServiceRequest serviceRequest) - { - string resultFlag = string.Empty; - if (null != requestObject && null != client && null != serviceRequest && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - ///// check if folder path and attachment length are same - if (serviceRequest.FolderPath.Count == serviceRequest.Attachments.Count) - { - bool result = true; - ///// StringBuilder builder = new StringBuilder(); - int attachmentCount = 0; - string message = string.Empty; - foreach (AttachmentDetails attachment in serviceRequest.Attachments) - { - if (UploadHelperFunctions.Upload(requestObject, client, serviceRequest, ServiceConstantStrings.AttachmentSoapRequest, attachment.id, false, attachment.name, serviceRequest.FolderPath[attachmentCount], true, ref message, attachment.originalName).Equals(ConstantStrings.UploadFailed)) - { - result = false; - break; - } - - attachmentCount++; - } - - if (result) - { - resultFlag = "True"; - } - else if (!string.IsNullOrEmpty(message)) - { - resultFlag = message; - } - else - { - resultFlag = "False"; - } - } - else - { - resultFlag = "False"; - } - } - else - { - resultFlag = TextConstants.MessageNoInputs; - } - return resultFlag; - } - - /// - /// Returns true or false based on the existence of the matter landing page and OneNote file at the URLs provided. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// String object containing the OneNote file path - /// String object containing the Matter Landing Page file path - /// $|$ Separated string indicating that the OneNote and the Matter Landing Page exist or not - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string UrlExists(RequestObject requestObject, Client client, string requestedUrl, string requestedPageUrl) - { - string result = string.Empty; - if (null != requestObject && null != client && null != requestedUrl && null != requestedPageUrl && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - // Check if the OneNote exists - string oneNoteExists = SearchHelperFunctions.PageExists(requestedUrl, clientContext); - // Check if the Matter Landing Page exists - string matterLandingExists = SearchHelperFunctions.PageExists(requestedPageUrl, clientContext); - // Finally return the result of the two operations - result = oneNoteExists + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + matterLandingExists; - } - } - catch (Exception exception) - { - // In case of a general exception, return false values for both cases - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - result = ConstantStrings.FALSE + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + ConstantStrings.FALSE; - } - } - else - { - result = TextConstants.MessageNoInputs; - } - return result; - } - - /// - /// Returns contextual help content in JSON format. - /// - /// Request object containing SharePoint App Token - /// Client object containing Client data - /// String object containing the page number where user is on - /// $|$ contextual help content in JSON format - [OperationContract] - [WebInvoke(RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string FetchContextualHelpContent(RequestObject requestObject, Client client, string selectedPage) - { - // Basic initialization - string result = string.Empty, cacheKey = string.Empty; - string selectedSectionIDs = string.Empty; - IList sectionID = new List(); - if (null != requestObject && null != client && null != selectedPage && !string.IsNullOrWhiteSpace(selectedPage) && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - List contextHelpCollection = new List(); - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - string[] pageNames = ServiceConstantStrings.MatterCenterPages.Split(';'); - switch (selectedPage) - { - case "1": selectedPage = pageNames[1]; - break; - case "2": selectedPage = pageNames[2]; - break; - case "4": selectedPage = pageNames[4]; - break; - default: selectedPage = pageNames[0]; - break; - } - - cacheKey = string.Concat(selectedPage, ConstantStrings.LINKS_STATIC_STRING); - result = ServiceUtility.GetOrSetCachedValue(cacheKey); - if (result.Equals(ConstantStrings.FALSE)) - { - - //Object to store all the list items retrieved from SharePoint list - ListItemCollection contextualHelpSectionListItems; - - // Get MatterCenterHelpSection list data - contextualHelpSectionListItems = Lists.GetData(clientContext, ServiceConstantStrings.MatterCenterHelpSectionListName, String.Format(CultureInfo.InvariantCulture, ServiceConstantStrings.RetrieveContextualHelpSectionsQuery, selectedPage)); - - //If these exists any content for contextual help flyout - if (null != contextualHelpSectionListItems && 0 < contextualHelpSectionListItems.Count) - { - SearchHelperFunctions.FetchContextualHelpContentUtility(ref result, ref selectedSectionIDs, sectionID, ref contextHelpCollection, clientContext, contextualHelpSectionListItems); - if (!ServiceUtility.CheckValueHasErrors(result)) - { - ServiceUtility.GetOrSetCachedValue(cacheKey, result); - } - } - } - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - return result; - } - - /// - /// Returns document and list GUID - /// - /// Request object containing SharePoint App Token - /// Client object containing list data - /// Document and list GUID - [OperationContract] - [WebInvoke( - RequestFormat = WebMessageFormat.Json, - ResponseFormat = WebMessageFormat.Json, Method = "*", BodyStyle = WebMessageBodyStyle.WrappedRequest)] - public string GetDocumentAssets(RequestObject requestObject, Client client) - { - string result = string.Empty; - if (null != requestObject && null != client && ValidationHelperFunctions.CheckRequestValidatorToken()) - { - try - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(requestObject.SPAppToken, new Uri(client.Url), requestObject.RefreshToken)) - { - result = SearchHelperFunctionsUtility.GetDocumentAndClientGUID(client, clientContext); - } - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); - } - } - return result; - } - } - #endregion -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Web.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Web.config deleted file mode 100644 index 38dbe7fb..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Web.config +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/packages.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/packages.config deleted file mode 100644 index 7d9458bb..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/.vs/config/applicationhost.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/.vs/config/applicationhost.config new file mode 100644 index 00000000..0fe18af2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/.vs/config/applicationhost.config @@ -0,0 +1,1002 @@ + + + + + + +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/EditFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/EditFunctions.cs new file mode 100644 index 00000000..91383c55 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/EditFunctions.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; + +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Business +{ + public class EditFunctions : IEditFunctions + { + private MatterSettings matterSettings; + private ErrorSettings errorSettings; + private ListNames listNames; + private CamlQueries camlQueries; + private ISPList spList; + private IMatterRepository matterRespository; + public EditFunctions(ISPList spList, IOptions matterSettings, + IOptions errorSettings, IMatterRepository matterRespository, + IOptions listNames, IOptions camlQueries) + { + this.matterSettings = matterSettings.Value; + this.spList = spList; + this.errorSettings = errorSettings.Value; + this.matterRespository = matterRespository; + this.listNames = listNames.Value; + this.camlQueries = camlQueries.Value; + } + + + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IEditFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IEditFunctions.cs new file mode 100644 index 00000000..6a7ea8ee --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IEditFunctions.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Business +{ + public interface IEditFunctions + { + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IValidationFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IValidationFunctions.cs new file mode 100644 index 00000000..d41d7780 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/IValidationFunctions.cs @@ -0,0 +1,13 @@ +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Business +{ + public interface IValidationFunctions + { + GenericResponseVM IsMatterValid(MatterInformationVM matterInformation, int methodNumber, MatterConfigurations matterConfigurations); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/ValidationFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/ValidationFunctions.cs new file mode 100644 index 00000000..0d68a077 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Matter/ValidationFunctions.cs @@ -0,0 +1,501 @@ +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; + +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Business +{ + public class ValidationFunctions : IValidationFunctions + { + private MatterSettings matterSettings; + private ErrorSettings errorSettings; + private ListNames listNames; + private CamlQueries camlQueries; + private ISPList spList; + private IMatterRepository matterRespository; + public ValidationFunctions(ISPList spList, IOptions matterSettings, + IOptions errorSettings, IMatterRepository matterRespository, + IOptions listNames, IOptions camlQueries) + { + this.matterSettings = matterSettings.Value; + this.spList = spList; + this.errorSettings = errorSettings.Value; + this.matterRespository = matterRespository; + this.listNames = listNames.Value; + this.camlQueries = camlQueries.Value; + } + + /// + /// Checks if the lists exist + /// + /// + /// + /// + /// + private bool CheckListExists(Client client, string matterName, MatterConfigurations matterConfigurations = null) + { + List lists = new List(); + lists.Add(matterName); + lists.Add(matterName + matterSettings.OneNoteLibrarySuffix); + if (null == matterConfigurations || matterConfigurations.IsCalendarSelected) + { + lists.Add(matterName + matterSettings.CalendarNameSuffix); + } + if (null == matterConfigurations || matterConfigurations.IsTaskSelected) + { + lists.Add(matterName + matterSettings.TaskNameSuffix); + } + bool listExists = spList.Exists(client, new ReadOnlyCollection(lists)); + return listExists; + } + + public GenericResponseVM IsMatterValid(MatterInformationVM matterInformation, int methodNumber, MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponse = null; + var matterDetails = matterInformation.MatterDetails; + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) <= methodNumber && + int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) >= methodNumber && + !spList.CheckPermissionOnList(matterSettings.ProvisionMatterAppURL, matterSettings.SendMailListName, PermissionKind.EditListItems)) + { + genericResponse = new GenericResponseVM(); + //return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectInputUserAccessCode, ServiceConstantStrings.IncorrectInputUserAccessMessage); + genericResponse.Code = errorSettings.IncorrectInputUserAccessCode; + genericResponse.Value = errorSettings.IncorrectInputUserAccessMessage; + } + else + { + + if (matterInformation.Client!=null) + { + genericResponse = new GenericResponseVM(); + genericResponse = ValidateClientInformation(matterInformation.Client, methodNumber); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (matterInformation.Matter!=null) + { + genericResponse = MatterMetadataValidation(matterInformation.Matter, matterInformation.Client, + methodNumber, matterConfigurations); + if (genericResponse!=null) + { + return genericResponse; + } + if (int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) + { + genericResponse = RoleCheck(matterInformation.Matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (matterInformation.Matter.Permissions!=null) + { + bool isFullControlPresent = ValidateFullControlPermission(matterInformation.Matter); + if (!isFullControlPresent) + { + return GenericResponse(errorSettings.IncorrectInputUserAccessCode, errorSettings.ErrorEditMatterMandatoryPermission); + } + } + } + if (null != matterDetails && !(int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber)) + { + if (string.IsNullOrWhiteSpace(matterDetails.PracticeGroup)) + { + return GenericResponse(errorSettings.IncorrectInputPracticeGroupCode, errorSettings.IncorrectInputPracticeGroupMessage); + } + if (string.IsNullOrWhiteSpace(matterDetails.AreaOfLaw)) + { + + return GenericResponse(errorSettings.IncorrectInputAreaOfLawCode, errorSettings.IncorrectInputAreaOfLawMessage); + } + if (string.IsNullOrWhiteSpace(matterDetails.SubareaOfLaw)) + { + return GenericResponse(errorSettings.IncorrectInputSubareaOfLawCode, errorSettings.IncorrectInputSubareaOfLawMessage); + } + try + { + if (string.IsNullOrWhiteSpace(matterDetails.ResponsibleAttorney)) + { + return GenericResponse(errorSettings.IncorrectInputResponsibleAttorneyCode, errorSettings.IncorrectInputResponsibleAttorneyMessage); + } + else + { + IList userNames = matterDetails.ResponsibleAttorney.Split(';').ToList(); + matterRespository.ResolveUserNames(matterInformation.Client, userNames).FirstOrDefault(); + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputResponsibleAttorneyCode, errorSettings.IncorrectInputResponsibleAttorneyMessage); + } + } + } + return genericResponse; + } + + + /// + /// Validates the roles for the matter and returns the validation status. + /// + /// Request Object containing SharePoint App Token + /// Matter object containing Matter data + /// Client Object + /// A string value indicating whether validations passed or fail + internal GenericResponseVM RoleCheck(Matter matter) + { + GenericResponseVM genericResponse = null; + try + { + + if ( matter.Roles.Count()<=0) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + IList roles = matterRespository.RoleCheck(matterSettings.CentralRepositoryUrl, listNames.DMSRoleListName, + camlQueries.DMSRoleQuery); + if (matter.Roles.Except(roles).Count() > 0) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + return genericResponse; + } + catch (Exception exception) + { + //ToDo: Why in role check function, we are deleting the matter + //ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); + //returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); + throw; + } + + + } + + /// + /// Function to validate client information + /// + /// Client object + /// Number indicating which method needs to be validated + /// String that contains error message + internal GenericResponseVM ValidateClientInformation(Client client, int methodNumber) + { + GenericResponseVM response = new GenericResponseVM(); + if (string.IsNullOrWhiteSpace(client.Url)) + { + response.Code = errorSettings.IncorrectInputClientUrlCode; + response.Value = errorSettings.IncorrectInputClientUrlMessage; + } + else if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) + { + if (string.IsNullOrWhiteSpace(client.Id)) + { + + response.Code = errorSettings.IncorrectInputClientIdCode; + response.Value = errorSettings.IncorrectInputClientIdMessage; + } + else if (string.IsNullOrWhiteSpace(client.Name)) + { + response.Code = errorSettings.IncorrectInputClientNameCode; + response.Value = errorSettings.IncorrectInputClientNameMessage; + } + } + return response; + } + + /// + /// Validates meta-data of a matter and returns the validation status (success/failure). + /// + /// Matter object containing Matter data + /// Client context object for SharePoint + /// Number indicating which method needs to be validated + /// A string value indicating whether validations passed or fail + internal GenericResponseVM MatterMetadataValidation(Matter matter, Client client, + int methodNumber, MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponseVM = null; + genericResponseVM = MatterNameValidation(matter); + if (genericResponseVM!=null) + { + return genericResponseVM; + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) + { + if (string.IsNullOrWhiteSpace(matter.Id)) + { + return GenericResponse(errorSettings.IncorrectInputMatterIdCode, errorSettings.IncorrectInputMatterIdMessage); + } + else + { + var matterId = Regex.Match(matter.Id, matterSettings.SpecialCharacterExpressionMatterId, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterIdLength, CultureInfo.InvariantCulture) < matter.Id.Length || !matterId.Success) + { + return GenericResponse(errorSettings.IncorrectInputMatterIdCode, errorSettings.IncorrectInputMatterIdMessage); + } + } + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber) + { + genericResponseVM = MatterDetailsValidation(matter, client, methodNumber, matterConfigurations); + if (genericResponseVM!=null) + { + return genericResponseVM; + } + } + try + { + if (!(int.Parse(ServiceConstants.ProvisionMatterCheckMatterExists, CultureInfo.InvariantCulture) == methodNumber) && + !(int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber)) + { + if (0 >= matter.AssignUserNames.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserNamesCode, errorSettings.IncorrectInputUserNamesMessage); + } + else + { + IList userList = matter.AssignUserNames.SelectMany(x => x).Distinct().ToList(); + //ToDo: Need to know the use of this method + matterRespository.ResolveUserNames(client, userList).FirstOrDefault(); + } + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputUserNamesCode, errorSettings.IncorrectInputUserNamesMessage); + } + + if (int.Parse(ServiceConstants.ProvisionMatterAssignUserPermissions, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) + { + GenericResponseVM genericResponse = CheckUserPermission(matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber) + { + GenericResponseVM genericResponse = ValidateContentType(matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + return genericResponseVM; + } + + /// + /// Validates the matter name. + /// + /// Matter details + /// Matter details validation result + private GenericResponseVM MatterNameValidation(Matter matter) + { + GenericResponseVM genericResponseVM = null; + string matterNameValidation = string.Empty; + if (string.IsNullOrWhiteSpace(matter.Name)) + { + return GenericResponse(errorSettings.IncorrectInputMatterNameCode, errorSettings.IncorrectInputMatterNameMessage); + } + var matterName = Regex.Match(matter.Name, matterSettings.SpecialCharacterExpressionMatterTitle, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterNameLength, CultureInfo.InvariantCulture) < matter.Name.Length || matter.Name.Length != matterName.Length) + { + + return GenericResponse(errorSettings.IncorrectInputMatterNameCode, errorSettings.IncorrectInputMatterNameMessage); + } + return genericResponseVM; + } + + /// + /// Validates details of a matter and returns the validation status. + /// + /// Matter object containing Matter data + /// Client context object for SharePoint + /// Number indicating which method needs to be validated + /// A string value indicating whether validations passed or fail + internal GenericResponseVM MatterDetailsValidation(Matter matter, Client client, int methodNumber, + MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponseVM = null; + if (matterConfigurations.IsMatterDescriptionMandatory) + { + if (string.IsNullOrWhiteSpace(matter.Description)) + { + return GenericResponse(errorSettings.IncorrectInputMatterDescriptionCode, errorSettings.IncorrectInputMatterDescriptionMessage); + } + else + { + var matterDescription = Regex.Match(matter.Description, matterSettings.SpecialCharacterExpressionMatterDescription, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterDescriptionLength, CultureInfo.InvariantCulture) < matter.Description.Length || !matterDescription.Success) + { + return GenericResponse(errorSettings.IncorrectInputMatterDescriptionCode, errorSettings.IncorrectInputMatterDescriptionMessage); + } + } + } + if (matterConfigurations.IsConflictCheck) + { + DateTime conflictCheckedOnDate; + bool isValidDate = DateTime.TryParse(matter.Conflict.CheckOn, out conflictCheckedOnDate); + if (!isValidDate || 0 > DateTime.Compare(DateTime.Now, conflictCheckedOnDate)) + { + return GenericResponse(errorSettings.IncorrectInputConflictDateCode, errorSettings.IncorrectInputConflictDateMessage); + } + if (string.IsNullOrWhiteSpace(matter.Conflict.Identified)) + { + return GenericResponse(errorSettings.IncorrectInputConflictIdentifiedCode, errorSettings.IncorrectInputConflictIdentifiedMessage); + } + else + { + try + { + if (0 > string.Compare(ServiceConstants.FALSE, matter.Conflict.Identified, StringComparison.OrdinalIgnoreCase)) + { + if (0 >= matter.BlockUserNames.Count()) + { + return GenericResponse(errorSettings.IncorrectInputBlockUserNamesCode, errorSettings.IncorrectInputBlockUserNamesMessage); + } + else + { + //ToDo: Need to understand the need of this method + matterRespository.ResolveUserNames(client, matter.BlockUserNames).FirstOrDefault(); + } + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputBlockUserNamesCode, errorSettings.IncorrectInputBlockUserNamesMessage); + } + + } + if (string.IsNullOrWhiteSpace(matter.Conflict.CheckBy)) + { + return GenericResponse(errorSettings.IncorrectInputConflictCheckByCode, errorSettings.IncorrectInputConflictCheckByMessage); + } + else + { + try + { + //ToDo: Need to understand the need of this method + matterRespository.ResolveUserNames(client, new List() { matter.Conflict.CheckBy }).FirstOrDefault(); + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputConflictCheckByCode, errorSettings.IncorrectInputConflictCheckByMessage); + } + } + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber && 0 >= matter.Roles.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + return genericResponseVM; + } + + + private GenericResponseVM GenericResponse(string code, string value) + { + GenericResponseVM genericResponseVM = new GenericResponseVM(); + genericResponseVM.Code = errorSettings.IncorrectInputUserRolesCode; + genericResponseVM.Value = errorSettings.IncorrectInputUserRolesMessage; + return genericResponseVM; + } + + /// + /// Validates the permissions assigned to the users. + /// + /// Matter object containing Matter data + /// A string value indicating whether validations passed or fail + private GenericResponseVM CheckUserPermission(Matter matter) + { + if (0 >= matter.Permissions.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserPermissionsCode, errorSettings.IncorrectInputUserPermissionsMessage); + } + else + { + string userAllowedPermissions = matterSettings.UserPermissions; + if (!string.IsNullOrEmpty(userAllowedPermissions)) + { + List userPermissions = userAllowedPermissions.ToUpperInvariant().Trim().Split(new string[] { "," }, + StringSplitOptions.RemoveEmptyEntries).ToList(); + foreach (string Permissions in matter.Permissions) + { + if (!userPermissions.Contains(Permissions.Trim().ToUpperInvariant())) + { + return GenericResponse(errorSettings.IncorrectInputUserPermissionsCode, errorSettings.IncorrectInputUserPermissionsMessage); + } + } + } + } + return null; + } + + + /// + /// Validates content type for the matter. + /// + /// Matter object containing Matter data + /// A string value indicating whether validations passed or fail + private GenericResponseVM ValidateContentType(Matter matter) + { + if ((0 >= matter.ContentTypes.Count()) || string.IsNullOrWhiteSpace(matter.DefaultContentType)) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + else + { + foreach (string contentType in matter.ContentTypes) + { + var contentTypeCheck = Regex.Match(contentType, matterSettings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); + if (contentTypeCheck.Success || int.Parse(matterSettings.ContentTypeLength, CultureInfo.InvariantCulture) < contentType.Length) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + } + var defaultContentTypeCheck = Regex.Match(matter.DefaultContentType, matterSettings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); + if (defaultContentTypeCheck.Success || + int.Parse(matterSettings.ContentTypeLength, CultureInfo.InvariantCulture) < matter.DefaultContentType.Length) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + } + return null; + } + + /// + /// Validates if there is at-least one user with full control in assign list. + /// + /// Matter object + /// Status of Full Control permission + private bool ValidateFullControlPermission(Matter matter) + { + + bool hasFullConrol = false; + if (null != matter && null != matter.Permissions && 0 != matter.Permissions.Count) + { + hasFullConrol = matter.Permissions.Contains(matterSettings.EditMatterAllowedPermissionLevel); + } + return hasFullConrol; + } + + + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Microsoft.Legal.MatterCenter.Business.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Microsoft.Legal.MatterCenter.Business.xproj new file mode 100644 index 00000000..afa9b49b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Microsoft.Legal.MatterCenter.Business.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + dc93fb04-a01f-42e4-81c2-1c87cbfeda60 + Microsoft.Legal.MatterCenter.Business + ..\artifacts\obj\$(MSBuildProjectName) + ..\artifacts\bin\$(MSBuildProjectName)\ + + + + 2.0 + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..2a099d9d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Business")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Business")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dc93fb04-a01f-42e4-81c2-1c87cbfeda60")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/project.json new file mode 100644 index 00000000..0bfa8519 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Business/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + "description": "Microsoft.Legal.MatterCenter.Business Class Library", + "authors": [ "v-lapedd" ], + "tags": [ "" ], + "projectUrl": "", + "licenseUrl": "", + "dependencies": { + "Microsoft.CSharp": "4.0.1-beta-23516", + "Microsoft.Legal.MatterCenter.Models": "1.0.0-*", + "Microsoft.Legal.MatterCenter.Repository": "1.0.0-*", + "Microsoft.Legal.MatterCenter.Utility": "1.0.0-*", + "System.Collections": "4.0.11-beta-23516", + "System.Linq": "4.0.1-beta-23516", + "System.Runtime": "4.0.21-beta-23516", + "System.Threading": "4.0.11-beta-23516" + }, + "frameworks": { + "dnx451": { } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentDetails.cs new file mode 100644 index 00000000..79d50574 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentDetails.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure for mail attachment details. It includes MIME type, content type, attachment name, and size. + /// + public class AttachmentDetails + { + /// + /// Gets or sets the type of the attachment. + /// + /// The type of the attachment. + public string attachmentType + { + get; + set; + } + + /// + /// Gets or sets the type of the content. + /// + /// The type of the content. + public string contentType + { + get; + set; + } + + /// + /// Gets or sets the mail identifier. + /// + /// The identifier. + public string id + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether this instance is in-line. + /// + /// true if this instance is in-line; otherwise, false. + public bool isInline + { + get; + set; + } + + /// + /// Gets or sets the attachment name. + /// + /// The name. + public string name + { + get; + set; + } + + /// + /// Gets or sets the attachment size. + /// + /// The size. + public int size + { + get; + set; + } + + /// + /// Gets or sets the original name of attachment + /// + public string originalName + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentRequestVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentRequestVM.cs new file mode 100644 index 00000000..f377033f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/AttachmentRequestVM.cs @@ -0,0 +1,11 @@ + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class AttachmentRequestVM + { + public Client Client { get; set; } + public ServiceRequest ServiceRequest { get; set; } + public string RequestedUrl { get; set; } + public string RequestedPageUrl { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ContentCheckDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ContentCheckDetails.cs new file mode 100644 index 00000000..0730b30e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ContentCheckDetails.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for performing content check. + /// + public class ContentCheckDetails + { + /// + /// Gets or sets the name of the file for which content check needs to be performed + /// + public string FileName { get; set; } + + /// + /// Gets or sets the Subject field of the file for which content check needs to be performed. Applicable only for email + /// + public string Subject { get; set; } + + /// + /// Gets or sets the size of the file for which content check needs to be performed + /// + public long FileSize { get; set; } + + /// + /// Gets or sets the From field of the file for which content check needs to be performed. Applicable only for email + /// + public string FromField { get; set; } + + /// + /// Gets or sets the Sent date field of the file for which content check needs to be performed. Applicable only for email + /// + public string SentDate { get; set; } + + /// + /// Two-parameters constructor to initialize object for checking if document exists with the same file name and size + /// + /// Name of the file being uploaded + /// Size of the file being uploaded + public ContentCheckDetails(string fileName, long fileSize) + { + this.FileName = fileName; + this.Subject = string.Empty; + this.FileSize = fileSize; + this.FromField = string.Empty; + this.SentDate = string.Empty; + } + + /// + /// Four-parameters constructor to initialize object for checking if mail exists with the same file name, size, from field and sent date + /// + /// Name of the mail being uploaded + /// Size of the mail being uploaded + /// Value in the From field of the mail being uploaded + /// Sent date of the mail being uploaded + public ContentCheckDetails(string fileName, string subject, long fileSize, string fromField, string sentDate) + { + this.FileName = fileName; + this.Subject = subject; + this.FileSize = fileSize; + this.FromField = fromField; + this.SentDate = sentDate; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailMetaData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailMetaData.cs new file mode 100644 index 00000000..11b5d4cf --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailMetaData.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure to hold mail meta data + /// + public struct MailMetaData + { + /// + /// Gets or sets the user who receives the mail. + /// + /// Name of the user who receives the mail + public string mailReceiver { get; set; } + + /// + /// Gets or sets the user who sends the mail. + /// + /// Name of the user who sends the mail + public string mailSender { get; set; } + + /// + /// Gets or sets the mail received date. + /// + /// Mail received date + public string receivedDate { get; set; } + + /// + /// Gets or sets the user who are in CC. + /// + /// Name of the user who are in CC + public string cc { get; set; } + + /// + /// Gets or sets the attachment of the mail. + /// + /// Attachment of the mail + public string attachment { get; set; } + + /// + /// Gets or sets the importance of the mail. + /// + /// Importance of the mail + public string mailImportance { get; set; } + + /// + /// Gets or sets the subject of the mail. + /// + /// Subject of the mail + public string mailSubject { get; set; } + + /// + /// Gets or sets the categories of the mail + /// + /// Category of the mail + public string categories { get; set; } + + /// + /// Gets or sets the sensitivity of the mail + /// + /// Sensitivity of the mail + public string sensitivity { get; set; } + + /// + /// Gets or sets the conversation id of the mail + /// + /// Conversation id of the mail + public string conversationId { get; set; } + + /// + /// Gets or sets the conversation topic of the mail + /// + /// Conversation topic of the mail + public string conversationTopic { get; set; } + + /// + /// Gets or sets the sent date of the mail + /// + /// Sent date of the mail + public string sentDate { get; set; } + + /// + /// Gets or sets the 'Has attachments' of the mail + /// + /// 'Has attachments' of the mail + public string hasAttachments { get; set; } + + /// + /// Gets or sets the original name of the mail + /// + /// Original name of the mail + public string originalName { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailXPath.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailXPath.cs new file mode 100644 index 00000000..d9dad4bb --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/MailXPath.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for mail XML response + /// + public struct MailXPath + { + /// + /// Gets or sets the user who receives the mail. + /// + /// Name of the user who receives the mail + public string mailReceiver { get; set; } + + /// + /// Gets or sets the user who are in CC. + /// + /// Name of the user who are in CC + public string mailCC { get; set; } + + /// + /// Gets or sets the mail received date. + /// + /// Mail received date + public string mailRecieved { get; set; } + + /// + /// Gets or sets the user who sends the mail. + /// + /// Name of the user who sends the mail + public string mailFromName { get; set; } + + /// + /// Gets or sets the address of the mail. + /// + /// Address of the mail + public string mailFromAddress { get; set; } + + /// + /// Gets or sets the importance of the mail. + /// + /// Importance of the mail + public string mailImportance { get; set; } + + /// + /// Gets or sets the subject of the mail. + /// + /// Subject of the mail + public string mailSubject { get; set; } + + /// + /// Gets or sets the conversation id of the mail. + /// + /// Conversation id of the mail + public string mailConversationId { get; set; } + + /// + /// Gets or sets the sensitivity of the mail. + /// + /// Sensitivity of the mail + public string mailSensitivity { get; set; } + + /// + /// Gets or sets the conversation topic of the mail. + /// + /// Conversation topic of the mail + public string mailConversationTopic { get; set; } + + /// + /// Gets or sets the sent date of the mail. + /// + /// Sent date of the mail + public string mailSentDate { get; set; } + + /// + /// Gets or sets the 'Has attachments' of the mail. + /// + /// 'Has attachments' value of the mail + public string mailHasAttachments { get; set; } + + /// + /// Gets or sets the categories of the mail. + /// + /// Categories of the mail + public string mailCategories { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ServiceRequest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ServiceRequest.cs new file mode 100644 index 00000000..d20ea532 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Attachment/ServiceRequest.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure of mail/attachment mainly EWS URL, folder location, document library, and flag to overwrite. + /// + public class ServiceRequest + { + /// + /// Gets or sets the attachment token. + /// + /// The attachment token. + public string AttachmentToken + { + get; + set; + } + + /// + /// Gets or sets the Exchange Web Service URL. + /// + /// The EWS URL. + public Uri EwsUrl + { + get; + set; + } + + /// + /// Gets or sets the attachments. Represents the objects selected. + /// + /// The attachments. + public IList Attachments + { + get; + set; + } + + /// + /// Gets or sets the mail identifier. + /// + /// The mail identifier. + public string MailId + { + get; + set; + } + + /// + /// Gets or sets the folder path. Represents the folder path where item needs to be uploaded. + /// + /// The folder path. + public IList FolderPath + { + get; + set; + } + + /// + /// Gets or sets the mail subject. + /// + /// The subject. + public string Subject + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether this has overwrite option. + /// + /// true if overwrite; otherwise, false. + public bool Overwrite + { + get; + set; + } + + /// + /// Gets or sets document library name. + /// + /// Name of document Library + public string DocumentLibraryName + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether to perform content check or not. + /// + /// Name of document Library + public bool PerformContentCheck + { + get; + set; + } + + /// + /// Gets content check flag whether allowed or not + /// + /// Content check enabled or not + public bool AllowContentCheck + { + get; + set; + } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Client.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Client.cs new file mode 100644 index 00000000..3e95c576 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Client.cs @@ -0,0 +1,53 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-nikhid +// Created : 06-19-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This class contains all the properties related to a particular client selected by the user +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold client meta-data. It includes client unique ID, client name, and client URL. + /// + public class Client + { + /// + /// Gets or sets the client identifier. Represents the unique identifier for client. + /// + /// The client identifier. + + public string Id + { + get; + set; + } + + /// + /// Gets or sets the name of the client. Represents the unique name of client. + /// + /// The name of the client. + + public string Name + { + get; + set; + } + + /// + /// Gets or sets the client URL. + /// + /// The client URL. + + public string Url + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DocumentData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DocumentData.cs new file mode 100644 index 00000000..c0247a24 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DocumentData.cs @@ -0,0 +1,194 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Represents a legal document. Provides the structure required to hold pinned document meta-data. It includes document name, version, created date, modified date, matter details for document, and client details for document. + /// + public class DocumentData + { + /// + /// Gets or sets the name of the document. Represents the document under the matter library. + /// + /// The name of the document. + public string DocumentName + { + get; + set; + } + + /// + /// Gets or sets the document version. Represents the document version (minor, major, check out, etc.). + /// + /// The document version. + public string DocumentVersion + { + get; + set; + } + + /// + /// Gets or sets the document client. Represents the client name under which the document is present. + /// + /// The document client. + public string DocumentClient + { + get; + set; + } + + /// + /// Gets or sets the document client identifier. Represents the unique client ID under which the document is present. + /// + /// The document client identifier. + public string DocumentClientId + { + get; + set; + } + + /// + /// Gets or sets the document client URL. Represents the client URL under which the document is present. + /// + /// The document client URL. + public string DocumentClientUrl + { + get; + set; + } + + /// + /// Gets or sets the document matter. Represents the matter library that holds the document. + /// + /// The document matter. + public string DocumentMatter + { + get; + set; + } + + /// + /// Gets or sets the document matter identifier. Represents the matter ID that holds the document. + /// + /// The document matter identifier. + public string DocumentMatterId + { + get; + set; + } + + /// + /// Gets or sets the document owner who has uploaded the document. + /// + /// The document owner. + public string DocumentOwner + { + get; + set; + } + + /// + /// Gets or sets the document URL. + /// + /// The document URL. + public string DocumentUrl + { + get; + set; + } + + /// + /// Gets or sets the document OWA URL. Represents the documents URL supported by OWA or Office online; otherwise the document path. + /// + public string DocumentOWAUrl + { + get; + set; + } + + /// + /// Gets or sets the document extension. + /// + /// The document extension. + public string DocumentExtension + { + get; + set; + } + + /// + /// Gets or sets the document created date. Represents the document uploaded date in matter library. + /// + /// The document created date. + public string DocumentCreatedDate + { + get; + set; + } + + /// + /// Gets or sets the document modified date. Represents the document last modified date in matter library. + /// + /// The document modified date. + public string DocumentModifiedDate + { + get; + set; + } + + /// + /// Gets or sets the document check out user. Represents the check out user of document. + /// + /// The document check out user. + public string DocumentCheckoutUser + { + get; + set; + } + + /// + /// Gets or sets the document matter URL. Represents the URL of matter library where document is present. + /// + /// The document check out user. + public string DocumentMatterUrl + { + get; + set; + } + + /// + /// Gets or sets the document parent URL. Represents the parent URL of document. + /// + /// The document check out user. + public string DocumentParentUrl + { + get; + set; + } + + /// + /// Gets or sets the document ID. Represents the ID of a document. + /// + /// The document ID. + public string DocumentID + { + get; + set; + } + + public bool Checker { get; set; } + public string DocumentIconUrl { get; set; } + /// + /// Gets or sets the Matter GUID. Represents the GUID for the matter. + /// + /// The Matter GUID. + public string PinType + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DuplicateDocument.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DuplicateDocument.cs new file mode 100644 index 00000000..2b08f181 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Document/DuplicateDocument.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for checking if document already exists. + /// + public class DuplicateDocument + { + /// + /// Gets or sets a value indicating whether a document with the same name exists or not. + /// + /// true if document with the same name found; otherwise, false + public bool DocumentExists { get; set; } + + /// + /// Gets or sets a value indicating whether a potential duplicate exists, i.e. along with name, other properties also match + /// + /// true if potential duplicate found; otherwise, false + public bool HasPotentialDuplicate { get; set; } + + /// + /// Constructor to initialize the DuplicateDocument object + /// + /// Default value for DocumentExists property + /// Default value for HasPotentialDuplicate property + public DuplicateDocument(bool documentExists, bool hasPotentialDuplicate) + { + this.DocumentExists = documentExists; + this.HasPotentialDuplicate = hasPotentialDuplicate; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/EMail/MailAttachmentDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/EMail/MailAttachmentDetails.cs new file mode 100644 index 00000000..550357b4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/EMail/MailAttachmentDetails.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class MailAttachmentDetails + { + /// + /// Gets or sets the full URL of mail attachment. + /// + /// The full URL. + public string FullUrl + { + get; + set; + } + + /// + /// Gets or sets overwrite option for mail attachment. + /// + /// The overwrite. + public string AttachmentContent + { + get; + set; + } + + /// + /// Gets or sets value based on attachment call for mail attachment. + /// + /// The Attachment Flag. + public bool IsAttachmentCall + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Error/ErrorResponse.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Error/ErrorResponse.cs new file mode 100644 index 00000000..fe229d4c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Error/ErrorResponse.cs @@ -0,0 +1,37 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +using System; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// ErrorResponse object that will be sent to the client for all the errors that are generated in the service + /// + public class ErrorResponse + { + public string ErrorCode { get; set; } + public string Message { get; set; } + public string Description { get; set; } + public bool IsTokenValid { get; set; } + public string StackTrace { get; set; } + public string ClassName { get; set; } + public string MethodName { get; set; } + public int? LineNumber { get; set; } + public string ErrorDate { get; set; } + public Exception Exception { get; set; } + public bool IsErrror { get; set; } + public override string ToString() + { + return $"EXCEPTION MESSAGE:{Message} CLASS NAME: {ClassName} METHOD NAME: {MethodName} LINE NUMBER: {LineNumber}"; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/GenericResponseVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/GenericResponseVM.cs new file mode 100644 index 00000000..ca3ef31c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/GenericResponseVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class GenericResponseVM + { + public string Code { get; set; } + public string Value { get; set; } + public bool IsError { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Conflict.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Conflict.cs new file mode 100644 index 00000000..c653a701 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Conflict.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold matter conflict meta-data. It includes user who performed the conflict check, the conflict check date, and security of matter from external users. + /// + public class Conflict + { + /// + /// Gets or sets the user who performed the conflict check for matter. + /// + /// The conflict check by. + + public string CheckBy + { + get; + set; + } + + /// + /// Gets or sets the conflict check date for matter. + /// + /// The conflict check on. + + public string CheckOn + { + get; + set; + } + + /// + /// Gets or sets the conflict identified option (Yes/No) for matter. Represents if the conflict was identified or not. + /// + /// The conflict identified. + + public string Identified + { + get; + set; + } + + /// + /// Gets or sets the flag to mark the matter as secure or not. + /// + /// The secure matter. + + public string SecureMatter + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ExternalSharingRequest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ExternalSharingRequest.cs new file mode 100644 index 00000000..bab1d4dc --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ExternalSharingRequest.cs @@ -0,0 +1,23 @@ + + +using Microsoft.WindowsAzure.Storage.Table; +using System.Collections.Generic; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold external sharing information. It includes the person name with whom the information + /// is getting share, his role, his permission etc. + /// + public class ExternalSharingRequest : TableEntity + { + public Client Client { get; set; } + public string MatterUrl { get; set; } + public string MatterId { get; set; } + public string ClientName { get; set; } + public string Person { get; set; } + public string Role { get; set; } + public string Permission { get; set; } + public string Status { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/FolderData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/FolderData.cs new file mode 100644 index 00000000..69628833 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/FolderData.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure for folder hierarchy within matter. + /// + public class FolderData + { + /// + /// Gets or sets the name. Represents the folder under the matter library. + /// + /// The name. + public string Name + { + get; + set; + } + + /// + /// Gets or sets the URL. Represents the folder URL under the matter library. + /// + /// The URL. + public string URL + { + get; + set; + } + + /// + /// Gets or sets the parent URL. Represents the parent URL. + /// + /// The parent URL. + public string ParentURL + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ListInformation.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ListInformation.cs new file mode 100644 index 00000000..dcf9cfe3 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/ListInformation.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class ListInformation + { + public string name + { + get; + set; + } + public string description + { + get; + set; + } + + public string templateType + { + get; + set; + } + + public bool isContentTypeEnable + { + get; + set; + } + + public IList folderNames + { + get; + set; + } + + public VersioningInfo versioning + { + get; + set; + } + + public string Path + { + get; + set; + } + } + + +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Matter.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Matter.cs new file mode 100644 index 00000000..e07ceac8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Matter.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold matter meta-data. It includes matter ID, name, description, conflict details, + /// allowed teams, blocked users, permissions, and content type. + /// + public class Matter + { + /// + /// Gets or sets the matter identifier. Represents the matter ID under a client. + /// + /// The matter identifier. + + public string Id + { + get; + set; + } + + /// + /// Gets or sets the name of the matter. Represents the matter name under a client. + /// + /// The name of the matter. + + public string Name + { + get; + set; + } + + /// + /// Gets or sets the matter description. Represents the description of matter library. + /// + /// The matter description. + + public string Description + { + get; + set; + } + + /// + /// Gets or sets the matter conflict meta-data. Represents conflict checked by user, conflict check date, and security of matter from external users. + /// + /// The conflict. + + public Conflict Conflict + { + get; + set; + } + + /// + /// Gets or sets the user names. Represents the user names associated with the matter. + /// + /// The user names. + + public IList UserNames + { + get; + set; + } + + /// + /// Gets or sets the content types. Represents all the content types associated with the matter library. + /// + /// The content types. + + public IList ContentTypes + { + get; + set; + } + + /// + /// Gets or sets the assigned user names. Represents the team members and responsible attorneys associated with the matter. + /// + /// The assign user names. + + public IList> AssignUserNames + { + get; + set; + } + + /// + /// Gets or sets the assigned user email addresses. Represents the team members associated with the project. + /// + /// The list of assign user email addresses. + public IList> AssignUserEmails + { + get; + set; + } + + /// + /// Gets or sets the blocked user names. Represents the users who are blocked from viewing the matter details. + /// + /// The block user names. + + public IList BlockUserNames + { + get; + set; + } + + /// + /// Gets or sets the permissions. Represents the permission levels associated with the matter. + /// + /// The permissions. + + public IList Permissions + { + get; + set; + } + + /// + /// Gets or sets the roles. Represents the role of users associated with the matter. + /// + /// The roles. + + public IList Roles + { + get; + set; + } + + /// + /// Gets or sets the folder names. Represents the list of folders that will be created with the matter. + /// + /// The folder names. + + public IList FolderNames + { + get; + set; + } + + /// + /// Gets or sets the default content type. + /// + /// The default content type. + + public string DefaultContentType + { + get; + set; + } + + /// + /// Gets or sets the Document template count. Represents the document templates count of matter. + /// + /// The Document template count. + + public IList DocumentTemplateCount + { + get; + set; + } + + ///// + ///// Gets or sets the Matter GUID. + ///// + ///// The Matter GUID. + + public string MatterGuid + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterConfigurations.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterConfigurations.cs new file mode 100644 index 00000000..bf4030bb --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterConfigurations.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Represents configuration for the matter. Holds value for various entities on the Matter Provision page + /// + public class MatterConfigurations + { + /// + /// Gets or sets the name of the matter. Represents the name of matter library. + /// + /// The default name of the matter. + public string DefaultMatterName + { + get; + set; + } + + /// + /// Gets or sets the default matter id + /// + /// The default matter id + public string DefaultMatterId + { + get; + set; + } + + /// + /// Gets or sets the default matter type + /// + /// The default matter type + public string DefaultMatterType + { + get; + set; + } + + /// + /// Gets or sets the matter types + /// + /// The matter types + public string MatterTypes + { + get; + set; + } + + /// + /// Gets or sets the users of the matters + /// + /// The matter users + public string MatterUsers + { + get; + set; + } + + /// + /// Gets or sets the emails for users of the projects + /// + /// The list of matter center user emails + public string MatterUserEmails + { + get; + set; + } + + /// + /// Gets or sets the matter roles for the users + /// + /// The matter roles for the users + public string MatterRoles + { + get; + set; + } + + /// + /// Gets or sets the matter permissions + /// + /// The matter permissions + public string MatterPermissions + { + get; + set; + } + + /// + /// Gets or sets the flag for calendar selection on settings page + /// + /// Calendar selected flag + public bool IsCalendarSelected + { + get; + set; + } + + /// + /// Gets or sets the email option selection flag + /// + /// The email option selection flag + public bool IsEmailOptionSelected + { + get; + set; + } + + /// + /// Gets or sets the RSS selection flag + /// + /// The RSS selection flag + public bool IsRSSSelected + { + get; + set; + } + + /// + /// Gets or sets the matter id. + /// + /// The matter id. + public bool IsRestrictedAccessSelected + { + get; + set; + } + + /// + /// Gets or sets the conflict check flag + /// + /// The conflict check visibility flag + public bool IsConflictCheck + { + get; + set; + } + + /// + /// Gets or sets the matter description mandatory flag + /// + /// The matter description mandatory flag + public bool IsMatterDescriptionMandatory + { + get; + set; + } + + /// + /// Gets or sets the matter practice group + /// + /// The matter group + public string MatterPracticeGroup + { + get; + set; + } + + /// + /// Gets or sets the matter area of law + /// + /// The matter area of law + public string MatterAreaofLaw + { + get; + set; + } + + /// + /// Gets or sets the content check property + /// + /// The content check property + public bool IsContentCheck + { + get; + set; + } + + /// + /// Gets or sets the tasks selected property + /// + /// The tasks selected property + public bool IsTaskSelected + { + get; + set; + } + + /// + /// The client name/url to which the settings needs to be retrieved or needs to be updated + /// + public string ClientUrl + { + get; + set; + } + + /// + /// The date time when the matter configurations are updated + /// + public string CachedItemModifiedDate + { + get; + set; + } + + /// + /// The user who has modified the matter configurations + /// + public IList UserId + { + get; + set; + } + + /// + /// Property which will decide whether to show role dropdown or not when creating matter + /// + public bool ShowRole{ get; set; } + + + /// + /// Property which will decide whether to show matter id textbox or not when creating matter + /// + public bool ShowMatterId { get; set; } + + + /// + /// Property to determine the matter type(Guid or DateTime of Custom + /// + public string MatterIdType { get; set; } + } + + + +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterData.cs new file mode 100644 index 00000000..69855107 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterData.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Represents a legal matter. Provides the structure required to hold pinned matter meta-data. It includes name, description, created date, URL, practice group, area of law, sub area of law, client ID, and client name. + /// + public class MatterData + { + /// + /// Gets or sets the name of the matter. Represents the name of matter library. + /// + /// The name of the matter. + public string MatterName + { + get; + set; + } + + /// + /// Gets or sets the matter description. Represents the description of matter library. + /// + /// The matter description. + public string MatterDescription + { + get; + set; + } + + /// + /// Gets or sets the matter created date. Represents the matter library creation date. + /// + /// The matter created date. + public string MatterCreatedDate + { + get; + set; + } + + /// + /// Gets or sets the matter URL. Represents the matter library URL present under the client. + /// + /// The matter URL. + public string MatterUrl + { + get; + set; + } + + /// + /// Gets or sets the matter practice group. Represents the practice group associated with the matter. + /// + /// The matter practice group. + public string MatterPracticeGroup + { + get; + set; + } + + /// + /// Gets or sets the matter area of law. Represents the area of law associated with the matter. + /// + /// The matter area of law. + public string MatterAreaOfLaw + { + get; + set; + } + + /// + /// Gets or sets the matter sub area of law. Represents the sub area of law associated with the matter. + /// + /// The matter sub area of law. + public string MatterSubAreaOfLaw + { + get; + set; + } + + /// + /// Gets or sets the matter client URL. Represents the URL of client for the matter. + /// + /// The matter client URL. + public string MatterClientUrl + { + get; + set; + } + + /// + /// Gets or sets the matter client. Represents the name of client for the matter. + /// + /// The matter client. + public string MatterClient + { + get; + set; + } + + /// + /// Gets or sets the matter client identifier. Represents the client ID for the matter. + /// + /// The matter client identifier. + public string MatterClientId + { + get; + set; + } + + /// + /// Gets or sets the HideUpload flag. Represents if the upload icon should be hidden from the user. + /// + /// The hide upload. + public string HideUpload + { + get; + set; + } + + /// + /// Gets or sets the Matter ID. Represents the matter ID under the client. + /// + /// The matter ID. + public string MatterID + { + get; + set; + } + + /// + /// Gets or sets the responsible attorney. Represents the attorney responsible for the matter. + /// + /// The responsible attorney. + public string MatterResponsibleAttorney + { + get; + set; + } + + /// + /// Gets or sets the Modified date. Represents the modified date for the matter. + /// + /// The Modified Date. + public string MatterModifiedDate + { + get; + set; + } + + /// + /// Gets or sets the Matter GUID. Represents the GUID for the matter. + /// + /// The Matter GUID. + public string MatterGuid + { + get; + set; + } + /// + /// Gets or sets the Matter GUID. Represents the GUID for the matter. + /// + /// The Matter GUID. + public string PinType + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterDetails.cs new file mode 100644 index 00000000..741419df --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterDetails.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold additional matter meta-data. It includes matter practice group, area of law, sub area of law, responsible attorney, team members, and blocked users. + /// + public class MatterDetails + { + ///// + ///// Gets or sets the practice group associated with the matter. + ///// + ///// The practice group. + + //public string PracticeGroup + //{ + // get; + // set; + //} + + ///// + ///// Gets or sets the area of law associated with the matter. + ///// + ///// The area of law. + + //public string AreaOfLaw + //{ + // get; + // set; + //} + + ///// + ///// Gets or sets the sub area of law associated with the matter. + ///// + ///// The sub area of law. + + //public string SubareaOfLaw + //{ + // get; + // set; + //} + + public IDictionary ManagedColumnTerms + { + get; + set; + } + + /// + /// Gets or sets the responsible attorney associated with the matter. + /// + /// The responsible attorney. + + public string ResponsibleAttorney + { + get; + set; + } + + /// + /// Gets or sets the responsible attorney email associated with the matter. + /// + /// The list of responsible attorney email addresses. + + public string ResponsibleAttorneyEmail + { + get; + set; + } + + /// + /// Gets or sets the team members associated with the matter. + /// + /// The team members. + + public string TeamMembers + { + get; + set; + } + + /// + /// Gets or sets the users who can only view the matter. + /// + /// The upload blocked users. + + public IList UploadBlockedUsers + { + get; + set; + } + + /// + /// Gets or sets the role information associated with the matter. + /// + /// The team members. + + public string RoleInformation + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterInformationVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterInformationVM.cs new file mode 100644 index 00000000..f2a1170f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterInformationVM.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +namespace Microsoft.Legal.MatterCenter.Models +{ + public class MatterInformationVM: MatterVM + { + public bool EditMode { get; set; } + public bool IsConflictCheck { get; set; } + public string MatterLocation { get; set; } + public string MatterCreator { get; set; } + public string MatterCreatorEmail { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetadata.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetadata.cs new file mode 100644 index 00000000..47b3326c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetadata.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold additional matter meta-data for default values from term store. It includes term store information for matter, client, practice group, area of law and sub area of law. + /// + public class MatterMetadata + { + /// + /// Gets or sets the matter property + /// + public Matter Matter + { + get; + set; + } + + /// + /// Gets or sets the client property + /// + public Client Client + { + get; + set; + } + public IDictionary ManagedColumnTerms + { + get; + set; + } + /// + /// Gets or sets the practice group property + /// + public PracticeGroupTerm PracticeGroupTerm + { + get; + set; + } + + /// + /// Gets or sets the area of law property + /// + public AreaTerm AreaTerm + { + get; + set; + } + + /// + /// Gets or sets the Subarea of law property + /// + public SubareaTerm SubareaTerm + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetdataVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetdataVM.cs new file mode 100644 index 00000000..12343de2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterMetdataVM.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +namespace Microsoft.Legal.MatterCenter.Models +{ + public class MatterMetdataVM : MatterVM + { + public MatterConfigurations MatterConfigurations { get; set; } + public MatterProvisionFlags MatterProvisionFlags { get; set; } + public bool HasErrorOccurred { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterProvisionFlags.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterProvisionFlags.cs new file mode 100644 index 00000000..aec44efd --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterProvisionFlags.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold flag values + /// + public class MatterProvisionFlags + { + /// + /// Gets or sets value for matter landing flag + /// + /// Matter landing + + public string MatterLandingFlag + { + get; + set; + } + + /// + /// Gets or sets boolean value for send email flag + /// + /// Send email + + public bool SendEmailFlag + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterRevertList.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterRevertList.cs new file mode 100644 index 00000000..3fd14e50 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterRevertList.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure needed to revert the matter permission update operation. + /// + [CLSCompliant(false)] + public class MatterRevertList + { + /// + /// Gets or sets a matter library instance + /// + public string MatterLibrary { get; set; } + + /// + /// Gets or sets a matter OneNote library instance + /// + public string MatterOneNoteLibrary { get; set; } + + /// + /// Gets or sets a matter calendar instance + /// + public string MatterCalendar { get; set; } + + /// + /// Gets or sets a matter site pages instance + /// + public string MatterSitePages { get; set; } + + /// + /// Gets or sets a matter task instance + /// + public string MatterTask { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterStampedDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterStampedDetails.cs new file mode 100644 index 00000000..21d54725 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterStampedDetails.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold matter property bag information (stamped properties). + /// + public class MatterStampedDetails + { + /// + /// Indicates if the matter is old or new + /// + public string IsNewMatter { get; set; } + + /// + /// Provides the structure required to hold matter meta-data. It includes matter ID, name, description, conflict details, allowed teams, blocked users, permissions, and content type. + /// + public Matter MatterObject { get; set; } + + /// + /// Provides the structure required to hold additional matter meta-data. It includes matter practice group, area of law, sub area of law, responsible attorney, team members, and blocked users. + /// + public MatterDetails MatterDetailsObject { get; set; } + + /// + /// Provides the structure required to hold client meta-data. It includes client unique ID, client name, and client URL. + /// + public Client ClientObject { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterVM.cs new file mode 100644 index 00000000..0b0e02b8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/MatterVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Storage.Table; +namespace Microsoft.Legal.MatterCenter.Models +{ + public class MatterVM:TableEntity + { + public Client Client { get; set; } + public Matter Matter { get; set; } + public MatterDetails MatterDetails { get; set; } + public IList UserIds { get; set; } + public string SerializeMatter { get; set; } + public string Status { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Role.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Role.cs new file mode 100644 index 00000000..3a9024b8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/Role.cs @@ -0,0 +1,47 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold role meta-data. It includes role ID, name, and flag indicating whether role is mandatory or not. + /// + public class Role + { + /// + /// Gets or sets the role identifier. Represents the role identifier. + /// + /// The role identifier. + + public string Id + { + get; + set; + } + + /// + /// Gets or sets the name of the role. Represents the role name. + /// + /// The name of the role. + + public string Name + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether this is mandatory. + /// + /// true if mandatory; otherwise, false. + + public bool Mandatory + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/VersioningInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/VersioningInfo.cs new file mode 100644 index 00000000..db03d3bc --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Matter/VersioningInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class VersioningInfo + { + public bool EnableVersioning + { + get; + set; + } + public bool EnableMinorVersions + { + get; + set; + } + public bool ForceCheckout + { + get; + set; + } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Microsoft.Legal.MatterCenter.Models.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Microsoft.Legal.MatterCenter.Models.xproj new file mode 100644 index 00000000..da03f69e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Microsoft.Legal.MatterCenter.Models.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + d1efe912-64ce-40e6-86f7-01e39cc30893 + Microsoft.Legal.MatterCenter.Models + .\obj + .\bin + v4.6 + + + + 2.0 + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f7035a06 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Models")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Models")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d1efe912-64ce-40e6-86f7-01e39cc30893")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/DateFilterObject.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/DateFilterObject.cs new file mode 100644 index 00000000..ef6e1efb --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/DateFilterObject.cs @@ -0,0 +1,74 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Search object. +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for storing date filter. + /// + public class DateFilterObject + { + /// + /// Gets or sets the 'From' modified date. Represents 'From' modified date selected for filtering. + /// + public string ModifiedFromDate + { + get; + set; + } + + /// + /// Gets or sets the 'To' modified date. Represents 'To' modified date selected for filtering. + /// + public string ModifiedToDate + { + get; + set; + } + + /// + /// Gets or sets the 'From' created date. Represents 'From' created date selected for filtering. + /// + public string CreatedFromDate + { + get; + set; + } + + /// + /// Gets or sets the 'To' created date. Represents 'To' created date selected for filtering. + /// + public string CreatedToDate + { + get; + set; + } + + /// + /// Gets or sets the 'From' open date. Represents 'From' open date selected for filtering. + /// + public string OpenDateFrom + { + get; + set; + } + + /// + /// Gets or sets the 'To' open date. Represents 'To' open date selected for filtering. + /// + public string OpenDateTo + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/EntityData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/EntityData.cs new file mode 100644 index 00000000..1b240015 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/EntityData.cs @@ -0,0 +1,29 @@ + + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Holds the structure of entity data returned from people picker web service. + /// + public class EntityData + { + /// + /// Gets or sets the title of user or security group + /// + public string Title { get; set; } + + /// + /// Gets or sets the department of user or security group + /// + public string Department { get; set; } + + /// + /// Gets or sets the email of user or security group + /// + public string Email { get; set; } + /// + /// Gets or sets the email of user or security group + /// + public string PrincipalType { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/FilterObject.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/FilterObject.cs new file mode 100644 index 00000000..5024677e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/FilterObject.cs @@ -0,0 +1,156 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Search object. +// *********************************************************************** +using System.Collections.Generic; + + +namespace Microsoft.Legal.MatterCenter.Models +{ + + /// + /// Provides the structure required for filtering matters/documents. It includes list of clients, practice group, area of law, sub area of law, from date, to date, and document author. + /// + public class FilterObject + { + /// + /// Gets or sets the clients list. Represents the clients selected for filtering. + /// + /// The clients list. + + public IList ClientsList + { + get; + set; + } + + /// + /// Gets or sets the list of practice group. Represents the practice groups selected for filtering. + /// + /// The PGList. + + public IList PGList + { + get; + set; + } + + /// + /// Gets or sets the list of area of law. Represents the area of law selected for filtering. + /// + /// The AOL list. + + public IList AOLList + { + get; + set; + } + + /// + /// Gets or sets FromDate. Represents the start date for filtering. + /// + /// From date. + + public string FromDate + { + get; + set; + } + + /// + /// Gets or sets ToDate. Represents the end date for filtering. + /// + /// To date. + + public string ToDate + { + get; + set; + } + + /// + /// Gets or sets the FilterByMe flag. Represents filtering on items created by logged-in user. + /// + /// The filter by me. + + public int FilterByMe + { + get; + set; + } + + /// + /// Gets or sets the document author. Represents authors selected for filtering. + /// + /// The document author. + + public string DocumentAuthor + { + get; + set; + } + + /// + /// Gets or sets the document/ matter name. Represents document/ matter name selected for filtering. + /// + public string Name + { + get; + set; + } + + /// + /// Gets or sets the document's/ matter's client name. Represents document's/ matter's client name selected for filtering. + /// + public string ClientName + { + get; + set; + } + + /// + /// Gets or sets the document's checked out user name. Represents the list of check out user names selected for filtering. + /// + public string DocumentCheckoutUsers + { + get; + set; + } + + /// + /// Gets or sets the Date filters. Represents collection of date filters selected for filtering. + /// + public DateFilterObject DateFilters + { + get; + set; + } + + /// + /// Gets or sets the Responsible attorney. Represents the list of Responsible attorneys selected for filtering. + /// + public string ResponsibleAttorneys + { + get; + set; + } + + /// + /// Gets or sets the Sub area of Law. Represents Sub area of Law selected for filtering. + /// + public string SubareaOfLaw + { + get; + set; + } + } + +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PeoplePickerUser.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PeoplePickerUser.cs new file mode 100644 index 00000000..56699afc --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PeoplePickerUser.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold user meta-data retrieved from client people picker web service. + /// + public class PeoplePickerUser + { + /// + /// Gets or sets the user logon name. + /// + public string Key { get; set; } + + /// + /// Gets or sets the user email. + /// + public string Description { get; set; } + + /// + /// Gets or sets the user display name. + /// + public string DisplayText { get; set; } + + /// + /// Gets or sets the entity type (user or security group). + /// + public string EntityType { get; set; } + + /// + /// Gets or sets the entity data returned from people picker web service + /// + public EntityData EntityData { get; set; } + public string ProviderDisplayName { get; set; } + public string ProviderName { get; set; } + public bool IsResolved { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestDocumentVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestDocumentVM.cs new file mode 100644 index 00000000..d0fce3c9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestDocumentVM.cs @@ -0,0 +1,21 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-lapedd +// Created : 04-11-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used for pinning, un pinning and get pinned data +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class PinRequestDocumentVM + { + public Client Client { get; set; } + public DocumentData DocumentData { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestMatterVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestMatterVM.cs new file mode 100644 index 00000000..09c12a01 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinRequestMatterVM.cs @@ -0,0 +1,21 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-lapedd +// Created : 04-11-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used for pinning, un pinning and get pinned data +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class PinRequestMatterVM + { + public Client Client { get; set; } + public MatterData MatterData { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinUnPinDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinUnPinDetails.cs new file mode 100644 index 00000000..8b2babac --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/PinUnPinDetails.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for pin/unpin operation performed on matter/document. Meta-data includes the list name, list column, URL, and matter/document details. + /// + public class PinUnpinDetails + { + /// + /// Gets or sets the name of the list for operation. + /// + /// The name of the list. + public string ListName + { + get; + set; + } + + /// + /// Gets or sets the pinned list column details. + /// + /// The pinned list column details. + public string PinnedListColumnDetails + { + get; + set; + } + + /// + /// Gets or sets the URL of matter/document. + /// + /// The URL. + public string URL + { + get; + set; + } + + /// + /// Gets or sets the user pinned matter data. + /// + /// The user pinned matter data. + public MatterData UserPinnedMatterData + { + get; + set; + } + + /// + /// Gets or sets the user pinned document data. + /// + /// The user pinned document data. + public DocumentData UserPinnedDocumentData + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchObject.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchObject.cs new file mode 100644 index 00000000..5dab1d7d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchObject.cs @@ -0,0 +1,76 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Search object. +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for searching matters/documents. It includes page number, search keyword, filter conditions, sort conditions, and numbers of items to be shown on page. + /// + public class SearchObject + { + /// + /// Gets or sets the page number. Represents the current page number that is displayed on the page. + /// + /// The page number. + + public int PageNumber + { + get; + set; + } + + /// + /// Gets or sets the items per page. Represents number of items to be shown on the page. + /// + /// The items per page. + + public int ItemsPerPage + { + get; + set; + } + + /// + /// Gets or sets the search term. Represents the search keyword/term to retrieve the results. + /// + /// The search term. + + public string SearchTerm + { + get; + set; + } + + /// + /// Gets or sets the filters. Represents the filtering condition. + /// + /// The filters. + + public FilterObject Filters + { + get; + set; + } + + /// + /// Gets or sets the sort. Represents the searching condition. + /// + /// The sort condition. + + public SortObject Sort + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchRequestVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchRequestVM.cs new file mode 100644 index 00000000..e9e1c2a0 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchRequestVM.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class SearchRequestVM + { + public SearchObject SearchObject { get; set; } + /// + /// Client info object + /// + public Client Client { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchResponseVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchResponseVM.cs new file mode 100644 index 00000000..2bbeb889 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SearchResponseVM.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +namespace Microsoft.Legal.MatterCenter.Models +{ + public class SearchResponseVM + { + public IEnumerable> SearchResults{ get; set; } + public dynamic MatterDataList { get; set; } + public dynamic DocumentDataList { get; set; } + public int TotalRows { get; set; } + public ErrorResponse ErrorResponse { get; set; } + public string NoPinnedMessage { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SortObject.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SortObject.cs new file mode 100644 index 00000000..bdc738ff --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Search/SortObject.cs @@ -0,0 +1,43 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Search object. +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for sorting matters/documents. It includes sortable property and sorting direction. + /// + public class SortObject + { + /// + /// Gets or sets the by property. Represents the property selected for sorting. + /// + /// The by property. + + public string ByProperty + { + get; + set; + } + + /// + /// Gets or sets the direction. Represents the order for sorting. + /// + /// The direction. + + public int Direction + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpData.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpData.cs new file mode 100644 index 00000000..47e17aa7 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpData.cs @@ -0,0 +1,31 @@ + + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to store content for contextual help functionality. + /// + public class ContextHelpData + { + /// + /// Gets or sets the structure required to store content for contextual help sections. + /// + /// Provides the structure required to store content for contextual help sections. + public ContextHelpSection ContextSection { get; set; } + /// + /// Gets or sets the link title for operation. + /// + /// Link title of contextual help fly out + public string LinkTitle { get; set; } + /// + /// Gets or sets the Link URL for operation. + /// + /// Link URL of contextual help fly out + public string LinkURL { get; set; } + /// + /// Gets or sets the Link order for operation. + /// + /// Link order of contextual help fly out + public string LinkOrder { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpSection.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpSection.cs new file mode 100644 index 00000000..562ea2b0 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/ContextHelpSection.cs @@ -0,0 +1,36 @@ + + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to store content for contextual help sections. + /// + public class ContextHelpSection + { + /// + /// Gets or sets the section id for operation. + /// + /// Section id of contextual help fly out + public string SectionID { get; set; } + /// + /// Gets or sets the section title for operation. + /// + /// Section title of contextual help fly out + public string SectionTitle { get; set; } + /// + /// Gets or sets the section order for operation. + /// + /// Section order of contextual help fly out + public string SectionOrder { get; set; } + /// + /// Gets or sets the page name for operation. + /// + /// Page name of contextual help fly out + public string PageName { get; set; } + /// + /// Gets or sets the number of columns for help links. + /// + /// Number of columns to be displayed on the contextual help section + public string NumberOfColumns { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/HelpRequestModel.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/HelpRequestModel.cs new file mode 100644 index 00000000..c081c8b5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Shared/HelpRequestModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class HelpRequestModel + { + public Client Client { get; set; } + public string SelectedPage { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/AreaTerm.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/AreaTerm.cs new file mode 100644 index 00000000..5659adb6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/AreaTerm.cs @@ -0,0 +1,83 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** + + +using System.Collections.Generic; +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for area of law term. It includes area of law, practice group, id , wssid and list of sub area of law. + /// + public class AreaTerm + { + /// + /// Gets or sets the name of the term (area of law). + /// + /// The name of the term. + public string TermName + { + get; + set; + } + + /// + /// Gets or sets the name of the parent term (practice group). + /// + /// The name of the parent term. + public string ParentTermName + { + get; + set; + } + + /// + /// Gets or sets the folder names. This is used for creation of folders when a matter is created. + /// + /// The folder names. + public string FolderNames + { + get; + set; + } + + /// + /// Gets or sets the sub area terms. It includes the list of sub area of law falling under particular area of law. + /// + /// The sub area terms. + public IList SubareaTerms + { + get; + set; + } + + /// + /// Gets or sets the id of the term (area of law). This is a GUID value (string representation) and is used as the Id property of the Term. + /// + /// The id of the term. + public string Id + { + get; + set; + } + + /// + /// Gets or sets the WssId of the term (area of law). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. + /// + /// The WssId of the term. + public int WssId + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ClientTermSets.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ClientTermSets.cs new file mode 100644 index 00000000..14e8fca3 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ClientTermSets.cs @@ -0,0 +1,43 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** + +using System.Collections.Generic; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for client term set. It includes term set name and list of terms under the term set. + /// + public class ClientTermSets + { + /// + /// Gets or sets the term name. + /// + /// The name. + public string Name + { + get; + set; + } + + /// + /// Gets or sets the list of client terms present under the clients term set. + /// + /// The client terms. + public IList ClientTerms + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ManagedColumn.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ManagedColumn.cs new file mode 100644 index 00000000..4a7b06c8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/ManagedColumn.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class ManagedColumn + { + /// + /// Gets or sets the name of the term + /// + /// The name of the term. + /// + public string TermName + { + get; + set; + } + + /// + /// Gets or sets the id of the term (practice group). This is a GUID value (string representation) and is used as the Id property of the Term. + /// + /// The id of the term. + public string Id + { + get; + set; + } + + /// + /// Gets or sets the WssId of the term This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. + /// + /// The WssId of the term. + public int WssId + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/PracticeGroupTerm.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/PracticeGroupTerm.cs new file mode 100644 index 00000000..62a81caa --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/PracticeGroupTerm.cs @@ -0,0 +1,81 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** +using System.Collections.Generic; +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for practice group term set. It includes the practice group, client term set, folders, id , wssid, and list of area team under practice group. + /// + public class PracticeGroupTerm + { + /// + /// Gets or sets the name of the term (practice group). + /// + /// The name of the term. + public string TermName + { + get; + set; + } + + /// + /// Gets or sets the name of the parent term (client term set). + /// + /// The name of the parent term. + public string ParentTermName + { + get; + set; + } + + /// + /// Gets or sets the folder names. This is used for creation of folders when a matter is created. + /// + /// The folder names. + public string FolderNames + { + get; + set; + } + + /// + /// Gets or sets all the area of law under particular practice group. + /// + /// The area terms. + public IList AreaTerms + { + get; + set; + } + + /// + /// Gets or sets the id of the term (practice group). This is a GUID value (string representation) and is used as the Id property of the Term. + /// + /// The id of the term. + public string Id + { + get; + set; + } + + /// + /// Gets or sets the WssId of the term (practice group). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. + /// + /// The WssId of the term. + public int WssId + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/SubAreaTerm.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/SubAreaTerm.cs new file mode 100644 index 00000000..c52b8c9f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/SubAreaTerm.cs @@ -0,0 +1,111 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** +using System.Collections.Generic; + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for sub area of law term. It includes sub area of law, area of law, folders, folder structure flag, id , wssid and document template. + /// + public class SubareaTerm + { + /// + /// Gets or sets the name of the term (sub area of law). + /// + /// The name of the term. + public string TermName + { + get; + set; + } + + /// + /// Gets or sets the name of the parent term (area of law). + /// + /// The name of the parent term. + public string ParentTermName + { + get; + set; + } + + /// + /// Gets or sets the folder names. This is used for creation of folders when a matter is created. + /// + /// The folder names. + public string FolderNames + { + get; + set; + } + + /// + /// Gets or sets the is no folder structure present. If flag is not set, it will navigate to parent term to get the folder names. + /// + /// The is no folder structure present. + public string IsNoFolderStructurePresent + { + get; + set; + } + + /// + /// Gets or sets the document templates. This will be the default content type associated with the document library. + /// + /// The document templates. + public string DocumentTemplates + { + get; + set; + } + + /// + /// Gets or sets the document template names. It includes all the content types that will be available for a document library. + /// + /// The document template names. + public string DocumentTemplateNames + { + get; + set; + } + + /// + /// Gets or sets the id of the term (sub area of law). This is a GUID value (string representation) and is used as the Id property of the Term. + /// + /// The id of the term. + public string Id + { + get; + set; + } + + /// + /// Gets or sets the WssID of the term (sub area of law). This is an integer value being used as the Id of the Term in the TaxonomyHiddenList. + /// + /// The WssID of the term. + public int WssId + { + get; + set; + } + + /// + /// Gets or sets the sub area terms. It includes the list of sub area of law falling under particular area of law. + /// + /// The sub area terms. + public IList SubareaTerms + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TaxonomyResponseVM.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TaxonomyResponseVM.cs new file mode 100644 index 00000000..061d70c5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TaxonomyResponseVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Models +{ + public class TaxonomyResponseVM + { + public string TermSets { get; set; } + public ClientTermSets ClientTermSets { get; set; } + public ErrorResponse ErrorResponse { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermSets.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermSets.cs new file mode 100644 index 00000000..5fadae4e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermSets.cs @@ -0,0 +1,42 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-akdigh +// Created : 03-06-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** +using System.Collections.Generic; + + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required for generic term sets. It includes the term set name and list of practice group under that term set. + /// + public class TermSets + { + /// + /// Gets or sets the term set name. + /// + /// The name. + public string Name + { + get; + set; + } + + /// + /// Gets or sets the list of practice group terms. + /// + /// The PG terms. + public IList PGTerms + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreDetails.cs new file mode 100644 index 00000000..0eca6b19 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreDetails.cs @@ -0,0 +1,52 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-nikhid +// Created : 06-19-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines classes used by Taxonomy. +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold term store meta-data. It includes term group, term set, and additional custom property. + /// + public class TermStoreDetails + { + /// + /// Gets or sets the term group. Represents the name of parent node of term store. + /// + /// The term group. + + public string TermGroup + { + get; + set; + } + + /// + /// Gets or sets the name of the term set. Represents the term sets under term group. + /// + /// The name of the term set. + + public string TermSetName + { + get; + set; + } + + /// + /// Gets or sets the name of the custom property. Represents custom properties associated with each term. + /// + /// The name of the custom property. + + public string CustomPropertyName + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreViewModel.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreViewModel.cs new file mode 100644 index 00000000..c6792664 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Taxonomy/TermStoreViewModel.cs @@ -0,0 +1,23 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// This is a view mode object that will be passed by the client to + /// the service for getting the taxonomy hierarchy and this is used in taxonomy controller + /// + public class TermStoreViewModel + { + public Client Client { get; set; } + public TermStoreDetails TermStoreDetails { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Users/Users.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Users/Users.cs new file mode 100644 index 00000000..de15ccb4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/Users/Users.cs @@ -0,0 +1,80 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Entity +// Author : v-nikhid +// Created : 06-19-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This class contains all the properties related to current logged in user +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Models +{ + /// + /// Provides the structure required to hold user meta-data. It includes user ID, name/alias, logged-in user name, and email. + /// + public class Users + { + /// + /// Gets or sets the user name. + /// + /// The name of the user. + + public string Name + { + get; + set; + } + + /// + /// Gets or sets the logged-in user name. + /// + /// The name of the user log on. + + public string LogOnName + { + get; + set; + } + + /// + /// Gets or sets the user email. + /// + /// The user email. + + public string Email + { + get; + set; + } + + /// + /// Gets or sets the entity type (user or security group). + /// + public string EntityType + { + get; + set; + } + + /// + /// Gets or sets the entity type (user or security group). + /// + public string LargePictureUrl + { + get; + set; + } + + /// + /// Gets or sets the entity type (user or security group). + /// + public string SmallPictureUrl + { + get; + set; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/project.json new file mode 100644 index 00000000..3c8741c7 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Models/project.json @@ -0,0 +1,11 @@ +{ + "version": "1.0.0-*", + + "dependencies": { + "NETStandard.Library": "1.6.0", + "WindowsAzure.Storage": "7.0.1-preview" + }, + "frameworks": { + "net46": {} + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/ConfigRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/ConfigRepository.cs new file mode 100644 index 00000000..d8fe9639 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/ConfigRepository.cs @@ -0,0 +1,243 @@ +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; + +using System; + +using System.Collections.Generic; + +using Microsoft.WindowsAzure.Storage; +using Microsoft.WindowsAzure.Storage.Table; +using System.Threading.Tasks; +using Newtonsoft.Json; +using System.Globalization; +using Microsoft.SharePoint.Client; +using System.Security; +using System.IO; +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class ConfigRepository : IConfigRepository + { + + private GeneralSettings generalSettings; + private UIConfigSettings configSettings; + private IConfigRepository config; + + /// + /// ConfigRepository with all the required dependency injections inserted + /// + /// + /// + public ConfigRepository( + IOptions generalSettings, + IOptions configSettings) + { + this.generalSettings = generalSettings.Value; + this.configSettings = configSettings.Value; + + } + + + /// + /// This method will return the secure password for authentication to SharePoint Online + /// + /// + /// + public static SecureString GetEncryptedPassword(string plainTextPassword) + { + //Get the user's password as a SecureString + SecureString securePassword = new SecureString(); + foreach (char c in plainTextPassword) + { + securePassword.AppendChar(c); + } + //while (info.Key != ConsoleKey.Enter); + return securePassword; + } + + /// + /// This method will upload uiconfigforspo.js into sharepoint catalog site collection + /// + /// + /// + public void UploadConfigFileToSPO(string filePath, string clientUrl) + { + using (ClientContext clientContext = new ClientContext(generalSettings.CentralRepositoryUrl)) + { + //Connec to sharepoint using admin username and password + SecureString password = GetEncryptedPassword(generalSettings.AdminPassword); + clientContext.Credentials = new SharePointOnlineCredentials(generalSettings.AdminUserName, password); + var web = clientContext.Web; + var newFile = new FileCreationInformation + { + Content = System.IO.File.ReadAllBytes(filePath), + Overwrite = true, + //The root at which the uiconfigforspo.js needs to be uploaded + Url = Path.Combine("SiteAssets/Matter Center Assets/Common Assets/Scripts/", Path.GetFileName(filePath)) + + }; + //The document library names under which the uiconfigforspo.js has to be uploaded + var docs = web.Lists.GetByTitle("Site Assets"); + Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile); + clientContext.Load(uploadFile); + clientContext.ExecuteQuery(); + //After uploading the file to sharepoint site collection, delete the file from the app root + System.IO.File.Delete(filePath); + } + } + + /// + /// + /// + /// + /// + public async Task> GetConfigurationsAsync(String filter) + { + return await Task.FromResult(this.GetConfigEntities(filter)); + } + /// + /// + /// + /// + /// + public async Task InsertUpdateConfigurationsAsync(String configs) + { + return await Task.FromResult(UpdateEntityProperty(configs)); + } + + /// + /// Get all the current configs from the Config Storage table + // + /// + /// + public List GetConfigEntities(string filter) + { + var entities = new List(); + try + { + + CloudTable table = GetTable(); + TableQuery query = new TableQuery(); + + if (filter == "") + { + // Construct the queryConfigGroup operation for all entities + query = new TableQuery().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, configSettings.Partitionkey)); + } + else + { + query = new TableQuery().Where(TableQuery.GenerateFilterCondition(configSettings.ConfigGroup, QueryComparisons.Equal, filter)); + } + + var queryResult = table.ExecuteQuery(query); + + entities.AddRange(queryResult); + + } + catch (Exception) + { + throw; + } + + return entities; + } + + + /// + /// Update or Insert Configuration values + /// + /// + public bool UpdateEntityProperty(string configs) + { + try + { + // Retrieve a reference to the table. + CloudTable table = GetTable(); + + TableBatchOperation batchOperation = new TableBatchOperation(); + + Dictionary> allValues = new Dictionary>(); + Dictionary keyValues = new Dictionary(); + + Dictionary newProperties = new Dictionary(); + + //add all the configsGroups and their key value pairs to a dictionary + allValues = JsonConvert.DeserializeObject>>(configs); + + var batch = new TableBatchOperation(); + TableQuery queryFinal = new TableQuery(); + + foreach (KeyValuePair> entry in allValues) + { + foreach (KeyValuePair keyValue in entry.Value) + { + TableQuery entityQuery = new TableQuery().Where( + TableQuery.CombineFilters( + TableQuery.GenerateFilterCondition(configSettings.ConfigGroup, QueryComparisons.Equal.ToLower(), entry.Key), + TableOperators.And, + TableQuery.GenerateFilterCondition(configSettings.Key, QueryComparisons.Equal, keyValue.Key))); + + IEnumerable queryResult = table.ExecuteQuery(entityQuery); + + if (queryResult.GetEnumerator().MoveNext()) + { + foreach (DynamicTableEntity entity in queryResult) + { + entity.Properties[configSettings.ConfigGroup].StringValue = entry.Key; + entity.Properties[configSettings.Key].StringValue = keyValue.Key; + entity.Properties[configSettings.Value].StringValue = keyValue.Value; + batchOperation.Merge(entity); + } + } + else + { + DynamicTableEntity config = CreateEntity(entry, keyValue); + batchOperation.InsertOrReplace(config); + } + + } + } + + table.ExecuteBatch(batchOperation); + return true; + + } + catch (Exception ex) + { + throw; + } + + + } + + private DynamicTableEntity CreateEntity(KeyValuePair> entry, KeyValuePair keyValue) + { + DynamicTableEntity config = new DynamicTableEntity(); + config.PartitionKey = configSettings.Partitionkey; + config.RowKey = string.Format(CultureInfo.InvariantCulture, Guid.NewGuid().ToString()); + config.Properties.Add(configSettings.ConfigGroup, new EntityProperty(entry.Key)); + config.Properties.Add(configSettings.Key, new EntityProperty(keyValue.Key)); + config.Properties.Add(configSettings.Value, new EntityProperty(keyValue.Value)); + + return config; + } + + private CloudTable GetTable() + { + + CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(generalSettings.CloudStorageConnectionString); + CloudTableClient tableClient = cloudStorageAccount.CreateCloudTableClient(); + tableClient.DefaultRequestOptions = new TableRequestOptions + { + PayloadFormat = TablePayloadFormat.JsonNoMetadata + }; + // Retrieve a reference to the table. + CloudTable table = tableClient.GetTableReference(configSettings.MatterCenterConfiguration); + + return table; + } + + } + + +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/IconfigRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/IconfigRepository.cs new file mode 100644 index 00000000..5745bc8f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Configs/IconfigRepository.cs @@ -0,0 +1,29 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : aislid +// Created : 07-06-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This interface contains all UI Configuration functionalities +// *********************************************************************** + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Storage.Table; + + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface IConfigRepository + { + Task> GetConfigurationsAsync(String filter); + Task InsertUpdateConfigurationsAsync(String configs); + List GetConfigEntities(string filter); + bool UpdateEntityProperty(string configs); + void UploadConfigFileToSPO(string filePath, string clientUrl); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/DocumentRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/DocumentRepository.cs new file mode 100644 index 00000000..83a848b8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/DocumentRepository.cs @@ -0,0 +1,201 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This class deals with all the document related functions such as finding document, pin, unpin +// *********************************************************************** + +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class DocumentRepository : IDocumentRepository + { + private ISearch search; + private ISPList spList; + private SearchSettings searchSettings; + private ListNames listNames; + + private CamlQueries camlQueries; + private DocumentSettings documentSettings; + private MailSettings mailSettings; + /// + /// Constructory which will inject all the related dependencies related to matter + /// + /// + public DocumentRepository(ISearch search, IOptions searchSettings, + IOptions listNames, ISPList spList, IOptions camlQueries, IOptions documentSettings, IOptions mailSettings) + { + this.search = search; + this.searchSettings = searchSettings.Value; + this.listNames = listNames.Value; + this.spList = spList; + this.camlQueries = camlQueries.Value; + + this.documentSettings = documentSettings.Value; + this.mailSettings = mailSettings.Value; + } + + /// + /// This method will try to fetch all the matters that are provisioned by the user + /// + /// + /// + public async Task GetDocumentsAsync(SearchRequestVM searchRequestVM) + { + return await Task.FromResult(search.GetDocuments(searchRequestVM)); + } + + /// + /// This method will try to fetch all the matters that are provisioned by the user + /// + /// + /// + public async Task GetPinnedRecordsAsync(Client client) + { + return await Task.FromResult(search.GetPinnedData(client, listNames.UserPinnedDocumentListName, + searchSettings.PinnedListColumnDocumentDetails, true)); + } + + public GenericResponseVM UploadDocument(string folderName, IFormFile uploadedFile, string fileName, + Dictionary mailProperties, string clientUrl, string folder, string documentLibraryName) + { + return spList.UploadDocument(folderName, uploadedFile, fileName, mailProperties, clientUrl, folder, documentLibraryName); + } + + /// + /// Create a new pin for the information that has been passed + /// + /// + /// + /// bool + public async Task PinRecordAsync(T pinRequestData) + { + PinRequestDocumentVM pinRequestDocumentVM = (PinRequestDocumentVM)Convert.ChangeType(pinRequestData, typeof(PinRequestDocumentVM)); + var documentData = pinRequestDocumentVM.DocumentData; + documentData.DocumentName = ServiceUtility.EncodeValues(documentData.DocumentName); + documentData.DocumentVersion = ServiceUtility.EncodeValues(documentData.DocumentVersion); + documentData.DocumentClient = ServiceUtility.EncodeValues(documentData.DocumentClient); + documentData.DocumentClientId = ServiceUtility.EncodeValues(documentData.DocumentClientId); + documentData.DocumentClientUrl = ServiceUtility.EncodeValues(documentData.DocumentClientUrl); + documentData.DocumentMatter = ServiceUtility.EncodeValues(documentData.DocumentMatter); + documentData.DocumentMatterId = ServiceUtility.EncodeValues(documentData.DocumentMatterId); + documentData.DocumentOwner = ServiceUtility.EncodeValues(documentData.DocumentOwner); + documentData.DocumentUrl = ServiceUtility.EncodeValues(documentData.DocumentUrl); + documentData.DocumentOWAUrl = ServiceUtility.EncodeValues(documentData.DocumentOWAUrl); + documentData.DocumentExtension = ServiceUtility.EncodeValues(documentData.DocumentExtension); + documentData.DocumentCreatedDate = ServiceUtility.EncodeValues(documentData.DocumentCreatedDate); + documentData.DocumentModifiedDate = ServiceUtility.EncodeValues(documentData.DocumentModifiedDate); + documentData.DocumentCheckoutUser = ServiceUtility.EncodeValues(documentData.DocumentCheckoutUser); + documentData.DocumentMatterUrl = ServiceUtility.EncodeValues(documentData.DocumentMatterUrl); + documentData.DocumentParentUrl = ServiceUtility.EncodeValues(documentData.DocumentParentUrl); + documentData.DocumentID = ServiceUtility.EncodeValues(documentData.DocumentID); + pinRequestDocumentVM.DocumentData = documentData; + return await Task.FromResult(search.PinDocument(pinRequestDocumentVM)); + } + + + /// + /// UnPin the record for the information that has been passed + /// + /// + /// + /// bool + public async Task UnPinRecordAsync(T pinRequestData) + { + PinRequestDocumentVM pinRequestDocumentVM = (PinRequestDocumentVM)Convert.ChangeType(pinRequestData, typeof(PinRequestDocumentVM)); + return await Task.FromResult(search.UnPinDocument(pinRequestDocumentVM)); + } + + public async Task GetDocumentAndClientGUIDAsync(Client client) + { + return await Task.FromResult(spList.GetDocumentAndClientGUID(client)); + } + + public void SetUploadItemProperties(ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, Dictionary mailProperties) + { + spList.SetUploadItemProperties(clientContext, documentLibraryName, fileName, folderPath, mailProperties); + } + + + + public void CreateFileInsideFolder(ClientContext clientContext, string folderPath, FileCreationInformation newFile) + { + spList.CreateFileInsideFolder(clientContext, folderPath, newFile); + } + + + public Stream DownloadAttachments(string attachmentUrl) + { + return spList.DownloadAttachments(attachmentUrl); + } + + + + public bool FolderExists(string folderPath, ClientContext clientContext, string documentLibraryName) + { + return spList.FolderExists(folderPath, clientContext, documentLibraryName); + } + + public bool PerformContentCheck(ClientContext context, MemoryStream localMemoryStream, string serverFileURL) + { + return spList.PerformContentCheck(context, localMemoryStream, serverFileURL); + } + + public DuplicateDocument DocumentExists(ClientContext clientContext, ContentCheckDetails contentCheck, string documentLibraryName, string folderPath, bool isMail) + { + DuplicateDocument duplicateDocument = new DuplicateDocument(false, false); + if (null != clientContext && null != contentCheck && !string.IsNullOrEmpty(documentLibraryName) && !string.IsNullOrEmpty(folderPath)) + { + string serverRelativePath = folderPath + ServiceConstants.FORWARD_SLASH + contentCheck.FileName; + string camlQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.GetAllFilesInFolderQuery, serverRelativePath); + ListItemCollection listItemCollection = null; + listItemCollection = spList.GetData(clientContext, documentLibraryName, camlQuery); + duplicateDocument.DocumentExists = (null != listItemCollection && 0 < listItemCollection.Count) ? true : false; + // Check file size, from, sent date as well. + if (duplicateDocument.DocumentExists) + { + // check for other conditions as well. + ListItem listItem = listItemCollection.FirstOrDefault(); + DateTime sentDate, storedFileSentDate; + long fileSize = Convert.ToInt64(listItem.FieldValues[mailSettings.SearchEmailFileSize], CultureInfo.InvariantCulture); + if (isMail) + { + // check for subject, from and sent date + string subject = Convert.ToString(listItem.FieldValues[mailSettings.SearchEmailSubject], CultureInfo.InvariantCulture); + string from = Convert.ToString(listItem.FieldValues[mailSettings.SearchEmailFrom], CultureInfo.InvariantCulture); + bool isValidDateFormat; + isValidDateFormat = DateTime.TryParse(Convert.ToString(listItem.FieldValues[mailSettings.SearchEmailSentDate], CultureInfo.InvariantCulture), out storedFileSentDate); + isValidDateFormat &= DateTime.TryParse(contentCheck.SentDate, out sentDate); + if (isValidDateFormat) + { + TimeSpan diffrence = sentDate - storedFileSentDate; + uint tolleranceMin = Convert.ToUInt16(mailSettings.SentDateTolerance, CultureInfo.InvariantCulture); // up to how much minutes difference between uploaded files is tolerable + duplicateDocument.HasPotentialDuplicate = ((fileSize == contentCheck.FileSize) && (subject.Trim() == contentCheck.Subject.Trim()) && (from.Trim() == contentCheck.FromField.Trim()) && (diffrence.Minutes < tolleranceMin)); + } + } + else + { + duplicateDocument.HasPotentialDuplicate = (fileSize == contentCheck.FileSize); + } + } + } + return duplicateDocument; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/IDocumentRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/IDocumentRepository.cs new file mode 100644 index 00000000..499173a9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Document/IDocumentRepository.cs @@ -0,0 +1,43 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This interface contains all the document related functionalities +// *********************************************************************** + + +using Microsoft.SharePoint.Client; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +#region Matter Related Namespaces +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.AspNetCore.Http; +#endregion + + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// Interface matter repository contains all document related methods such as finding document, pin, unpin, document etc + /// + public interface IDocumentRepository:ICommonRepository + { + Task GetDocumentsAsync(SearchRequestVM searchRequestVM); + Task GetDocumentAndClientGUIDAsync(Client client); + void SetUploadItemProperties(ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, Dictionary mailProperties); + + void CreateFileInsideFolder(ClientContext clientContext, string folderPath, FileCreationInformation newFile); + bool FolderExists(string folderPath, ClientContext clientContext, string documentLibraryName); + bool PerformContentCheck(ClientContext context, MemoryStream localMemoryStream, string serverFileURL); + DuplicateDocument DocumentExists(ClientContext clientContext, ContentCheckDetails contentCheck, string documentLibraryName, string folderPath, bool isMail); + GenericResponseVM UploadDocument(string folderName, IFormFile uploadedFile, string fileName, Dictionary mailProperties, string clientUrl, string folder, string documentLibraryName); + + Stream DownloadAttachments(string attachmentUrl); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/ICommonRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/ICommonRepository.cs new file mode 100644 index 00000000..4395326c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/ICommonRepository.cs @@ -0,0 +1,15 @@ +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ICommonRepository + { + Task GetPinnedRecordsAsync(Client client); + Task PinRecordAsync(T pinData); + Task UnPinRecordAsync(T unpinData); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/IMatterRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/IMatterRepository.cs new file mode 100644 index 00000000..935c98b4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/IMatterRepository.cs @@ -0,0 +1,80 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This interface contains all the matter related functionalities +// *********************************************************************** + +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.WebParts; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// Interface matter repository contains all matter related methods such as finding matter, creating matter, pin, inpin, update matter etc + /// + public interface IMatterRepository: ICommonRepository + { + Task GetMattersAsync(SearchRequestVM searchRequestVM); + Task> GetFolderHierarchyAsync(MatterData matterData); + + Task GetConfigurationsAsync(string siteCollectionUrl); + IList ResolveUserNames(Client client, IList userNames); + IList RoleCheck(string url, string listName, string columnName); + List> CheckUserSecurity(Client client, Matter matter, IList userIds); + PropertyValues GetStampedProperties(ClientContext clientContext, string libraryname); + + IEnumerable FetchUserPermissionForLibrary(ClientContext clientContext, string libraryname); + string GetMatterName(ClientContext clientContext, string matterName); + int RetrieveItemId(ClientContext clientContext, string matterLandingPageRepositoryName, string originalMatterName); + List MatterAssociatedLists(ClientContext clientContext, string matterName, MatterConfigurations matterConfigurations = null); + bool UpdatePermission(ClientContext clientContext, Matter matter, List users, string loggedInUserTitle, bool isListItem, string listName, int matterLandingPageId, bool isEditMode); + bool UpdateMatterStampedProperties(ClientContext clientContext, MatterDetails matterDetails, Matter matter, PropertyValues matterStampedProperties, bool isEditMode); + void AssignRemoveFullControl(ClientContext clientContext, Matter matter, string loggedInUser, int listItemId, List listExists, bool assignFullControl, bool hasFullPermission); + bool RevertMatterUpdates(Client client, Matter matter, ClientContext clientContext, MatterRevertList matterRevertListObject, string loggedInUserTitle, IEnumerable oldUserPermissions, int matterLandingPageId, bool isEditMode); + void SetPropertBagValuesForList(ClientContext clientContext, PropertyValues props, string matterName, Dictionary propertyList); + bool AddItem(ClientContext clientContext, List list, IList columns, IList values); + GenericResponseVM DeleteMatter(Client client, Matter matter); + GenericResponseVM ValidateTeamMembers(ClientContext clientContext, Matter matter, IList userId); + GenericResponseVM SaveConfigurationToList(MatterConfigurations matterConfigurations, ClientContext clientContext, string cachedItemModifiedDate); + ListItem GetItem(ClientContext clientContext, string listName, string listQuery); + bool SetPermission(ClientContext clientContext, IList> assignUserName, IList permissions, string listName); + IList GetContentTypeData(ClientContext clientContext, IList contentTypes, Client client, Matter matter); + GenericResponseVM AssignContentTypeHelper(MatterMetadata matterMetadata, ClientContext clientContext, IList contentTypeCollection, Client client, Matter matter); + List Exists(Client client, ReadOnlyCollection lists); + bool IsPageExists(ClientContext clientContext, string pageUrl); + bool CheckPermissionOnList(ClientContext clientContext, string listName, PermissionKind permission); + bool CreateList(ClientContext clientContext, ListInformation listInformation); + bool BreakPermission(ClientContext clientContext, string libraryName, bool isCopyRoleAssignment); + string AddOneNote(ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle); + bool SaveMatter(Client client, Matter matter, string matterListName, MatterConfigurations matterConfigurations, string matterSiteURL); + int CreateWebPartPage(ClientContext clientContext, string pageName, string layout, string masterpagelistName, string listName, string pageTitle); + bool BreakItemPermission(ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment); + bool SetItemPermission(ClientContext clientContext, IList> assignUserName, string listName, int listItemId, IList permissions); + string[] ConfigureXMLCodeOfWebParts(Client client, Matter matter, ClientContext clientContext, string pageName, Uri uri, + Web web, MatterConfigurations matterConfigurations); + bool AddWebPart(ClientContext clientContext, LimitedWebPartManager limitedWebPartManager, WebPartDefinition webPartDefinition, + string[] webParts, string[] zones); + GenericResponseVM ShareMatterToExternalUser(MatterInformationVM matterInformation); + + GenericResponseVM UpdateMatter(MatterInformationVM matterInformation); + bool CanCreateMatter(Client client); + + /// + /// The implementatioon of this method will save matter configutations in sharepoint list + /// + /// + /// + GenericResponseVM SaveConfigurations(ClientContext clientContext, MatterConfigurations matterConfigurations); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/MatterRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/MatterRepository.cs new file mode 100644 index 00000000..ae549361 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Matter/MatterRepository.cs @@ -0,0 +1,1444 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This class deals with all the matter related functions such as finding matter, pin, unpin, update matter etc +// *********************************************************************** + +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using System.Threading.Tasks; +using System; +using System.Collections.Generic; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Utilities; +using System.Globalization; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using Newtonsoft.Json; +using System.Reflection; +using Microsoft.SharePoint.Client.WebParts; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class MatterRepository:IMatterRepository + { + private ISearch search; + private ISPList spList; + private MatterSettings matterSettings; + private SearchSettings searchSettings; + private CamlQueries camlQueries; + private ListNames listNames; + private IUsersDetails userdetails; + private ISPOAuthorization spoAuthorization; + private ISPPage spPage; + private ErrorSettings errorSettings; + private ISPContentTypes spContentTypes; + private IExternalSharing extrnalSharing; + private IUserRepository userRepositoy; + private GeneralSettings generalSettings; + + /// + /// Constructory which will inject all the related dependencies related to matter + /// + /// + public MatterRepository(ISearch search, + IOptions matterSettings, + IOptions searchSettings, + IOptions listNames, + ISPOAuthorization spoAuthorization, + ISPContentTypes spContentTypes, + IExternalSharing extrnalSharing, + IUserRepository userRepositoy, + ISPList spList, + IOptions camlQueries, + IOptions generalSettings, + IUsersDetails userdetails, + IOptions errorSettings, + + ISPPage spPage) + { + this.search = search; + this.matterSettings = matterSettings.Value; + this.searchSettings = searchSettings.Value; + this.listNames = listNames.Value; + this.spList = spList; + this.camlQueries = camlQueries.Value; + this.userdetails = userdetails; + this.spoAuthorization = spoAuthorization; + this.spPage = spPage; + this.errorSettings = errorSettings.Value; + this.generalSettings = generalSettings.Value; + this.spContentTypes = spContentTypes; + this.extrnalSharing = extrnalSharing; + this.userRepositoy = userRepositoy; + } + + /// + /// + /// + /// + /// + /// + public GenericResponseVM SaveConfigurations(ClientContext clientContext, MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponse = null; + try + { + string listQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.MatterConfigurationsListQuery, + searchSettings.ManagedPropertyTitle, searchSettings.MatterConfigurationTitleValue); + ListItemCollection collection = spList.GetData(clientContext, listNames.MatterConfigurationsList, listQuery); + // Set the default value for conflict check flag + matterConfigurations.IsContentCheck = matterSettings.IsContentCheck; + if (0 == collection.Count) + { + List columnNames = new List() { searchSettings.MatterConfigurationColumn, + searchSettings.ManagedPropertyTitle }; + List columnValues = new List() { WebUtility.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)), + searchSettings.MatterConfigurationTitleValue }; + Web web = clientContext.Web; + List list = web.Lists.GetByTitle(listNames.MatterConfigurationsList); + spList.AddItem(clientContext, list, columnNames, columnValues); + } + else + { + bool response = spList.CheckItemModified(collection, matterConfigurations.CachedItemModifiedDate); + if (response) + { + foreach (ListItem item in collection) + { + item[searchSettings.MatterConfigurationColumn] = WebUtility.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)); + item.Update(); + break; + } + } + else + { + genericResponse = new GenericResponseVM() + { + Code = errorSettings.IncorrectTeamMembersCode, + Value = errorSettings.IncorrectTeamMembersMessage + }; + } + } + if (genericResponse == null) + { + clientContext.ExecuteQuery(); + } + + listQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.MatterConfigurationsListQuery, + searchSettings.ManagedPropertyTitle, searchSettings.MatterConfigurationTitleValue); + ListItem settingsItem = spList.GetData(clientContext, listNames.MatterConfigurationsList, listQuery).FirstOrDefault(); + if (null != settingsItem) + { + string cachedItemModifiedDate = Convert.ToString(settingsItem[searchSettings.ColumnNameModifiedDate], CultureInfo.InvariantCulture); + genericResponse = new GenericResponseVM() + { + Code = "", + Value = cachedItemModifiedDate, + IsError = false + }; + } + } + catch (Exception exception) + { + //result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); + } + return genericResponse; + } + + /// + /// This method will check whether login user can create matter or not + /// + /// The sharepoint site collection in which we need to check whether the login user is present in the sharepoint group or not + /// + public bool CanCreateMatter(Client client) + { + return spList.CheckPermissionOnList(client, matterSettings.SendMailListName, PermissionKind.EditListItems); + } + + public GenericResponseVM UpdateMatter(MatterInformationVM matterInformation) + { + var matter = matterInformation.Matter; + var matterDetails = matterInformation.MatterDetails; + var client = matterInformation.Client; + int listItemId = -1; + string loggedInUserName = ""; + bool isEditMode = matterInformation.EditMode; + ClientContext clientContext = null; + IEnumerable userPermissionOnLibrary = null; + GenericResponseVM genericResponse = null; + try + { + clientContext = spoAuthorization.GetClientContext(matterInformation.Client.Url); + PropertyValues matterStampedProperties = GetStampedProperties(clientContext, matter.Name); + loggedInUserName = userRepositoy.GetLoggedInUserDetails(clientContext).Name; + + + // Get matter library current permissions + userPermissionOnLibrary = FetchUserPermissionForLibrary(clientContext, matter.Name); + string originalMatterName = GetMatterName(clientContext, matter.Name); + listItemId = RetrieveItemId(clientContext, matterSettings.MatterLandingPageRepositoryName, originalMatterName); + List usersToRemove = RetrieveMatterUsers(userPermissionOnLibrary); + bool hasFullPermission = CheckFullPermissionInAssignList(matter.AssignUserNames, matter.Permissions, loggedInUserName); + List listExists = MatterAssociatedLists(clientContext, matter.Name); + AssignRemoveFullControl(clientContext, matter, loggedInUserName, listItemId, listExists, true, hasFullPermission); + bool result = false; + if (listExists.Contains(matter.Name)) + { + result = UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.OneNoteLibrarySuffix)) + { + result = UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.OneNoteLibrarySuffix, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.CalendarNameSuffix)) + { + result = UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.CalendarNameSuffix, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.TaskNameSuffix)) + { + result = UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.TaskNameSuffix, -1, isEditMode); + } + if (0 <= listItemId) + { + result = UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, true, matterSettings.MatterLandingPageRepositoryName, listItemId, isEditMode); + } + // Update matter metadata + result = UpdateMatterStampedProperties(clientContext, matterDetails, matter, matterStampedProperties, isEditMode); + if (result) + { + return genericResponse; + } + } + catch (Exception ex) + { + MatterRevertList matterRevertListObject = new MatterRevertList() + { + MatterLibrary = matter.Name, + MatterOneNoteLibrary = matter.Name + matterSettings.OneNoteLibrarySuffix, + MatterCalendar = matter.Name + matterSettings.CalendarNameSuffix, + MatterTask = matter.Name + matterSettings.TaskNameSuffix, + MatterSitePages = matterSettings.MatterLandingPageRepositoryName + }; + RevertMatterUpdates(client, matter, clientContext, matterRevertListObject, loggedInUserName, + userPermissionOnLibrary, listItemId, isEditMode); + } + return ServiceUtility.GenericResponse("9999999", "Error in updating matter information"); + } + + /// + /// Gets the display name of users having permission on library. + /// + /// Users having permission on library + /// + internal List RetrieveMatterUsers(IEnumerable userPermissionOnLibrary) + { + List users = new List(); + try + { + if (null != userPermissionOnLibrary && 0 < userPermissionOnLibrary.Count()) + { + foreach (RoleAssignment roles in userPermissionOnLibrary) + { + users.Add(roles.Member.Title); + } + } + } + catch (Exception) + { + throw; + } + return users; + } + + /// + /// Check Full Permission for logged in User. + /// + /// List of Assigned UserNames + /// List of Permission + /// Name of logged in User + /// Status of Full Permission + internal bool CheckFullPermissionInAssignList(IList> AssignUserNames, IList Permissions, string loggedInUserName) + { + bool result = false; + if (null != Permissions && null != AssignUserNames && Permissions.Count == AssignUserNames.Count) + { + int position = 0; + foreach (string roleName in Permissions) + { + IList assignUserNames = AssignUserNames[position]; + if (!string.IsNullOrWhiteSpace(roleName) && null != assignUserNames) + { + foreach (string user in assignUserNames) + { + if (!string.IsNullOrWhiteSpace(user) && user.Trim().Equals(loggedInUserName.Trim())) + { + if (roleName == matterSettings.EditMatterAllowedPermissionLevel) + { + return true; + } + } + } + } + position++; + } + return result; + } + return result; + } + + public bool CreateList(ClientContext clientContext, ListInformation listInformation) + { + return spList.CreateList(clientContext, listInformation); + } + + public bool BreakItemPermission(ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment) + { + return spList.BreakItemPermission(clientContext, listName, listItemId, isCopyRoleAssignment); + } + + public bool BreakPermission(ClientContext clientContext, string libraryName, bool isCopyRoleAssignment) + { + return spList.BreakPermission(clientContext, libraryName, isCopyRoleAssignment); + } + + public bool CheckPermissionOnList(ClientContext clientContext, string listName, PermissionKind permission) + { + return spList.CheckPermissionOnList(clientContext, listName, permission); + } + + public GenericResponseVM ValidateTeamMembers(ClientContext clientContext, Matter matter, IList userId) + { + bool isInvalidUser = false; + int iCounter = 0, teamMembersRowCount = matter.AssignUserEmails.Count(), iCount = 0; + List teamMemberPrincipalCollection = new List(); + GenericResponseVM genericResponse = null; + try + { + for (iCounter = 0; iCounter < teamMembersRowCount; iCounter++) + { + IList userList = matter.AssignUserEmails[iCounter].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); + IList userNameList = matter.AssignUserNames[iCounter].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); + foreach (string userName in userList) + { + //Check has been made to check whether the user is present in the system as part of external sharing implementation + if (!string.IsNullOrWhiteSpace(userName) && userdetails.CheckUserPresentInMatterCenter(clientContext, userName)) + { + Principal teamMemberPrincipal = clientContext.Web.EnsureUser(userName.Trim()); + clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); + teamMemberPrincipalCollection.Add(teamMemberPrincipal); + } + } + //Check has been made to check whether the user is present in the system as part of external sharing implementation + if (teamMemberPrincipalCollection.Count > 0) + { + clientContext.ExecuteQuery(); + //// Check whether the name entered by the user and the name resolved by SharePoint is same. + foreach (string teamMember in userNameList) + { + if (!string.Equals(teamMember.Trim(), teamMemberPrincipalCollection[0].Title.Trim(), StringComparison.OrdinalIgnoreCase)) + { + genericResponse = new GenericResponseVM(); + //result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR + userId[iCounter]); + genericResponse.Code = errorSettings.IncorrectTeamMembersCode; + genericResponse.Code = errorSettings.IncorrectTeamMembersMessage + ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR + userId[iCounter]; + isInvalidUser = true; + break; + } + iCount++; + } + } + if (isInvalidUser) + { + break; // To break the outer loop as there is an invalid user + } + teamMemberPrincipalCollection = new List(); + } + } + catch (Exception) + { + throw; + } + return genericResponse; + } + + /// + /// Checks if the lists exist + /// + /// + /// + /// + /// + public List Exists(Client client, ReadOnlyCollection lists) + { + List listExists = spList.Exists(client, lists); + return listExists; + } + + public GenericResponseVM SaveConfigurationToList(MatterConfigurations matterConfigurations, ClientContext clientContext, string cachedItemModifiedDate) + { + string result = string.Empty; + GenericResponseVM genericResponse = null; + try + { + string listQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.MatterConfigurationsListQuery, searchSettings.ManagedPropertyTitle, searchSettings.MatterConfigurationTitleValue); + ListItemCollection collection = spList.GetData(clientContext, listNames.MatterConfigurationsList, listQuery); + // Set the default value for conflict check flag + matterConfigurations.IsContentCheck = matterSettings.IsContentCheck; + if (0 == collection.Count) + { + List columnNames = new List() { matterSettings.MatterConfigurationColumn, searchSettings.ManagedPropertyTitle }; + List columnValues = new List() { WebUtility.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)), searchSettings.MatterConfigurationTitleValue }; + Web web = clientContext.Web; + List list = web.Lists.GetByTitle(listNames.MatterConfigurationsList); + spList.AddItem(clientContext, list, columnNames, columnValues); + } + else + { + bool response = spList.CheckItemModified(collection, cachedItemModifiedDate); + if (response) + { + foreach (ListItem item in collection) + { + item[matterSettings.MatterConfigurationColumn] = WebUtility.HtmlEncode(JsonConvert.SerializeObject(matterConfigurations)); + item.Update(); + break; + } + } + else + { + //result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectTeamMembersCode, ServiceConstantStrings.IncorrectTeamMembersMessage + ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR); + genericResponse = new GenericResponseVM() + { + Code = errorSettings.IncorrectTeamMembersCode, + Value = errorSettings.IncorrectTeamMembersMessage + }; + } + } + if (genericResponse == null) + { + clientContext.ExecuteQuery(); + genericResponse = new GenericResponseVM() + { + Code = "200", + Value = true.ToString() + }; + }; + } + catch (Exception exception) + { + //result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); + throw; + } + return genericResponse; + } + + public bool IsPageExists(ClientContext clientContext, string pageUrl) + { + return spPage.PageExists(pageUrl, clientContext); + } + + public ListItem GetItem(ClientContext clientContext, string listName, string listQuery) + { + ListItem settingsItem = spList.GetData(clientContext, listName, listQuery).FirstOrDefault(); + return settingsItem; + } + + public IList ResolveUserNames(Client client, IList userNames) + { + return userdetails.ResolveUserNames(client, userNames); + } + + public IList ResolveUserNames(ClientContext clientContext, IList userNames) + { + return userdetails.ResolveUserNames(clientContext, userNames); + } + + /// + /// This method will try to fetch all the matters that are provisioned by the user + /// + /// + /// + public async Task GetMattersAsync(SearchRequestVM searchRequestVM) + { + return await Task.FromResult(search.GetMatters(searchRequestVM)); + } + + public bool AddItem(ClientContext clientContext, List list, IList columns, IList values) + { + return spList.AddItem(clientContext, list, columns, values); + } + + /// + /// This method will try to fetch all the matters that are provisioned by the user + /// + /// + /// + public async Task GetPinnedRecordsAsync(Client client) + { + return await Task.FromResult(search.GetPinnedData(client, listNames.UserPinnedMatterListName, + searchSettings.PinnedListColumnMatterDetails, false)); + } + + public int CreateWebPartPage(ClientContext clientContext, string pageName, string layout, string masterpagelistName, string listName, string pageTitle) + { + return spPage.CreateWebPartPage(clientContext, pageName, layout, masterpagelistName, listName, pageTitle); + } + + public bool SaveMatter(Client client, Matter matter, string matterListName, MatterConfigurations matterConfigurations, string matterSiteURL) + { + bool returnFlag = false; + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(matterSiteURL)) + { + if (!string.IsNullOrWhiteSpace(matterListName) && null != matter && null != client) + { + FieldUserValue tempUser = null; + List blockUserList = null; + List> assignUserList = null; + + List columnNames = new List() + { + matterSettings.MattersListColumnTitle, + matterSettings.MattersListColumnClientName, + matterSettings.MattersListColumnClientID, + matterSettings.MattersListColumnMatterName, + matterSettings.MattersListColumnMatterID + }; + List columnValues = new List() + { + string.Concat(client.Name, ServiceConstants.UNDER_SCORE, matter.Name), + client.Name, + client.Id, + matter.Name, + matter.Id + }; + + if (matterConfigurations.IsConflictCheck) + { + + if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.CheckBy)) + { + tempUser = ResolveUserNames(clientContext, new List() { matter.Conflict.CheckBy }).FirstOrDefault(); + columnNames.Add(matterSettings.MattersListColumnConflictCheckBy); + columnValues.Add(tempUser); + if (!string.IsNullOrWhiteSpace(matter.Conflict.CheckOn)) + { + columnNames.Add(matterSettings.MattersListColumnConflictCheckOn); + columnValues.Add(Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture)); + } + + columnNames.Add(matterSettings.MattersListColumnConflictIdentified); + columnValues.Add(Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)); + } + + if (null != matter.BlockUserNames) + { + blockUserList = new List(); + blockUserList = ResolveUserNames(clientContext, matter.BlockUserNames).ToList(); + columnNames.Add(matterSettings.MattersListColumnBlockUsers); + columnValues.Add(blockUserList); + } + } + + if (null != matter.AssignUserEmails) + { + assignUserList = new List>(); + foreach (IList assignUsers in matter.AssignUserEmails) + { + List tempAssignUserList = ResolveUserNames(clientContext, assignUsers).ToList(); + assignUserList.Add(tempAssignUserList); + } + + if (0 != assignUserList.Count && null != matter.Roles && 0 != matter.Roles.Count) + { + int assignPosition = 0; + List managingAttorneyList = new List(); + List teamMemberList = new List(); + foreach (string role in matter.Roles) + { + switch (role) + { + case ServiceConstants.MANAGING_ATTORNEY_VALUE: + managingAttorneyList.AddRange(assignUserList[assignPosition]); + break; + default: + teamMemberList.AddRange(assignUserList[assignPosition]); + break; + } + + assignPosition++; + } + + columnNames.Add(matterSettings.MattersListColumnManagingAttorney); + columnValues.Add(managingAttorneyList); + columnNames.Add(matterSettings.MattersListColumnSupport); + columnValues.Add(teamMemberList); + } + } + + Web web = clientContext.Web; + List matterList = web.Lists.GetByTitle(matterListName); + // To avoid the invalid symbol error while parsing the JSON, return the response in lower case + returnFlag = spList.AddItem(clientContext, matterList, columnNames, columnValues); + } + } + } + catch (Exception exception) + { + //customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + return returnFlag; + } + + + + public IList RoleCheck(string url, string listName, string columnName) + { + ListItemCollection collListItem = spList.GetData(generalSettings.CentralRepositoryUrl, + listNames.DMSRoleListName, + camlQueries.DMSRoleQuery); + IList roles = new List(); + roles = collListItem.AsEnumerable().Select(roleList => Convert.ToString(roleList[matterSettings.RoleListColumnRoleName], + CultureInfo.InvariantCulture)).ToList(); + //if (matter.Roles.Except(roles).Count() > 0) + //{ + // returnValue = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, TextConstants.IncorrectInputUserRolesCode, TextConstants.IncorrectInputUserRolesMessage); + //} + return roles; + } + + public GenericResponseVM DeleteMatter(Client client, Matter matter) + { + GenericResponseVM genericResponse = null; + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + string stampResult = spList.GetPropertyValueForList(clientContext, matter.Name, matterSettings.StampedPropertySuccess); + if (0 != string.Compare(stampResult, ServiceConstants.TRUE, StringComparison.OrdinalIgnoreCase)) + { + IList lists = new List(); + lists.Add(matter.Name); + lists.Add(string.Concat(matter.Name, matterSettings.CalendarNameSuffix)); + lists.Add(string.Concat(matter.Name, matterSettings.OneNoteLibrarySuffix)); + lists.Add(string.Concat(matter.Name, matterSettings.TaskNameSuffix)); + bool bListDeleted = spList.Delete(clientContext, lists); + if (bListDeleted) + { + //result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.DeleteMatterCode, TextConstants.MatterDeletedSuccessfully); + genericResponse = ServiceUtility.GenericResponse(matterSettings.DeleteMatterCode, matterSettings.MatterDeletedSuccessfully); + } + else + { + //result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.DeleteMatterCode, ServiceConstantStrings.MatterNotPresent); + genericResponse = ServiceUtility.GenericResponse(matterSettings.DeleteMatterCode, matterSettings.MatterNotPresent); + } + Uri clientUri = new Uri(client.Url); + string matterLandingPageUrl = string.Concat(clientUri.AbsolutePath, ServiceConstants.FORWARD_SLASH, + matterSettings.MatterLandingPageRepositoryName.Replace(ServiceConstants.SPACE, string.Empty), + ServiceConstants.FORWARD_SLASH, matter.MatterGuid, ServiceConstants.ASPX_EXTENSION); + spPage.Delete(clientContext, matterLandingPageUrl); + return ServiceUtility.GenericResponse("", "Matter deleted successfully"); + } + else + { + return ServiceUtility.GenericResponse(errorSettings.MatterLibraryExistsCode, + errorSettings.ErrorDuplicateMatter + ServiceConstants.MATTER + ServiceConstants.DOLLAR + + MatterPrerequisiteCheck.LibraryExists); + } + } + } + + /// + /// Create a new pin for the information that has been passed + /// + /// + /// + /// + public async Task PinRecordAsync(T pinRequestData) + { + PinRequestMatterVM pinRequestMatterVM = (PinRequestMatterVM)Convert.ChangeType(pinRequestData, typeof(PinRequestMatterVM)); + var matterData = pinRequestMatterVM.MatterData; + matterData.MatterName = ServiceUtility.EncodeValues(matterData.MatterName); + matterData.MatterDescription = ServiceUtility.EncodeValues(matterData.MatterDescription); + matterData.MatterCreatedDate = ServiceUtility.EncodeValues(matterData.MatterCreatedDate); + matterData.MatterUrl = ServiceUtility.EncodeValues(matterData.MatterUrl); + matterData.MatterPracticeGroup = ServiceUtility.EncodeValues(matterData.MatterPracticeGroup); + matterData.MatterAreaOfLaw = ServiceUtility.EncodeValues(matterData.MatterAreaOfLaw); + matterData.MatterSubAreaOfLaw = ServiceUtility.EncodeValues(matterData.MatterSubAreaOfLaw); + matterData.MatterClientUrl = ServiceUtility.EncodeValues(matterData.MatterClientUrl); + matterData.MatterClient = ServiceUtility.EncodeValues(matterData.MatterClient); + matterData.MatterClientId = ServiceUtility.EncodeValues(matterData.MatterClientId); + matterData.HideUpload = ServiceUtility.EncodeValues(matterData.HideUpload); + matterData.MatterID = ServiceUtility.EncodeValues(matterData.MatterID); + matterData.MatterResponsibleAttorney = ServiceUtility.EncodeValues(matterData.MatterResponsibleAttorney); + matterData.MatterModifiedDate = ServiceUtility.EncodeValues(matterData.MatterModifiedDate); + matterData.MatterGuid = ServiceUtility.EncodeValues(matterData.MatterGuid); + matterData.PinType = ServiceUtility.EncodeValues(matterData.PinType); + pinRequestMatterVM.MatterData = matterData; + return await Task.FromResult(search.PinMatter(pinRequestMatterVM)); + } + + /// + /// Unpin the matter + /// + /// + /// + /// + public async Task UnPinRecordAsync(T pinRequestData) + { + PinRequestMatterVM pinRequestMatterVM = (PinRequestMatterVM)Convert.ChangeType(pinRequestData, typeof(PinRequestMatterVM)); + return await Task.FromResult(search.UnPinMatter(pinRequestMatterVM)); + } + + /// + /// Get the folder hierarchy + /// + /// + /// + public async Task> GetFolderHierarchyAsync(MatterData matterData) + { + return await Task.FromResult(spList.GetFolderHierarchy(matterData)); + } + + + + + + + + public string AddOneNote(ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle) + { + return spList.AddOneNote(clientContext, clientAddressPath, oneNoteLocation, listName, oneNoteTitle); + } + + /// + /// + /// + /// + /// + public async Task GetConfigurationsAsync(string siteCollectionUrl) + { + return await Task.FromResult(search.GetConfigurations(siteCollectionUrl, listNames.MatterConfigurationsList)); + } + + public List> CheckUserSecurity(Client client, Matter matter, IList userIds) + { + List> teamMemberPrincipalCollection = userdetails.GetUserPrincipal(client, matter, userIds); + return teamMemberPrincipalCollection; + + } + + public PropertyValues GetStampedProperties(ClientContext clientContext, string libraryname) + { + return spList.GetListProperties(clientContext, libraryname); + } + + + + public IEnumerable FetchUserPermissionForLibrary(ClientContext clientContext, string libraryname) + { + return spList.FetchUserPermissionForLibrary(clientContext, libraryname); + } + + public string GetMatterName(ClientContext clientContext, string matterName) + { + PropertyValues propertyValues = spList.GetListProperties(clientContext, matterName); + return propertyValues.FieldValues.ContainsKey(matterSettings.StampedPropertyMatterGUID) ? + WebUtility.HtmlDecode(Convert.ToString(propertyValues.FieldValues[matterSettings.StampedPropertyMatterGUID], CultureInfo.InvariantCulture)) : matterName; + } + + public int RetrieveItemId(ClientContext clientContext, string libraryName, string originalMatterName) + { + int listItemId = -1; + ListItemCollection listItemCollection = spList.GetData(clientContext, libraryName); + clientContext.Load(listItemCollection, listItemCollectionProperties => + listItemCollectionProperties.Include( + listItemProperties => listItemProperties.Id, + listItemProperties => listItemProperties.DisplayName)); + clientContext.ExecuteQuery(); + + ListItem listItem = listItemCollection.Cast().FirstOrDefault(listItemProperties => listItemProperties.DisplayName.ToUpper(CultureInfo.InvariantCulture).Equals(originalMatterName.ToUpper(CultureInfo.InvariantCulture))); + + if (null != listItem) + { + listItemId = listItem.Id; + } + return listItemId; + } + + public List MatterAssociatedLists(ClientContext clientContext, string matterName, MatterConfigurations matterConfigurations = null) + { + List lists = new List(); + lists.Add(matterName); + lists.Add(matterName + matterSettings.OneNoteLibrarySuffix); + if (null == matterConfigurations || matterConfigurations.IsCalendarSelected) + { + lists.Add(matterName + matterSettings.CalendarNameSuffix); + } + if (null == matterConfigurations || matterConfigurations.IsTaskSelected) + { + lists.Add(matterName + matterSettings.TaskNameSuffix); + } + List listExists = spList.MatterAssociatedLists(clientContext, new ReadOnlyCollection(lists)); + return listExists; + } + + public bool SetItemPermission(ClientContext clientContext, IList> assignUserName, string listName, int listItemId, IList permissions) + { + return spList.SetItemPermission(clientContext, assignUserName, listName, listItemId, permissions); + } + + public string[] ConfigureXMLCodeOfWebParts(Client client, Matter matter, ClientContext clientContext, string pageName, Uri uri, + Web web, MatterConfigurations matterConfigurations) + { + return spPage.ConfigureXMLCodeOfWebParts(client, matter, clientContext, pageName, uri, web, matterConfigurations); + } + + public bool AddWebPart(ClientContext clientContext, LimitedWebPartManager limitedWebPartManager, WebPartDefinition webPartDefinition, + string[] webParts, string[] zones) + { + return spPage.AddWebPart(clientContext, limitedWebPartManager, webPartDefinition, webParts, zones); + } + + /// + /// Remove old users and assign permissions to new users. + /// + /// ClientContext object + /// RequestObject + /// Client object + /// Matter object + /// List of users to remove + /// ListItem or list + /// List object + /// List item id + /// Add/ Edit mode + /// + public bool UpdatePermission(ClientContext clientContext, Matter matter, List users, + string loggedInUserTitle, bool isListItem, string listName, int matterLandingPageId, bool isEditMode) + { + bool result = false; + try + { + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + if (isEditMode) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, isListItem, listName, matterLandingPageId); + } + // Add permission + if (!isListItem) + { + result = spList.SetPermission(clientContext, matter.AssignUserNames, matter.Permissions, listName); + } + else + { + result = spList.SetItemPermission(clientContext, matter.AssignUserNames, matterSettings.MatterLandingPageRepositoryName, + matterLandingPageId, matter.Permissions); + } + } + } + catch (Exception) + { + throw; + } + // To avoid the invalid symbol error while parsing the JSON, return the response in lower case + return result; + } + + + /// + /// Removes the users' permission from list or list item. + /// + /// ClientContext object + /// List of users + /// ListItem or list + /// List object + /// List item id + private void RemoveSpecificUsers(ClientContext clientContext, List usersToRemove, string loggedInUserTitle, + bool isListItem, string listName, int matterLandingPageId) + { + try + { + ListItem listItem = null; + RoleAssignmentCollection roleCollection = null; + Microsoft.SharePoint.Client.Web web = clientContext.Web; + List list = web.Lists.GetByTitle(listName); + clientContext.Load(list); + clientContext.ExecuteQuery(); + if (0 < usersToRemove.Count) + { + if (isListItem) + { + // Fetch the list item + if (0 <= matterLandingPageId) + { + listItem = list.GetItemById(matterLandingPageId); + clientContext.Load(listItem, listItemProperties => + listItemProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, + roleAssignmentProperties => roleAssignmentProperties.Member.Title, + roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, + roleDef => roleDef.BasePermissions))); + clientContext.ExecuteQuery(); + roleCollection = listItem.RoleAssignments; + } + } + else + { + clientContext.Load(list, listProperties => + listProperties.RoleAssignments.Include(roleAssignmentProperties => roleAssignmentProperties.Member, + roleAssignmentProperties => roleAssignmentProperties.Member.Title, + roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, + roleDef => roleDef.BasePermissions))); + clientContext.ExecuteQuery(); + roleCollection = list.RoleAssignments; + } + + if (null != roleCollection && 0 < roleCollection.Count && 0 < usersToRemove.Count) + { + foreach (string user in usersToRemove) + { + foreach (RoleAssignment role in roleCollection) + { + List roleDefinationList = new List(); + foreach (RoleDefinition roleDef in role.RoleDefinitionBindings) + { + // Removing permission for all the user except current user with full control + // Add those users in list, then traverse the list and removing all users from that list + if (role.Member.Title == user && !((role.Member.Title == loggedInUserTitle) && (roleDef.Name == + matterSettings.EditMatterAllowedPermissionLevel))) + { + roleDefinationList.Add(roleDef); + } + } + foreach (RoleDefinition roleDef in roleDefinationList) + { + role.RoleDefinitionBindings.Remove(roleDef); + } + role.Update(); + } + } + } + clientContext.ExecuteQuery(); + } + } + catch (Exception) + { + throw; + } + + } + + + + public bool UpdateMatterStampedProperties(ClientContext clientContext, MatterDetails matterDetails, + Matter matter, PropertyValues matterStampedProperties, bool isEditMode) + { + + try + { + if (null != clientContext && null != matter && null != matterDetails && (0 < matterStampedProperties.FieldValues.Count)) + { + Dictionary propertyList = new Dictionary(); + + // Get existing stamped properties + string stampedUsers = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyMatterCenterUsers); + string stampedUserEmails = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyMatterCenterUserEmails); + string stampedPermissions = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyMatterCenterPermissions); + string stampedRoles = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyMatterCenterRoles); + string stampedResponsibleAttorneys = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyResponsibleAttorney); + string stampedResponsibleAttorneysEmail = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyResponsibleAttorneyEmail); + string stampedTeamMembers = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyTeamMembers); + string stampedBlockedUploadUsers = GetStampPropertyValue(matterStampedProperties.FieldValues, matterSettings.StampedPropertyBlockedUploadUsers); + + string currentPermissions = string.Join(ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, matter.Permissions.Where(user => !string.IsNullOrWhiteSpace(user))); + string currentRoles = string.Join(ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, matter.Roles.Where(user => !string.IsNullOrWhiteSpace(user))); + string currentBlockedUploadUsers = string.Join(ServiceConstants.SEMICOLON, matterDetails.UploadBlockedUsers.Where(user => !string.IsNullOrWhiteSpace(user))); + string currentUsers = GetMatterAssignedUsers(matter); + string currentUserEmails = spList.GetMatterAssignedUsersEmail(clientContext, matter); + + string finalMatterPermissions = string.IsNullOrWhiteSpace(stampedPermissions) || isEditMode ? currentPermissions : string.Concat(stampedPermissions, ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, currentPermissions); + string finalMatterRoles = string.IsNullOrWhiteSpace(stampedRoles) || isEditMode ? currentRoles : string.Concat(stampedRoles, ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, currentRoles); + string finalResponsibleAttorneys = string.IsNullOrWhiteSpace(stampedResponsibleAttorneys) || isEditMode ? matterDetails.ResponsibleAttorney : string.Concat(stampedResponsibleAttorneys, ServiceConstants.SEMICOLON, matterDetails.ResponsibleAttorney); + string finalTeamMembers = string.IsNullOrWhiteSpace(stampedTeamMembers) || isEditMode ? matterDetails.TeamMembers : string.Concat(stampedTeamMembers, ServiceConstants.SEMICOLON, matterDetails.TeamMembers); + string finalMatterCenterUsers = string.IsNullOrWhiteSpace(stampedUsers) || isEditMode ? currentUsers : string.Concat(stampedUsers, ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, currentUsers); + string finalBlockedUploadUsers = string.IsNullOrWhiteSpace(stampedBlockedUploadUsers) || isEditMode ? currentBlockedUploadUsers : string.Concat(stampedBlockedUploadUsers, ServiceConstants.SEMICOLON, currentBlockedUploadUsers); + string finalMatterCenterUserEmails = string.IsNullOrWhiteSpace(stampedUserEmails) || isEditMode ? currentUserEmails : string.Concat(stampedUserEmails, ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, currentUserEmails); + string finalResponsibleAttorneysEmail = string.IsNullOrWhiteSpace(stampedResponsibleAttorneysEmail) || isEditMode ? matterDetails.ResponsibleAttorneyEmail : string.Concat(stampedResponsibleAttorneysEmail, ServiceConstants.SEMICOLON, matterDetails.ResponsibleAttorneyEmail); + + var finalMatterUsersList = finalMatterCenterUsers.Replace("$|$", "$").Split('$').ToList(); + var finalTeamMembersList = finalTeamMembers.Replace(";;", "$").Split('$').ToList(); + var finalMatterPermissionsList = finalMatterPermissions.Replace("$|$", "$").Split('$').ToList(); + var finalMatterRolesList = finalMatterRoles.Replace("$|$", "$").Split('$').ToList(); + var finalMatterCenterUserEmailsList = finalMatterCenterUserEmails.Replace("$|$", "$").Split('$').ToList(); + var finalResponsibleAttorneysEmailList = finalResponsibleAttorneysEmail.Replace("$|$", "$").Split('$').ToList(); + var finalResponsibleAttorneysUsersList = finalResponsibleAttorneys.Replace(";;", "$").Split('$').ToList(); + + #region Remove all the external users from the request object so that only internal users are added to the matter + //Once the external users accepted the invitation, those external users will be added to the matter by azure web app job + List itemsToRemove = new List(); + + for(int i=0; i< finalMatterUsersList.Count; i++) + { + if(userdetails.CheckUserPresentInMatterCenter(clientContext, finalMatterUsersList[i]) ==false) + { + itemsToRemove.Add(i); + } + } + + if (itemsToRemove.Count > 0) + { + for (int i = 0; i < itemsToRemove.Count; i++) + { + finalMatterUsersList[itemsToRemove[i]] = string.Empty; + finalTeamMembersList[itemsToRemove[i]] = string.Empty; + finalMatterPermissionsList[itemsToRemove[i]] = string.Empty; + finalMatterRolesList[itemsToRemove[i]] = string.Empty; + finalMatterCenterUserEmailsList[itemsToRemove[i]] = string.Empty; + if (finalResponsibleAttorneysEmailList.Count > itemsToRemove[i] && finalResponsibleAttorneysEmailList[itemsToRemove[i]] != null) + { + finalResponsibleAttorneysEmailList[itemsToRemove[i]] = string.Empty; + finalResponsibleAttorneysUsersList[itemsToRemove[i]] = string.Empty; + } + + } + finalMatterUsersList = finalMatterUsersList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalTeamMembersList = finalTeamMembersList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalMatterPermissionsList = finalMatterPermissionsList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalMatterRolesList = finalMatterRolesList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalResponsibleAttorneysEmailList = finalResponsibleAttorneysEmailList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalResponsibleAttorneysUsersList = finalResponsibleAttorneysUsersList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + + var finalMatterUsersArray = finalMatterUsersList.ToArray(); + var finalTeamMembersArray = finalTeamMembersList.ToArray(); + var finalMatterPermissionsArray = finalMatterPermissionsList.ToArray(); + var finalMatterRolesArray = finalMatterRolesList.ToArray(); + var finalMatterCenterUserEmailsArray = finalMatterCenterUserEmailsList.ToArray(); + var finalResponsibleAttorneysEmailArray = finalResponsibleAttorneysEmailList.ToArray(); + var finalResponsibleAttorneysUsersArray = finalResponsibleAttorneysUsersList.ToArray(); + + finalMatterCenterUsers = string.Join("$|$", finalMatterUsersArray); + finalTeamMembers = string.Join(";;", finalTeamMembersArray); + finalMatterCenterUserEmails = string.Join("$|$", finalMatterCenterUserEmailsArray); + finalMatterPermissions = string.Join("$|$", finalMatterPermissionsArray); + finalMatterRoles = string.Join("$|$", finalMatterRolesArray); + finalResponsibleAttorneysEmail = string.Join("$|$", finalResponsibleAttorneysEmailArray); + finalResponsibleAttorneys = string.Join("$|$", finalResponsibleAttorneysUsersArray); + } + #endregion + + propertyList.Add(matterSettings.StampedPropertyResponsibleAttorney, WebUtility.HtmlEncode(finalResponsibleAttorneys)); + propertyList.Add(matterSettings.StampedPropertyResponsibleAttorneyEmail, WebUtility.HtmlEncode(finalResponsibleAttorneysEmail)); + propertyList.Add(matterSettings.StampedPropertyTeamMembers, WebUtility.HtmlEncode(finalTeamMembers)); + propertyList.Add(matterSettings.StampedPropertyBlockedUploadUsers, WebUtility.HtmlEncode(finalBlockedUploadUsers)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterRoles, WebUtility.HtmlEncode(finalMatterRoles)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterPermissions, WebUtility.HtmlEncode(finalMatterPermissions)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterUsers, WebUtility.HtmlEncode(finalMatterCenterUsers)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterUserEmails, WebUtility .HtmlEncode(finalMatterCenterUserEmails)); + spList.SetPropertBagValuesForList(clientContext, matterStampedProperties, matter.Name, propertyList); + + #region Update matter and matterdetails object to have only external users so that notification can be send to those external users + //For each external user, an entry will be created in the azure table storage and that entry will contain only the information related to the + //external user, such as his role, his permission etc + itemsToRemove.Clear(); + List itemsToRemoveAttorneys = new List(); + + int l = 0; + finalResponsibleAttorneysEmailList = matterDetails.ResponsibleAttorneyEmail.Split(';').ToList(); + finalResponsibleAttorneysUsersList = matterDetails.ResponsibleAttorney.Split(';').ToList(); + foreach (string userName in finalResponsibleAttorneysUsersList) + { + if (!string.IsNullOrWhiteSpace(userName) && userdetails.CheckUserPresentInMatterCenter(clientContext, userName) == true) + { + itemsToRemoveAttorneys.Add(l); + } + l = l + 1; + } + if (itemsToRemoveAttorneys.Count > 0) + { + for (int k = 0; k < itemsToRemoveAttorneys.Count; k++) + { + if (finalResponsibleAttorneysEmailList.Count > itemsToRemoveAttorneys[k] && + finalResponsibleAttorneysEmailList[itemsToRemoveAttorneys[k]] != null) + { + finalResponsibleAttorneysUsersList[itemsToRemoveAttorneys[k]] = string.Empty; + finalResponsibleAttorneysEmailList[itemsToRemoveAttorneys[k]] = string.Empty; + } + } + finalResponsibleAttorneysUsersList = finalResponsibleAttorneysUsersList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalResponsibleAttorneysEmailList = finalResponsibleAttorneysEmailList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + } + l = 0; + + //Check if any of the assigned team member is not an external user? + foreach (IList userNames in matter.AssignUserNames) + { + if (userdetails.CheckUserPresentInMatterCenter(clientContext, + userNames.Where(user => !string.IsNullOrWhiteSpace(user)).SingleOrDefault()) == true) + { + itemsToRemove.Add(l); + } + l = l + 1; + } + finalTeamMembersList = matterDetails.TeamMembers.Replace(";;", "$").Split('$').ToList(); + if (itemsToRemove.Count > 0) + { + for (int k = 0; k < itemsToRemove.Count; k++) + { + matter.Permissions[itemsToRemove[k]] = string.Empty; + matter.Roles[itemsToRemove[k]] = string.Empty; + matter.AssignUserEmails[itemsToRemove[k]] = null; + matter.AssignUserNames[itemsToRemove[k]] = null; + finalTeamMembersList[itemsToRemove[k]] = string.Empty; + } + } + + matter.Permissions = matter.Permissions.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + matter.Roles = matter.Roles.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + finalTeamMembersList = finalTeamMembersList.Where(s => !string.IsNullOrWhiteSpace(s)).ToList(); + matter.AssignUserEmails = matter.AssignUserEmails.Where(s => s != null).ToList(); + matter.AssignUserNames = matter.AssignUserNames.Where(s => s != null).ToList(); + + + matterDetails.ResponsibleAttorneyEmail = string.Empty; + matterDetails.ResponsibleAttorney = string.Empty; + matterDetails.TeamMembers = string.Join(";;", finalTeamMembersList.ToArray()); + matterDetails.ResponsibleAttorneyEmail = string.Join(";", finalResponsibleAttorneysEmailList.ToArray()); + matterDetails.ResponsibleAttorney = string.Join(";", finalResponsibleAttorneysUsersList.ToArray()); + #endregion + + return true; + } + } + catch (Exception ex) + { + throw; //// This will transfer control to catch block of parent function. + } + return false; + } + + public void SetPropertBagValuesForList(ClientContext clientContext, PropertyValues props, string matterName, Dictionary propertyList) + { + spList.SetPropertBagValuesForList(clientContext, props, matterName, propertyList); + } + + /// + /// Assign or Remove Full Control base on parameter given. + /// + /// Client context object + /// Matter object + /// Name of logged in user + /// List of existed list + /// ID of the list + /// Flag to determine Assign or Remove Permission + public void AssignRemoveFullControl(ClientContext clientContext, Matter matter, string loggedInUser, + int listItemId, List listExists, bool assignFullControl, bool hasFullPermission) + { + IList> currentUser = new List>(); + IList currentLoggedInUser = new List() { loggedInUser }; + currentUser.Add(currentLoggedInUser); + + IList permission = new List() { matterSettings.EditMatterAllowedPermissionLevel }; + + if (assignFullControl) + { + //Assign full control to Matter + if (listExists.Contains(matter.Name)) + { + spList.SetPermission(clientContext, currentUser, permission, matter.Name); + } + //Assign full control to OneNote + if (listExists.Contains(matter.Name + matterSettings.OneNoteLibrarySuffix)) + { + spList.SetPermission(clientContext, currentUser, permission, matter.Name + matterSettings.OneNoteLibrarySuffix); + } + // Assign full control to Task list + if (listExists.Contains(matter.Name + matterSettings.TaskNameSuffix)) + { + spList.SetPermission(clientContext, currentUser, permission, matter.Name + matterSettings.TaskNameSuffix); + } + //Assign full control to calendar + if (listExists.Contains(matter.Name + matterSettings.CalendarNameSuffix)) + { + spList.SetPermission(clientContext, currentUser, permission, matter.Name + matterSettings.CalendarNameSuffix); + } + // Assign full control to Matter Landing page + if (0 <= listItemId) + { + spList.SetItemPermission(clientContext, currentUser, matterSettings.MatterLandingPageRepositoryName, listItemId, permission); + } + } + else + { + if (!hasFullPermission) + { + //Remove full control to Matter + if (listExists.Contains(matter.Name)) + { + RemoveFullControl(clientContext, matter.Name, loggedInUser, false, -1); + } + //Remove full control to OneNote + if (listExists.Contains(matter.Name + matterSettings.OneNoteLibrarySuffix)) + { + RemoveFullControl(clientContext, matter.Name + matterSettings.OneNoteLibrarySuffix, loggedInUser, false, -1); + } + // Remove full control to Task list + if (listExists.Contains(matter.Name + matterSettings.TaskNameSuffix)) + { + RemoveFullControl(clientContext, matter.Name + matterSettings.TaskNameSuffix, loggedInUser, false, -1); + } + //Remove full control to calendar + if (listExists.Contains(matter.Name + matterSettings.CalendarNameSuffix)) + { + RemoveFullControl(clientContext, matter.Name + matterSettings.CalendarNameSuffix, loggedInUser, false, -1); + } + if (0 <= listItemId) + { + RemoveFullControl(clientContext, matterSettings.MatterLandingPageRepositoryName, loggedInUser, true, listItemId); + } + } + } + } + + /// + /// Reverts the permission of users from matter, OneNote, Calendar libraries and matter landing page + /// + /// Request object + /// Client object + /// Matter object + /// ClientContext object + /// MatterRevertObjectList object + /// Logged-in user title + /// Old library users + /// List item id + /// Add/ Edit mode + /// Status of operation + public bool RevertMatterUpdates(Client client, Matter matter, ClientContext clientContext, + MatterRevertList matterRevertListObject, string loggedInUserTitle, IEnumerable oldUserPermissions, + int matterLandingPageId, bool isEditMode) + { + bool result = false; + try + { + if (null != client && null != matter && null != clientContext && null != matterRevertListObject) + { + List users = new List(); + users = matter.AssignUserNames.SelectMany(user => user).Distinct().ToList(); + + // Remove recently added users + if (null != matterRevertListObject.MatterLibrary) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterLibrary, -1); + } + if (null != matterRevertListObject.MatterCalendar) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterCalendar, -1); + } + if (null != matterRevertListObject.MatterOneNoteLibrary) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterOneNoteLibrary, -1); + } + if (null != matterRevertListObject.MatterTask) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, false, matterRevertListObject.MatterTask, -1); + } + if (null != matterRevertListObject.MatterSitePages) + { + RemoveSpecificUsers(clientContext, users, loggedInUserTitle, true, matterRevertListObject.MatterSitePages, matterLandingPageId); + } + + if (isEditMode) + { + Matter matterRevertUserPermission = PrepareUserPermission(oldUserPermissions); + if (null != matterRevertListObject.MatterLibrary) + { + result = spList.SetPermission(clientContext, matterRevertUserPermission.AssignUserNames, matterRevertUserPermission.Permissions, matterRevertListObject.MatterLibrary); + } + if (null != matterRevertListObject.MatterOneNoteLibrary) + { + result = spList.SetPermission(clientContext, matterRevertUserPermission.AssignUserNames, matterRevertUserPermission.Permissions, matterRevertListObject.MatterOneNoteLibrary); + } + if (null != matterRevertListObject.MatterCalendar) + { + result = spList.SetPermission(clientContext, matterRevertUserPermission.AssignUserNames, matterRevertUserPermission.Permissions, matterRevertListObject.MatterCalendar); + } + if (null != matterRevertListObject.MatterTask) + { + result = spList.SetPermission(clientContext, matterRevertUserPermission.AssignUserNames, matterRevertUserPermission.Permissions, matterRevertListObject.MatterTask); + } + if (null != matterRevertListObject.MatterSitePages && 0 <= matterLandingPageId) + { + result = spList.SetItemPermission(clientContext, matterRevertUserPermission.AssignUserNames, matterSettings.MatterLandingPageRepositoryName, matterLandingPageId, matterRevertUserPermission.Permissions); + } + } + } + return result; + } + catch (Exception exception) + { + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstants.LogTableName); + } + // To avoid the invalid symbol error while parsing the JSON, return the response in lower case + return result; + } + + public IList GetContentTypeData(ClientContext clientContext, IList contentTypes, Client client, Matter matter) + { + return spContentTypes.GetContentTypeData(clientContext, contentTypes, client, matter); + } + + public GenericResponseVM AssignContentTypeHelper(MatterMetadata matterMetadata, ClientContext clientContext, IList contentTypeCollection, Client client, Matter matter) + { + return spContentTypes.AssignContentTypeHelper(matterMetadata, clientContext, contentTypeCollection, client, matter); + } + + + /// + /// Fetches the users to remove permission. + /// + /// Users having permission on library + /// Matter object containing user name and permissions + internal Matter PrepareUserPermission(IEnumerable userPermissions) + { + Matter matterUserPermission = new Matter(); + matterUserPermission.AssignUserNames = new List>(); + matterUserPermission.Permissions = new List(); + + if (null != userPermissions && 0 < userPermissions.Count()) + { + foreach (RoleAssignment userPermission in userPermissions) + { + foreach (RoleDefinition roleDefinition in userPermission.RoleDefinitionBindings) + { + matterUserPermission.AssignUserNames.Add(new List { userPermission.Member.Title }); + matterUserPermission.Permissions.Add(roleDefinition.Name); + } + } + } + return matterUserPermission; + } + + /// + /// Remove Full Permission. + /// + /// Client context object + /// Name of the list + /// Name of logged in User + internal void RemoveFullControl(ClientContext clientContext, string listName, string currentLoggedInUser, bool isListItem, int matterLandingPageId) + { + ListItem listItem = null; + RoleAssignmentCollection roleCollection = null; + List list = clientContext.Web.Lists.GetByTitle(listName); + clientContext.Load(list); + clientContext.ExecuteQuery(); + if (isListItem) + { + // Fetch the list item + if (0 <= matterLandingPageId) + { + listItem = list.GetItemById(matterLandingPageId); + clientContext.Load(listItem, listProperties => listProperties.RoleAssignments.Include(roleAssignmentProperties => + roleAssignmentProperties.Member, + roleAssignmentProperties => roleAssignmentProperties.Member.Title, + roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions))); + clientContext.ExecuteQuery(); + roleCollection = listItem.RoleAssignments; + } + } + else + { + clientContext.Load(list, listProperties => listProperties.RoleAssignments.Include(roleAssignmentProperties => + roleAssignmentProperties.Member, + roleAssignmentProperties => roleAssignmentProperties.Member.Title, + roleAssignmentProperties => roleAssignmentProperties.RoleDefinitionBindings.Include(roleDef => roleDef.Name, roleDef => roleDef.BasePermissions))); + clientContext.ExecuteQuery(); + roleCollection = list.RoleAssignments; + } + + + if (null != roleCollection && 0 < roleCollection.Count) + { + foreach (RoleAssignment role in roleCollection) + { + if (role.Member.Title == currentLoggedInUser) + { + IList roleDefinationList = new List(); + foreach (RoleDefinition roleDef in role.RoleDefinitionBindings) + { + if (roleDef.Name == matterSettings.EditMatterAllowedPermissionLevel) + { + roleDefinationList.Add(roleDef); + } + } + foreach (RoleDefinition roleDef in roleDefinationList) + { + role.RoleDefinitionBindings.Remove(roleDef); + } + } + role.Update(); + } + } + clientContext.ExecuteQuery(); + + } + + /// + /// Checks if the property exists in property bag. Returns the value for the property from property bag. + /// + /// Dictionary object containing matter property bag key/value pairs + /// Key to check in dictionary + /// Property bag value for + internal string GetStampPropertyValue(Dictionary stampedPropertyValues, string key) + { + string result = string.Empty; + if (stampedPropertyValues.ContainsKey(key)) + { + result = WebUtility.HtmlDecode(Convert.ToString(stampedPropertyValues[key], CultureInfo.InvariantCulture)); + } + + // This is just to check for null value in key, if exists + return (!string.IsNullOrWhiteSpace(result)) ? result : string.Empty; + } + + /// + /// Converts the matter users in a form that can be stamped to library. + /// + /// Matter object + /// Users that can be stamped + private string GetMatterAssignedUsers(Matter matter) + { + string currentUsers = string.Empty; + string separator = string.Empty; + if (null != matter && 0 < matter.AssignUserNames.Count) + { + foreach (IList userNames in matter.AssignUserNames) + { + currentUsers += separator + string.Join(ServiceConstants.SEMICOLON, userNames.Where(user => !string.IsNullOrWhiteSpace(user))); + separator = ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR; + } + } + return currentUsers; + } + + public bool SetPermission(ClientContext clientContext, IList> assignUserName, IList permissions, string listName) + { + return spList.SetPermission(clientContext, assignUserName, permissions, listName); + } + + + public GenericResponseVM ShareMatterToExternalUser(MatterInformationVM matterInformation) + { + return extrnalSharing.ShareMatter(matterInformation); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Microsoft.Legal.MatterCenter.Repository.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Microsoft.Legal.MatterCenter.Repository.xproj new file mode 100644 index 00000000..a05bd4a0 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Microsoft.Legal.MatterCenter.Repository.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + 636bc580-b03a-4523-b3ca-ecb24596560d + Microsoft.Legal.MatterCenter.Repository + .\obj + .\bin + v4.6 + + + + 2.0 + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..2374808a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Repository")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Repository")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("636bc580-b03a-4523-b3ca-ecb24596560d")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Extensions/TaxonomyExtensions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Extensions/TaxonomyExtensions.cs new file mode 100644 index 00000000..d378e25c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Extensions/TaxonomyExtensions.cs @@ -0,0 +1,97 @@ +using Microsoft.SharePoint.Client.Taxonomy; +using System; +using Microsoft.SharePoint.Client; + +namespace Microsoft.Legal.MatterCenter.Repository.Extensions +{ + public static class TaxonomyExtensions + { + /// + /// This method will load the child terms for a particular parent term with required term properties + /// + /// Parent Term + /// SharePoint Context + /// + public static TermCollection LoadTerms(this Term term, ClientContext context) + { + TermCollection termCollection = term.Terms; + context.Load(termCollection, + tc => tc.Include( + t => t.TermsCount, + t => t.Id, + t => t.Name, + t => t.TermsCount, + t => t.CustomProperties + ) + ); + context.ExecuteQuery(); + return termCollection; + } + + /// + /// This method will check if the term exists and if it exists, it will return the reference to that term + /// + /// The term set underwhich, the term exists check will happen + /// The sharepoint client context object + /// The term path under which we need to check for a term existence + /// The term that needs to be retrieved from a given term + /// The term reference that will be returned back to the caller + /// + public static bool TermExists(this TermSet termSet, ClientContext clientContext, string termNameToRetrieve, ref Term term) + { + TermCollection termCollection = termSet.GetAllTerms(); + clientContext.Load(termCollection, + tc => tc.Include( + t => t.Name, + t => t.PathOfTerm, + t => t.TermsCount, + t=>t.Parent.Name + + )); + clientContext.ExecuteQuery(); + foreach (Term currentTerm in termCollection) + { + string pathOfTerm = currentTerm.PathOfTerm; + //ClientResult pathOfTerm = currentTerm.GetPath(1033); + if (currentTerm.Name.ToLower() == termNameToRetrieve.ToLower()) + { + term = currentTerm; + return true; + } + } + return false; + } + + /// + /// This extension method will give all the terms for a give path mentioned + /// + /// From which term set, we need to find a given term path + /// The path name to search + /// The sharepoint client context object + /// + public static TermCollection GetTermsByPath(this TermSet termSet, String path, ClientContext clientContext) + { + TermCollection termCollection = termSet.GetAllTerms(); + TermCollection termCollectionToReturn = null; + clientContext.Load(termCollection, + tc=>tc.Include( + t=>t.Name, + t=>t.PathOfTerm, + t=>t.TermsCount + )); + clientContext.ExecuteQuery(); + foreach(Term term in termCollection) + { + if(term.PathOfTerm == path) + { + //Get all the terms under that path + if (term.TermsCount > 0) + { + termCollectionToReturn = term.LoadTerms(clientContext); + } + } + } + return termCollectionToReturn; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/ExternalSharing.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/ExternalSharing.cs new file mode 100644 index 00000000..bf463116 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/ExternalSharing.cs @@ -0,0 +1,151 @@ +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Sharing; +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Azure; +using Microsoft.WindowsAzure.Storage; +using Microsoft.WindowsAzure.Storage.Table; +using System.Globalization; +using Microsoft.SharePoint.ApplicationPages.ClientPickerQuery; +using Microsoft.SharePoint.Client.Utilities; +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class ExternalSharing:IExternalSharing + { + private ISPOAuthorization spoAuthorization; + private ListNames listNames; + private GeneralSettings generalSettings; + private MatterSettings matterSettings; + private LogTables logTables; + private IUsersDetails userDetails; + public ExternalSharing(ISPOAuthorization spoAuthorization, IOptions listNames, + IOptions generalSettings, + IOptions matterSettings, + IOptions logTables, IUsersDetails userDetails) + { + this.spoAuthorization = spoAuthorization; + this.listNames = listNames.Value; + this.generalSettings = generalSettings.Value; + this.matterSettings = matterSettings.Value; + this.logTables = logTables.Value; + this.userDetails = userDetails; + } + /// + /// This method will store the external sharing request in a list called "MatterCenterExternalRequests" + /// and send notification to the external user regarding the information that is getting shared + /// + /// + /// + public GenericResponseVM ShareMatter(MatterInformationVM matterInformation) + { + var tempMatterInformation = matterInformation; + int index = 0; + foreach (var assignUserEmails in matterInformation.Matter.AssignUserEmails) + { + foreach (string email in assignUserEmails) + { + //First check whether the user exists in SharePoint or not + if (!string.IsNullOrWhiteSpace(email) && userDetails.CheckUserPresentInMatterCenter(generalSettings.SiteURL, email) == false) + { + //If not, store external request in a list + SaveExternalSharingRequest(matterInformation); + //Send notification to the user with appropriate information + SendExternalNotification(matterInformation, + matterInformation.Matter.Permissions[index], + matterInformation.Matter.AssignUserEmails[index][0]); + } + + } + index = index + 1; + } + return null; + } + + + + /// + /// This method will store external requests information in Azure Table Storage + /// + /// + /// + private void SaveExternalSharingRequest(MatterInformationVM matterInformation) + { + try + { + CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(generalSettings.CloudStorageConnectionString); + CloudTableClient tableClient = cloudStorageAccount.CreateCloudTableClient(); + tableClient.DefaultRequestOptions = new TableRequestOptions + { + PayloadFormat = TablePayloadFormat.JsonNoMetadata + }; + // Retrieve a reference to the table. + CloudTable table = tableClient.GetTableReference(logTables.ExternalAccessRequests); + // Create the table if it doesn't exist. + table.CreateIfNotExists(); + //Insert the entity into Table Storage + matterInformation.PartitionKey = matterInformation.Matter.Name; + matterInformation.RowKey = $"{Guid.NewGuid().ToString()}${matterInformation.Matter.Id}"; + matterInformation.Status = "Pending"; + string matterInformationObject = Newtonsoft.Json.JsonConvert.SerializeObject(matterInformation); + matterInformation.SerializeMatter = matterInformationObject; + TableOperation insertOperation = TableOperation.Insert(matterInformation); + table.Execute(insertOperation); + } + catch (Exception ex) + { + throw; + } + } + + /// + /// This method will send notifications to external users + /// + /// + /// + private GenericResponseVM SendExternalNotification(MatterInformationVM matterInformation, string permission, string externalEmail) + { + var clientUrl = $"{matterInformation.Client.Url}"; + try + { + var users = new List(); + UserRoleAssignment userRole = new UserRoleAssignment(); + userRole.UserId = externalEmail; + switch (permission.ToLower()) + { + case "full control": + userRole.Role = SharePoint.Client.Sharing.Role.Owner; + break; + case "contribute": + userRole.Role = SharePoint.Client.Sharing.Role.Edit; + break; + case "read": + userRole.Role = SharePoint.Client.Sharing.Role.View; + break; + } + users.Add(userRole); + #region Doc Sharing API + //Need to use MatterGuid instead of Id + string matterLandingPageUrl = $"{clientUrl}/sitepages/{matterInformation.Matter.MatterGuid + ServiceConstants.ASPX_EXTENSION}"; + string catalogSiteAssetsLibraryUrl = $"{generalSettings.CentralRepositoryUrl}/SitePages/home.aspx"; + using (var clientContext = spoAuthorization.GetClientContext(clientUrl)) + { + //Send notification to the matter landing page url with permission the user has selected + IList matterLandingPageResult = DocumentSharingManager.UpdateDocumentSharingInfo(clientContext, + matterLandingPageUrl, + users, true, true, true, "The following matter page has been shared with you", true, true); + clientContext.ExecuteQuery(); + } + return null; + #endregion + } + catch (Exception ex) + { + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IExternalSharing.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IExternalSharing.cs new file mode 100644 index 00000000..afc7a7ab --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IExternalSharing.cs @@ -0,0 +1,10 @@ +using Microsoft.Legal.MatterCenter.Models; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface IExternalSharing + { + GenericResponseVM ShareMatter(MatterInformationVM matterInformation); + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPContentTypes.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPContentTypes.cs new file mode 100644 index 00000000..5e1d6bc6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPContentTypes.cs @@ -0,0 +1,15 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISPContentTypes + { + IList GetContentTypeData(ClientContext clientContext, IList contentTypes, Client client, Matter matter); + GenericResponseVM AssignContentTypeHelper(MatterMetadata matterMetadata, ClientContext clientContext, IList contentTypeCollection, Client client, Matter matter); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPList.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPList.cs new file mode 100644 index 00000000..049f3f0c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPList.cs @@ -0,0 +1,48 @@ + +using Microsoft.AspNetCore.Http; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISPList + { + + ListItemCollection GetData(ClientContext clientContext, string listName, string camlQuery = null); + ListItemCollection GetData(Client client, string listName, string camlQuery = null); + ListItemCollection GetData(string url, string listName, string camlQuery = null); + dynamic GetDocumentAndClientGUID(Client client); + List GetFolderHierarchy(MatterData matterData); + bool CheckPermissionOnList(ClientContext clientContext, string listName, PermissionKind permission); + bool CheckPermissionOnList(Client client, string listName, PermissionKind permission); + bool CheckPermissionOnList(string url, string listName, PermissionKind permission); + List Exists(Client client, ReadOnlyCollection lists); + + List MatterAssociatedLists(ClientContext clientContext, ReadOnlyCollection lists); + PropertyValues GetListProperties(ClientContext clientContext, string libraryname); + IEnumerable FetchUserPermissionForLibrary(ClientContext clientContext, string libraryname); + bool SetPermission(ClientContext clientContext, IList> assignUserName, IList permissions, string listName); + bool SetItemPermission(ClientContext clientContext, IList> assignUserName, string listName, int listItemId, IList permissions); + void SetPropertBagValuesForList(ClientContext clientContext, PropertyValues props, string matterName, Dictionary propertyList); + bool AddItem(ClientContext clientContext, List list, IList columns, IList values); + string GetPropertyValueForList(ClientContext clientContext, string matterName, string propertyList); + bool Delete(ClientContext clientContext, IList lists); + bool CheckItemModified(ListItemCollection collection, string cachedItemModifiedDate); + bool AddView(ClientContext clientContext, List matterList, string[] viewColumnList, string viewName, string strQuery); + void SetUploadItemProperties(ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, Dictionary mailProperties); + void CreateFileInsideFolder(ClientContext clientContext, string folderPath, FileCreationInformation newFile); + bool FolderExists(string folderPath, ClientContext clientContext, string documentLibraryName); + bool PerformContentCheck(ClientContext context, MemoryStream localMemoryStream, string serverFileURL); + bool CreateList(ClientContext clientContext, ListInformation listInformation); + bool BreakPermission(ClientContext clientContext, string libraryName, bool isCopyRoleAssignment); + string AddOneNote(ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle); + bool BreakItemPermission(ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment); + GenericResponseVM UploadDocument(string folderName, IFormFile uploadedFile, string fileName, Dictionary mailProperties, string clientUrl, string folder, string documentLibraryName); + Stream DownloadAttachments(string attachmentUrl); + string GetMatterAssignedUsersEmail(ClientContext clientContext, Matter matter); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPPage.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPPage.cs new file mode 100644 index 00000000..d7fad4aa --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISPPage.cs @@ -0,0 +1,21 @@ + +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.WebParts; +using System; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISPPage + { + bool UrlExists(Client client, string pageUrl); + void Delete(ClientContext clientContext, string pageUrl); + bool IsFileExists(ClientContext clientContext, string pageUrl); + bool PageExists(string requestedUrl, ClientContext clientContext); + int CreateWebPartPage(ClientContext clientContext, string pageName, string layout, string masterpagelistName, string listName, string pageTitle); + string[] ConfigureXMLCodeOfWebParts(Client client, Matter matter, ClientContext clientContext, string pageName, Uri uri, + Web web, MatterConfigurations matterConfigurations); + bool AddWebPart(ClientContext clientContext, LimitedWebPartManager limitedWebPartManager, WebPartDefinition webPartDefinition, + string[] webParts, string[] zones); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISearch.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISearch.cs new file mode 100644 index 00000000..14b00f38 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISearch.cs @@ -0,0 +1,22 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISearch + { + SearchResponseVM GetMatters(SearchRequestVM searchRequestVM); + SearchResponseVM GetDocuments(SearchRequestVM searchRequestVM); + SearchResponseVM GetPinnedData(Client client, string listName, string listColumnName, bool isShowDocument); + bool PinMatter(PinRequestMatterVM pinRequestMatterVM); + bool UnPinMatter(PinRequestMatterVM pinRequestMatterVM); + bool PinDocument(PinRequestDocumentVM pinRequestDocumentVM); + bool UnPinDocument(PinRequestDocumentVM pinRequestDocumentVM); + List GetMatterHelp(Client client, string selectedPage, string listName); + List GetWebRoleDefinitions(Client client); + IList SearchUsers(SearchRequestVM searchRequestVM); + GenericResponseVM GetConfigurations(string siteCollectionUrl, string listName); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISite.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISite.cs new file mode 100644 index 00000000..13323f75 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ISite.cs @@ -0,0 +1,14 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISite + { + string GetCurrentSite(Client client); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ITaxonomy.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ITaxonomy.cs new file mode 100644 index 00000000..fb021f0e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/ITaxonomy.cs @@ -0,0 +1,14 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ITaxonomy + { + TaxonomyResponseVM GetTaxonomyHierarchy (Client client, TermStoreDetails termStoreDetails); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IUsersDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IUsersDetails.cs new file mode 100644 index 00000000..1ac4a709 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Interfaces/IUsersDetails.cs @@ -0,0 +1,36 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Repository +// Author : v-lapedd +// Created : 07-07-2016 +//*************************************************************************** + +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file provide methods to get information related to user + +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; + +using Microsoft.Legal.MatterCenter.Models; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This interface constains all the methods which help in getting or updating user details or permissions in SharePoint + /// + public interface IUsersDetails + { + Users GetLoggedInUserDetails(ClientContext clientContext); + Users GetLoggedInUserDetails(Client client); + IList ResolveUserNames(Client client, IList userNames); + IList ResolveUserNames(ClientContext clientContext, IList userNames); + List> GetUserPrincipal(Client client, Matter matter, IList userIds); + Users GetUserProfilePicture(Client client); + bool CheckUserPresentInMatterCenter(string clientUrl, string email); + bool CheckUserPresentInMatterCenter(ClientContext clientContext, string email); + //bool CheckUserPermissionsInGroup(Client client, string groupName); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPContentTypes.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPContentTypes.cs new file mode 100644 index 00000000..a2b15cb7 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPContentTypes.cs @@ -0,0 +1,284 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Taxonomy; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class SPContentTypes:ISPContentTypes + { + + private ContentTypesConfig contentTypesConfig; + private TaxonomySettings taxonomySettings; + private ICustomLogger customLogger; + private LogTables logTables; + private CamlQueries camlQueries; + private ISPList spList; + private IConfigurationRoot configuration; + public SPContentTypes(IOptions contentTypesConfig, IOptions camlQueries, ISPList spList, + ICustomLogger customLogger, IOptions logTables, IOptions taxonomySettings, IConfigurationRoot configuration + ) + { + this.contentTypesConfig = contentTypesConfig.Value; + this.taxonomySettings = taxonomySettings.Value; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.camlQueries = camlQueries.Value; + this.spList = spList; + this.configuration = configuration; + } + + /// + /// This method will get all content types from the specified content type group and will filter out the content types that user has selected + /// when creating the matter + /// + /// The sharepoint context object + /// Content Type Names that user selected in the create matter screen + /// The client object which contains information for which client the matter is getting created and the url of the client + /// The matter information that is getting created + /// + public IList GetContentTypeData(ClientContext clientContext, IList contentTypesNames, Client client, Matter matter) + { + ContentTypeCollection contentTypeCollection = null; + IList selectedContentTypeCollection = new List(); + try + { + if (null != clientContext && null != contentTypesNames) + { + + Web web = clientContext.Web; + string contentTypeName = contentTypesConfig.OneDriveContentTypeGroup.Trim(); + contentTypeCollection = web.ContentTypes; + clientContext.Load(contentTypeCollection, contentType => contentType.Include(thisContentType => thisContentType.Name).Where(currContentType => currContentType.Group == contentTypeName)); + clientContext.ExecuteQuery(); + selectedContentTypeCollection = GetContentTypeList(contentTypesNames, contentTypeCollection.ToList()); + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + return selectedContentTypeCollection; + } + + + /// + /// This method will assign content types to the matter that is getting created + /// + /// + /// + /// + /// + /// + /// + public GenericResponseVM AssignContentTypeHelper(MatterMetadata matterMetadata, ClientContext clientContext, + IList contentTypeCollection, Client client, Matter matter) + { + try + { + Web web = clientContext.Web; + List matterList = web.Lists.GetByTitle(matter.Name); + SetFieldValues(clientContext, contentTypeCollection, matterList, matterMetadata); + clientContext.ExecuteQuery(); + SetDefaultContentType(clientContext, matterList, client, matter); + string[] viewColumnList = contentTypesConfig.ViewColumnList.Split(new string[] { ServiceConstants.SEMICOLON }, StringSplitOptions.RemoveEmptyEntries).Select(listEntry => listEntry.Trim()).ToArray(); + string strQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.ViewOrderByQuery, contentTypesConfig.ViewOrderByColumn); + bool isViewCreated = spList.AddView(clientContext, matterList, viewColumnList, contentTypesConfig.ViewName, strQuery); + return ServiceUtility.GenericResponse(string.Empty, + Convert.ToString(isViewCreated, CultureInfo.CurrentCulture).ToLower(CultureInfo.CurrentCulture)); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, + MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Sets the default content type based on user selection for the new matter that is getting created + /// + /// SP client context + /// Name of the list + /// Request Object + /// Client Object + /// Matter Object + private void SetDefaultContentType(ClientContext clientContext, List list, Client client, Matter matter) + { + int contentCount = 0, contentSwap = 0; + try + { + ContentTypeCollection currentContentTypeOrder = list.ContentTypes; + clientContext.Load(currentContentTypeOrder); + clientContext.ExecuteQuery(); + IList updatedContentTypeOrder = new List(); + foreach (ContentType contentType in currentContentTypeOrder) + { + if (0 == string.Compare(contentType.Name, matter.DefaultContentType, StringComparison.OrdinalIgnoreCase)) + { + contentSwap = contentCount; + } + + if (0 != string.Compare(contentType.Name, contentTypesConfig.HiddenContentType, StringComparison.OrdinalIgnoreCase)) + { + updatedContentTypeOrder.Add(contentType.Id); + contentCount++; + } + } + if (updatedContentTypeOrder.Count > contentSwap) + { + ContentTypeId documentContentType = updatedContentTypeOrder[0]; + updatedContentTypeOrder[0] = updatedContentTypeOrder[contentSwap]; + updatedContentTypeOrder.RemoveAt(contentSwap); + updatedContentTypeOrder.Add(documentContentType); + } + list.RootFolder.UniqueContentTypeOrder = updatedContentTypeOrder; + list.RootFolder.Update(); + list.Update(); + clientContext.ExecuteQuery(); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Assigns field values for specified content types to the specified matter (document library). + /// + /// SP client context + /// Collection of content types + /// List containing matters + /// Object containing metadata for Matter + private void SetFieldValues(ClientContext clientContext, IList contentTypeCollection, List matterList, + MatterMetadata matterMetadata) + { + FieldCollection fields = GetContentType(clientContext, contentTypeCollection, matterList); + if (null != fields) + { + matterMetadata = GetWSSId(clientContext, matterMetadata, fields); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientId).DefaultValue = matterMetadata.Client.Id; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientId).ReadOnlyField = true; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientId).SetShowInDisplayForm(true); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientId).Update(); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientName).ReadOnlyField = true; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientName).SetShowInDisplayForm(true); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientName).DefaultValue = matterMetadata.Client.Name; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnClientName).Update(); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterId).DefaultValue = matterMetadata.Matter.Id; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterId).ReadOnlyField = true; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterId).SetShowInDisplayForm(true); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterId).Update(); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterName).DefaultValue = matterMetadata.Matter.Name; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterName).ReadOnlyField = true; + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterName).SetShowInDisplayForm(true); + fields.GetByInternalNameOrTitle(contentTypesConfig.ContentTypeColumnMatterName).Update(); + + int levels = taxonomySettings.Levels; + //For the number of levels that are configured, get the configured column name and + //update the wssid, termname and id for the managed field + for (int i=1;i<=levels; i++) + { + string columnName = configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName" + i]; + fields.GetByInternalNameOrTitle(columnName).SetShowInDisplayForm(true); + ManagedColumn managedColumn = matterMetadata.ManagedColumnTerms[columnName]; + fields.GetByInternalNameOrTitle(columnName).DefaultValue = + string.Format(CultureInfo.InvariantCulture, ServiceConstants.MetadataDefaultValue, + managedColumn.WssId, + managedColumn.TermName, + managedColumn.Id); + fields.GetByInternalNameOrTitle(columnName).Update(); + } + } + } + + /// + /// Function to get the WssID for all the managed columns that user has configured + /// + /// SP client context + /// Object containing meta data for Matter + /// Field Collection object + /// An Object containing meta data for Matter + private MatterMetadata GetWSSId(ClientContext clientContext, MatterMetadata matterMetadata, FieldCollection fields) + { + try + { + int levels = taxonomySettings.Levels; + //For the number of levels that are configured, get the configured column name for each level and get the wssid and + //update the ManagedColumnTerms object with wssid + for (int i = 1; i <= levels; i++) + { + string columnName = configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName" + i]; + ClientResult managedColumnWSSId = clientContext.CastTo + (fields.GetByInternalNameOrTitle(columnName)) + .GetFieldValueAsTaxonomyFieldValue(matterMetadata.ManagedColumnTerms[columnName].Id); + clientContext.ExecuteQuery(); + matterMetadata.ManagedColumnTerms[columnName].WssId = managedColumnWSSId.Value.WssId; + } + return matterMetadata; + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw ex; + } + } + + /// + /// Retrieves the list of content types that are to be associated with the matter. + /// + /// SP client context + /// Collection of content types + /// List containing matters + /// Content types in Field Collection object + internal static FieldCollection GetContentType(ClientContext clientContext, IList contentTypeCollection, List matterList) + { + foreach (ContentType contenttype in contentTypeCollection) + { + matterList.ContentTypesEnabled = true; + matterList.ContentTypes.AddExistingContentType(contenttype); + } + + matterList.Update(); + FieldCollection fields = matterList.Fields; + clientContext.Load(fields); + clientContext.Load(matterList); + clientContext.ExecuteQuery(); + return fields; + } + + /// + /// Generates the list of Content Types that are associated with matter. + /// + /// List of Content Type names that user has selected + /// Content Types listed in Content Type hub under Matter Center group + /// List of Content Types associated with matter + private static IList GetContentTypeList(IList contentTypesNames, List contentTypeList) + { + IList selectedContentTypeCollection = new List(); + ContentType selectedContentType = null; + foreach (string contentTypeName in contentTypesNames) + { + selectedContentType = (from currContentType in contentTypeList + where currContentType.Name.ToUpperInvariant().Equals(contentTypeName.ToUpperInvariant()) + select currContentType).ToList().FirstOrDefault(); + if (null != selectedContentType) + { + selectedContentTypeCollection.Add(selectedContentType); + } + } + return selectedContentTypeCollection; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPList.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPList.cs new file mode 100644 index 00000000..e1d9191f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPList.cs @@ -0,0 +1,1298 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Repository +// Author : v-rijadh +// Created : 07-07-2016 +//*************************************************************************** +// History +// Modified : 07-07-2016 +// Modified By : v-lapedd +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file provide methods to get/update information from/in SP lists + + +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Utilities; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; + +#region Matter Namespaces +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using System.Reflection; +using Microsoft.SharePoint.Client.Taxonomy; +using System.Text.RegularExpressions; +using System.IO; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Hosting; +#endregion + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This file provide methods to get/update information from/in SP lists + /// + public class SPList:ISPList + { + #region Properties + private SearchSettings searchSettings; + private ISPOAuthorization spoAuthorization; + private CamlQueries camlQueries; + private ICustomLogger customLogger; + private LogTables logTables; + private MailSettings mailSettings; + private IHostingEnvironment hostingEnvironment; + private ErrorSettings errorSettings; + private IUsersDetails userDetails; + #endregion + + /// + /// All the dependencies are injected into the constructor + /// + /// + /// + public SPList(ISPOAuthorization spoAuthorization, + IOptions camlQueries, + IOptions errorSettings, + IOptions searchSettings, + IOptions contentTypesConfig, + ICustomLogger customLogger, + IOptions logTables, + IOptions mailSettings, + IHostingEnvironment hostingEnvironment, + IUsersDetails userDetails) + { + this.searchSettings = searchSettings.Value; + this.camlQueries = camlQueries.Value; + this.spoAuthorization = spoAuthorization; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.mailSettings = mailSettings.Value; + this.hostingEnvironment = hostingEnvironment; + this.errorSettings = errorSettings.Value; + this.userDetails = userDetails; + } + + + /// + /// Converts the project users emails in a form that can be stamped to library. + /// + /// ClientContext object + /// Matter object + /// Users that can be stamped + public string GetMatterAssignedUsersEmail(ClientContext clientContext, Matter matter) + { + string currentUsers = string.Empty; + string separator = string.Empty; + if (null != matter && 0 < matter.AssignUserEmails.Count) + { + foreach (IList userNames in matter.AssignUserEmails) + { + List userEmails = new List(); + if (null != clientContext && null != userNames) + { + foreach (string userName in userNames) + { + if (!string.IsNullOrWhiteSpace(userName)) + { + if (Regex.IsMatch(userName.Trim(), "^[\\s]*\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*[\\s]*$", RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250))) + { + userEmails.Add(userName); + } + else + { + User user = clientContext.Web.EnsureUser(userName.Trim()); + ///// Only Fetch the User ID which is required + clientContext.Load(user, u => u.Email); + clientContext.ExecuteQuery(); + ///// Add the user to the first element of the FieldUserValue array. + userEmails.Add(user.Email); + } + } + } + currentUsers += separator + string.Join(ServiceConstants.SEMICOLON, userEmails); + separator = ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR; + } + } + } + + return currentUsers; + } + + + public bool CreateList(ClientContext clientContext, ListInformation listInfo) + { + bool result = true; + if (null != clientContext && null != listInfo && !string.IsNullOrWhiteSpace(listInfo.name)) + { + Web web = clientContext.Web; + ListTemplateCollection listTemplates = web.ListTemplates; + ListCreationInformation creationInfo = new ListCreationInformation(); + creationInfo.Title = listInfo.name; + creationInfo.Description = listInfo.description; + // To determine changes in URL we specified below condition as this function is common + if (!string.IsNullOrWhiteSpace(listInfo.Path)) + { + creationInfo.Url = listInfo.Path; + } + if (!string.IsNullOrWhiteSpace(listInfo.templateType)) + { + string templateType = listInfo.templateType; + clientContext.Load(listTemplates, item => item.Include(currentTemplate => currentTemplate.Name, currentTemplate => + currentTemplate.ListTemplateTypeKind).Where(selectedTemplate => selectedTemplate.Name == templateType)); + clientContext.ExecuteQuery(); + if (null != listTemplates && 0 < listTemplates.Count) + { + creationInfo.TemplateType = listTemplates.FirstOrDefault().ListTemplateTypeKind; + } + else + { + result = false; + } + } + else + { + creationInfo.TemplateType = (int)ListTemplateType.DocumentLibrary; + } + if (result) + { + List list = web.Lists.Add(creationInfo); + list.ContentTypesEnabled = listInfo.isContentTypeEnable; + if (null != listInfo.folderNames && listInfo.folderNames.Count > 0) + { + list = AddFolders(clientContext, list, listInfo.folderNames); + } + if (null != listInfo.versioning) + { + list.EnableVersioning = listInfo.versioning.EnableVersioning; + list.EnableMinorVersions = listInfo.versioning.EnableMinorVersions; + list.ForceCheckout = listInfo.versioning.ForceCheckout; + } + list.Update(); + clientContext.Load(list, l => l.DefaultViewUrl); + clientContext.ExecuteQuery(); + result = true; + } + } + return result; + } + + + + public Stream DownloadAttachments(string attachmentUrl) + { + ClientContext clientContext; + clientContext = spoAuthorization.GetClientContext(attachmentUrl.Split(Convert.ToChar(ServiceConstants.DOLLAR, CultureInfo.InvariantCulture))[0]); + SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(attachmentUrl.Split(Convert.ToChar(ServiceConstants.DOLLAR, CultureInfo.InvariantCulture))[1]); + ClientResult fileStream = file.OpenBinaryStream(); + ///// Load the Stream data for the file + clientContext.Load(file); + clientContext.ExecuteQuery(); + return fileStream.Value; + } + + public GenericResponseVM UploadDocument(string folderPath, IFormFile uploadedFile, string fileName, Dictionary mailProperties, string clientUrl, string folderName, string documentLibraryName) + { + IList listResponse = new List(); + GenericResponseVM genericResponse = null; + bool isUploadSuccessful = false; + try + { + ClientContext clientContext = spoAuthorization.GetClientContext(clientUrl); + Web web = clientContext.Web; + var uploadFile = new FileCreationInformation(); + using (var stream = uploadedFile.OpenReadStream()) + { + stream.Seek(0, SeekOrigin.Begin); + uploadFile.ContentStream = stream; + uploadFile.Url = fileName; + uploadFile.Overwrite = true; + using (clientContext) + { + genericResponse = DocumentUpload(folderPath, listResponse, clientContext, documentLibraryName, web, folderName, uploadFile); + } + } + if (genericResponse==null) + { + SetUploadItemProperties(clientContext, documentLibraryName, fileName, folderPath, mailProperties); + } + + } + catch (Exception exception) + { + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); + throw; + } + return genericResponse; + } + + /// + /// Upload helper function for uploading documents to SharePoint library. + /// + /// Folder path of Document Library + /// SharePoint list response + /// Client context object for connection between SP & client + /// Name of document library in which upload is to be done + /// Object of site + /// Target folder name where file needs to be uploaded. + /// Object having file creation information + /// It returns true if upload is successful else false + private GenericResponseVM DocumentUpload(string folderPath, IList listResponse, ClientContext clientContext, string documentLibraryName, Web web, string folderName, FileCreationInformation uploadFile) + { + GenericResponseVM genericResponse = null; + using (clientContext) + { + if (FolderExists(folderPath, clientContext, documentLibraryName)) + { + Folder destionationFolder = clientContext.Web.GetFolderByServerRelativeUrl(folderPath); + clientContext.Load(destionationFolder); + clientContext.ExecuteQuery(); + Microsoft.SharePoint.Client.File fileToUpload = destionationFolder.Files.Add(uploadFile); + destionationFolder.Update(); + web.Update(); + clientContext.Load(fileToUpload); + clientContext.ExecuteQuery(); + } + else + { + genericResponse = new GenericResponseVM() + { + Code = errorSettings.FolderStructureModified, + Value = folderName, + IsError = true + }; + } + } + return genericResponse; + } + + /// + /// Breaks the permissions of the list. + /// + /// Client context + /// Name of list + /// Flag to copy permission from parent + /// Success flag + public bool BreakPermission(ClientContext clientContext, string libraryName, bool isCopyRoleAssignment) + { + bool flag = false; + if (null != clientContext && !string.IsNullOrWhiteSpace(libraryName)) + { + try + { + List list = clientContext.Web.Lists.GetByTitle(libraryName); + clientContext.Load(list, l => l.HasUniqueRoleAssignments); + clientContext.ExecuteQuery(); + + if (!list.HasUniqueRoleAssignments) + { + list.BreakRoleInheritance(isCopyRoleAssignment, true); + list.Update(); + clientContext.Load(list); + clientContext.ExecuteQuery(); + flag = true; + } + } + catch (Exception) + { + throw; // This will transfer control to catch block of parent function. + } + } + return flag; + } + + public string AddOneNote(ClientContext clientContext, string clientAddressPath, string oneNoteLocation, string listName, string oneNoteTitle) + { + string returnValue = String.Empty; + if (null != clientContext && !string.IsNullOrWhiteSpace(clientAddressPath) && !string.IsNullOrWhiteSpace(oneNoteLocation) && + !string.IsNullOrWhiteSpace(listName)) + { + Uri clientUrl = new Uri(clientAddressPath); + //ToDo: Need to validate the url path + string oneNotePath = $"{hostingEnvironment.WebRootPath}//{ServiceConstants.ONE_NOTE_RELATIVE_FILE_PATH}"; + byte[] oneNoteFile = System.IO.File.ReadAllBytes(oneNotePath); + Web web = clientContext.Web; + Microsoft.SharePoint.Client.File file = web.GetFolderByServerRelativeUrl(oneNoteLocation).Files.Add(new FileCreationInformation() + { + Url = string.Concat(listName, ServiceConstants.EXTENSION_ONENOTE_TABLE_OF_CONTENT), + Overwrite = true, + ContentStream = new MemoryStream(oneNoteFile) + }); + web.Update(); + clientContext.Load(file); + clientContext.ExecuteQuery(); + ListItem oneNote = file.ListItemAllFields; + oneNote["Title"] = oneNoteTitle; + oneNote.Update(); + returnValue = string.Concat(clientUrl.Scheme, ServiceConstants.COLON, ServiceConstants.FORWARD_SLASH, ServiceConstants.FORWARD_SLASH, + clientUrl.Authority, file.ServerRelativeUrl, ServiceConstants.WEB_STRING); + } + return returnValue; + } + + /// + /// Validates and breaks the item level permission for the specified list item under the list/library. + /// + /// Client Context + /// List name + /// Unique list item id to break item level permission + /// Flag to copy permission from parent + /// String stating success flag + public bool BreakItemPermission(ClientContext clientContext, string listName, int listItemId, bool isCopyRoleAssignment) + { + bool result = false; + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + ListItem listItem = clientContext.Web.Lists.GetByTitle(listName).GetItemById(listItemId); + clientContext.Load(listItem, item => item.HasUniqueRoleAssignments); + clientContext.ExecuteQuery(); + + if (!listItem.HasUniqueRoleAssignments) + { + listItem.BreakRoleInheritance(isCopyRoleAssignment, true); + listItem.Update(); + clientContext.ExecuteQuery(); + result = true; + } + } + return result; + } + + public bool Delete(ClientContext clientContext, IList listsNames) + { + bool result = false; + if (null != clientContext && null != listsNames) + { + ListCollection allLists = clientContext.Web.Lists; + clientContext.Load(allLists); + clientContext.ExecuteQuery(); + foreach (string listName in listsNames) + { + List list = allLists.Cast().FirstOrDefault(item => item.Title.ToUpperInvariant().Equals(listName.ToUpperInvariant())); + if (null != list) + { + result = true; + list.DeleteObject(); + } + + } + clientContext.ExecuteQuery(); + } + return result; + } + + + + + public bool AddItem(ClientContext clientContext, List list, IList columns, IList values) + { + bool result = false; + if (null != clientContext && null != list && null != columns && null != values && columns.Count == values.Count) + { + // Add the Matter URL in list + ListItemCreationInformation listItemCreateInfo = new ListItemCreationInformation(); + ListItem newListItem = list.AddItem(listItemCreateInfo); + int position = 0; + foreach (string column in columns) + { + newListItem[column] = values[position++]; + } + ///// Update the list + newListItem.Update(); + clientContext.ExecuteQuery(); + result = true; + } + return result; + } + + /// + /// Adds all the folders from Content type in matter library. + /// + /// Client context + /// List of folders + /// The folder names. + /// Microsoft SharePoint Client List + private List AddFolders(ClientContext clientContext, List list, IList folderNames) + { + if (null != clientContext && null != list && null != folderNames) + { + FolderCollection listFolders = list.RootFolder.Folders; + Folder listRootFolder = list.RootFolder; + clientContext.Load(listFolders); + clientContext.ExecuteQuery(); + if (0 < folderNames.Count) + { + foreach (string folderName in folderNames) + { + // Check for empty folder names + if (!string.IsNullOrEmpty(folderName)) + { + listFolders.Add(folderName); + listRootFolder.Update(); + } + } + list.Update(); + } + } + return list; + } + /// + /// Creates a new view for the list + /// + /// Client Context + /// List name + /// Name of the columns in view + /// View name + /// View query + /// String stating success flag + public bool AddView(ClientContext clientContext, List matterList, string[] viewColumnList, string viewName, string strQuery) + { + bool result = true; + if (null != clientContext && null != matterList && null != viewColumnList && !string.IsNullOrWhiteSpace(viewName) && !string.IsNullOrWhiteSpace(strQuery)) + try + { + View outlookView = matterList.Views.Add(new ViewCreationInformation + { + Title = viewName, + ViewTypeKind = ViewType.Html, + ViewFields = viewColumnList, + Paged = true + }); + outlookView.ViewQuery = strQuery; + outlookView.Update(); + clientContext.ExecuteQuery(); + } + catch (Exception) + { + result = false; + } + return result; + } + + /// + /// Method will check the permission of the list that has been provided + /// + /// + /// + /// + /// True or false + public bool CheckPermissionOnList(string url, string listName, PermissionKind permission) + { + try + { + ClientContext clientContext = spoAuthorization.GetClientContext(url); + return CheckPermissionOnList(clientContext, listName, permission); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Determines whether user has a particular permission on the list + /// + /// Client context + /// List name + /// Permission to be checked + /// Success flag + public bool CheckPermissionOnList(Client client, string listName, PermissionKind permission) + { + try + { + ClientContext clientContext = spoAuthorization.GetClientContext(client.Url); + return CheckPermissionOnList(clientContext, listName, permission); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Determines whether user has a particular permission on the list + /// + /// Client context + /// List name + /// Permission to be checked + /// Success flag + public bool CheckPermissionOnList(ClientContext clientContext, string listName, PermissionKind permission) + { + try + { + bool returnValue = false; + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + ListCollection listCollection = clientContext.Web.Lists; + clientContext.Load(listCollection, lists => lists.Include(list => list.Title, list => + list.EffectiveBasePermissions).Where(list => list.Title == listName)); + clientContext.ExecuteQuery(); + if (0 < listCollection.Count) + { + returnValue = listCollection[0].EffectiveBasePermissions.Has(permission); + } + } + return returnValue; + } + + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Gets the list items of specified list based on CAML query. + /// + /// Client context + /// Name of the list + /// CAML Query that need to be executed on list + /// Collection of list items + public ListItemCollection GetData(ClientContext clientContext, string listName, string camlQuery = null) + { + try + { + ListItemCollection listItemCollection = null; + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + CamlQuery query = new CamlQuery(); + if (!string.IsNullOrWhiteSpace(camlQuery)) + { + query.ViewXml = camlQuery; + listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(query); + } + else + { + listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(CamlQuery.CreateAllItemsQuery()); + } + clientContext.Load(listItemCollection); + clientContext.ExecuteQuery(); + } + return listItemCollection; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + public ListItemCollection GetData(string url, string listName, string camlQuery = null) + { + try + { + ListItemCollection listItemCollection = null; + using (ClientContext clientContext = spoAuthorization.GetClientContext(url)) + { + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + CamlQuery query = new CamlQuery(); + if (!string.IsNullOrWhiteSpace(camlQuery)) + { + query.ViewXml = camlQuery; + listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(query); + } + else + { + listItemCollection = clientContext.Web.Lists.GetByTitle(listName).GetItems(CamlQuery.CreateAllItemsQuery()); + } + clientContext.Load(listItemCollection); + clientContext.ExecuteQuery(); + } + return listItemCollection; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + public void CreateFileInsideFolder(ClientContext clientContext, string folderPath, FileCreationInformation newFile) + { + Folder destinationFolder = clientContext.Web.GetFolderByServerRelativeUrl(folderPath); + clientContext.Load(destinationFolder); + clientContext.ExecuteQuery(); + Microsoft.SharePoint.Client.File fileToUpload = destinationFolder.Files.Add(newFile); + clientContext.Load(fileToUpload); + clientContext.ExecuteQuery(); + } + + public bool FolderExists(string folderPath, ClientContext clientContext, string documentLibraryName) + { + bool folderFound = false; + try + { + if (!string.IsNullOrWhiteSpace(folderPath) && !string.IsNullOrWhiteSpace(documentLibraryName) && null != clientContext) + { + string folderName = folderPath.Substring(folderPath.LastIndexOf(ServiceConstants.FORWARD_SLASH, StringComparison.OrdinalIgnoreCase) + 1); + List docLibList = clientContext.Web.Lists.GetByTitle(documentLibraryName); + ListItemCollection folderList = docLibList.GetItems(CamlQuery.CreateAllFoldersQuery()); + clientContext.Load(clientContext.Web, web => web.ServerRelativeUrl); + clientContext.Load(docLibList, list => list.Title); + clientContext.Load(folderList, item => item.Include(currentItem => currentItem.Folder.Name, currentItem => currentItem.Folder.ServerRelativeUrl).Where(currentItem => currentItem.Folder.ServerRelativeUrl == folderPath)); + clientContext.ExecuteQuery(); + + if (null != docLibList) + { + string rootFolderURL = string.Concat(clientContext.Web.ServerRelativeUrl, ServiceConstants.FORWARD_SLASH + folderName); + if (string.Equals(rootFolderURL, folderPath, StringComparison.OrdinalIgnoreCase)) + { + //// Upload is performed on root folder + folderFound = null != docLibList && docLibList.Title.ToUpperInvariant().Equals(documentLibraryName.ToUpperInvariant()); + } + else + { + //// Upload is performed on different folder other than root folder + folderFound = 0 < folderList.Count; + } + } + } + } + catch (Exception exception) + { + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ConstantStrings.LogTableName); + } + return folderFound; + } + + /// + /// Check if Content of local file and server file matches. + /// + /// SP client context + /// Memory stream of local file + /// Server relative URL of file with filename + /// True if content matched else false + public bool PerformContentCheck(ClientContext context, MemoryStream localMemoryStream, String serverFileURL) + { + bool isMatched = true; + if (null != context && null != localMemoryStream && !string.IsNullOrWhiteSpace(serverFileURL)) + { + Microsoft.SharePoint.Client.File serverFile = context.Web.GetFileByServerRelativeUrl(serverFileURL); + context.Load(serverFile); + ClientResult serverStream = serverFile.OpenBinaryStream(); + context.ExecuteQuery(); + if (null != serverFile) + { + using (MemoryStream serverMemoryStream = new MemoryStream()) + { + byte[] serverBuffer = new byte[serverFile.Length + 1]; + + int readCount = 0; + while ((readCount = serverStream.Value.Read(serverBuffer, 0, serverBuffer.Length)) > 0) + { + serverMemoryStream.Write(serverBuffer, 0, readCount); + } + serverMemoryStream.Seek(0, SeekOrigin.Begin); + localMemoryStream.Seek(0, SeekOrigin.Begin); + if (serverMemoryStream.Length == localMemoryStream.Length) + { + byte[] localBuffer = localMemoryStream.GetBuffer(); + serverBuffer = serverMemoryStream.GetBuffer(); + for (long index = 0; index < serverMemoryStream.Length; index++) + { + if (localBuffer[index] != serverBuffer[index]) + { + isMatched = false; + break; + } + } + } + else + { + isMatched = false; + } + } + } + else + { + isMatched = false; + } + } + return isMatched; + } + + /// + /// Sets the upload item properties. + /// + /// The client context. + /// The web. + /// Name of the document library. + /// Name of the file. + /// Path of the folder. + /// The mail properties. + public void SetUploadItemProperties(ClientContext clientContext, string documentLibraryName, string fileName, string folderPath, Dictionary mailProperties) + { + ListItemCollection items = null; + ListItem listItem = null; + if (null != clientContext && !string.IsNullOrEmpty(documentLibraryName) && !string.IsNullOrEmpty(fileName) && !string.IsNullOrEmpty(folderPath) && null != mailProperties) + { + Web web = clientContext.Web; + ListCollection lists = web.Lists; + CamlQuery query = new CamlQuery(); + List selectedList = lists.GetByTitle(documentLibraryName); + string serverRelativePath = folderPath + ServiceConstants.FORWARD_SLASH + fileName; + query.ViewXml = string.Format(CultureInfo.InvariantCulture, camlQueries.GetAllFilesInFolderQuery, serverRelativePath); + items = selectedList.GetItems(query); + if (null != items) + { + clientContext.Load(items, item => item.Include(currentItem => currentItem.DisplayName, currentItem => currentItem.File.Name).Where(currentItem => currentItem.File.Name == fileName)); + clientContext.ExecuteQuery(); + if (0 < items.Count) + { + listItem = items[0]; + if (null != mailProperties) + { + listItem[mailSettings.SearchEmailFrom] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_SENDER_KEY]) ? mailProperties[ServiceConstants.MAIL_SENDER_KEY].Trim() : string.Empty; + if (!string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_RECEIVED_DATEKEY])) + { + listItem[mailSettings.SearchEmailReceivedDate] = Convert.ToDateTime(mailProperties[ServiceConstants.MAIL_RECEIVED_DATEKEY].Trim(), CultureInfo.InvariantCulture).ToUniversalTime(); + } + else + { + listItem[mailSettings.SearchEmailReceivedDate] = null; + } + listItem[mailSettings.SearchEmailCC] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_CC_ADDRESS_KEY]) ? mailProperties[ServiceConstants.MAIL_CC_ADDRESS_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailAttachments] = (string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_HAS_ATTACHMENTS_KEY]) || mailProperties[ServiceConstants.MAIL_HAS_ATTACHMENTS_KEY].Equals(ServiceConstants.TRUE, StringComparison.OrdinalIgnoreCase)) ? mailProperties[ServiceConstants.MAIL_ATTACHMENT_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailFromMailbox] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_SEARCH_EMAIL_FROM_MAILBOX_KEY]) ? mailProperties[ServiceConstants.MAIL_SEARCH_EMAIL_FROM_MAILBOX_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailSubject] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_SEARCH_EMAIL_SUBJECT]) ? mailProperties[ServiceConstants.MAIL_SEARCH_EMAIL_SUBJECT].Trim() : string.Empty; + listItem[mailSettings.SearchEmailTo] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_RECEIVER_KEY]) ? mailProperties[ServiceConstants.MAIL_RECEIVER_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailImportance] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_IMPORTANCE_KEY]) ? mailProperties[ServiceConstants.MAIL_IMPORTANCE_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailSensitivity] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_SENSITIVITY_KEY]) ? mailProperties[ServiceConstants.MAIL_SENSITIVITY_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailHasAttachments] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_HAS_ATTACHMENTS_KEY]) ? mailProperties[ServiceConstants.MAIL_HAS_ATTACHMENTS_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailConversationId] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_CONVERSATIONID_KEY]) ? mailProperties[ServiceConstants.MAIL_CONVERSATIONID_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailConversationTopic] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_CONVERSATION_TOPIC_KEY]) ? mailProperties[ServiceConstants.MAIL_CONVERSATION_TOPIC_KEY].Trim() : string.Empty; + listItem[mailSettings.SearchEmailCategories] = GetCategories(mailProperties[ServiceConstants.MAIL_CATEGORIES_KEY].Trim()); + if (!string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_SENT_DATE_KEY])) + { + listItem[mailSettings.SearchEmailSentDate] = Convert.ToDateTime(mailProperties[ServiceConstants.MAIL_SENT_DATE_KEY].Trim(), CultureInfo.InvariantCulture).ToUniversalTime(); + } + else + { + listItem[mailSettings.SearchEmailSentDate] = null; + } + listItem[mailSettings.SearchEmailOriginalName] = !string.IsNullOrWhiteSpace(mailProperties[ServiceConstants.MAIL_ORIGINAL_NAME]) ? mailProperties[ServiceConstants.MAIL_ORIGINAL_NAME] : string.Empty; + listItem.Update(); + clientContext.ExecuteQuery(); + listItem.RefreshLoad(); + } + } + } + } + } + + /// + /// Process the categories and trims the "category" word + /// + /// Categories property + /// Processed category field + internal static string GetCategories(string categories) + { + string processedCategories = string.Empty; + if (!string.IsNullOrWhiteSpace(categories)) + { + processedCategories = Regex.Replace(categories, ServiceConstants.CATEGORIES, string.Empty, RegexOptions.IgnoreCase).Trim(); // Replace categories with empty strings + processedCategories = processedCategories.Replace(ServiceConstants.SPACE, string.Empty); // Remove the space generated because of replace operation + processedCategories = processedCategories.Replace(ServiceConstants.SEMICOLON, string.Concat(ServiceConstants.SEMICOLON, ServiceConstants.SPACE)); + } + return processedCategories; + } + + /// + /// Gets the list items of specified list based on CAML query. + /// + /// Client context + /// Name of the list + /// CAML Query that need to be executed on list + /// Collection of list items + public ListItemCollection GetData(Client client, string listName, string camlQuery = null) + { + try + { + return GetData(client.Url, listName, camlQuery); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Retrieves the document and List GUID + /// + /// Client object containing list data + /// Client Context + /// Returns the document and List GUID + public dynamic GetDocumentAndClientGUID(Client client) + { + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + string listInternalName = string.Empty; + string documentGUID = string.Empty; + string result = string.Empty; + ListCollection lists = clientContext.Web.Lists; + clientContext.Load(lists, list => list.Include(listItem => listItem.Id, listItem => listItem.RootFolder.ServerRelativeUrl)); + SharePoint.Client.File file = clientContext.Web.GetFileByServerRelativeUrl(client.Id); + clientContext.Load(file, files => files.ListItemAllFields); + clientContext.ExecuteQuery(); + if (0 < file.ListItemAllFields.FieldValues.Count) + { + documentGUID = Convert.ToString(file.ListItemAllFields.FieldValues[ServiceConstants.DOCUMENT_GUID_COLUMN_NAME], CultureInfo.InvariantCulture); + } + + List retrievedList = (from list in lists + where list.RootFolder.ServerRelativeUrl.ToUpperInvariant().Equals(client.Name.ToUpperInvariant()) + select list).FirstOrDefault(); + if (null != retrievedList) + { + listInternalName = Convert.ToString(retrievedList.Id, CultureInfo.InvariantCulture); + } + var documentAsset = new + { + ListInternalName = listInternalName, + DocumentGuid = documentGUID + }; + return documentAsset; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + /// + /// Method which will give matter folder hierarchy + /// + /// + /// + public List GetFolderHierarchy(MatterData matterData) + { + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(matterData.MatterUrl)) + { + List list = clientContext.Web.Lists.GetByTitle(matterData.MatterName); + clientContext.Load(list.RootFolder); + ListItemCollection listItems = GetData(clientContext, matterData.MatterName, + string.Format(CultureInfo.InvariantCulture, camlQueries.AllFoldersQuery, matterData.MatterName)); + List allFolders = new List(); + allFolders = GetFolderAssignment(list, listItems, allFolders); + + return allFolders; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Retrieves folder hierarchy from document library. + /// + /// SharePoint library + /// List items + /// List of all folders of type folder data + /// List of folders of type folder data + internal List GetFolderAssignment(List list, ListItemCollection listItems, List allFolders) + { + try + { + FolderData folderData = new FolderData() + { + Name = list.RootFolder.Name, + URL = list.RootFolder.ServerRelativeUrl, + ParentURL = null + }; + allFolders.Add(folderData); + foreach (var listItem in listItems) + { + folderData = new FolderData() + { + Name = Convert.ToString(listItem[searchSettings.ColumnNameFileLeafRef], CultureInfo.InvariantCulture), + URL = Convert.ToString(listItem[searchSettings.ColumnNameFileRef], CultureInfo.InvariantCulture), + ParentURL = Convert.ToString(listItem[searchSettings.ColumnNameFileDirRef], CultureInfo.InvariantCulture) + }; + + allFolders.Add(folderData); + } + return allFolders; + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + + /// + /// Function to check whether list is present or not. + /// + /// Client context object for SharePoint + /// List name + /// Success flag + public List Exists(Client client, ReadOnlyCollection listsNames) + { + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + List existingLists = new List(); + if (null != clientContext && null != listsNames) + { + //ToDo: Chec + ListCollection lists = clientContext.Web.Lists; + clientContext.Load(lists); + clientContext.ExecuteQuery(); + existingLists = (from listName in listsNames + join item in lists + on listName.ToUpper(CultureInfo.InvariantCulture) equals item.Title.ToUpper(CultureInfo.InvariantCulture) + select listName).ToList(); + } + return existingLists; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + /// + /// Function to check whether list is present or not. + /// + /// Client context object for SharePoint + /// List name + /// Success flag + public List MatterAssociatedLists(ClientContext clientContext, ReadOnlyCollection listsNames) + { + List existingLists = new List(); + try + { + if (null != clientContext && null != listsNames) + { + //ToDo: Chec + ListCollection lists = clientContext.Web.Lists; + clientContext.Load(lists); + clientContext.ExecuteQuery(); + existingLists = (from listName in listsNames + join item in lists + on listName.ToUpper(CultureInfo.InvariantCulture) equals item.Title.ToUpper(CultureInfo.InvariantCulture) + select listName).ToList(); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return existingLists; + } + + public PropertyValues GetListProperties(ClientContext clientContext, string libraryName) + { + + PropertyValues stampedProperties = null; + try + { + if (null != clientContext && !string.IsNullOrWhiteSpace(libraryName)) + { + stampedProperties = clientContext.Web.Lists.GetByTitle(libraryName).RootFolder.Properties; + clientContext.Load(stampedProperties); + clientContext.ExecuteQuery(); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; //// This will transfer control to catch block of parent function. + } + + return stampedProperties; + } + + /// + /// Fetches the values of property for specified matter. + /// + /// Client context + /// Name of matter + /// List of properties + /// Property list stamped to the matter + public string GetPropertyValueForList(ClientContext context, string matterName, string propertyList) + { + string value = string.Empty; + + if (!string.IsNullOrWhiteSpace(matterName) && null != propertyList) + { + ListCollection allLists = context.Web.Lists; + context.Load(allLists); + context.ExecuteQuery(); + List list = allLists.Cast().FirstOrDefault(item => item.Title.ToUpperInvariant().Equals(matterName.ToUpperInvariant())); + if (null != list) + { + var props = list.RootFolder.Properties; + context.Load(props); + context.ExecuteQuery(); + if (null != props) + { + if (props.FieldValues.ContainsKey(propertyList)) + { + value = Convert.ToString(props.FieldValues[propertyList], CultureInfo.InvariantCulture); + } + } + } + } + return value; + + } + + /// + /// + /// + /// + /// + /// + public IEnumerable FetchUserPermissionForLibrary(ClientContext clientContext, string libraryname) + { + IEnumerable userPermissionCollection = null; + try + { + if (null != clientContext && !string.IsNullOrWhiteSpace(libraryname)) + { + List list = clientContext.Web.Lists.GetByTitle(libraryname); + userPermissionCollection = clientContext.LoadQuery(list.RoleAssignments.Include(listRoleAssignment => + listRoleAssignment.PrincipalId, listRoleAssignment => listRoleAssignment.Member, + listRoleAssignment => listRoleAssignment.Member.Title, + listRoleAssignment => listRoleAssignment.Member.PrincipalType, + listRoleAssignment => listRoleAssignment.RoleDefinitionBindings.Include(userRoles => userRoles.BasePermissions, + userRoles => userRoles.Name, + userRoles => userRoles.Id)).Where(listUsers => (PrincipalType.User == listUsers.Member.PrincipalType) || (PrincipalType.SecurityGroup == listUsers.Member.PrincipalType))); + clientContext.ExecuteQuery(); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; //// This will transfer control to catch block of parent function. + } + return userPermissionCollection; + } + + /// + /// Sets permissions for the list. + /// + /// Client Context + /// Users to give permission + /// Permissions for the users + /// List name + /// String stating success flag + public bool SetPermission(ClientContext clientContext, IList> assignUserName, IList permissions, string listName) + { + bool result = false; + if (null != clientContext && !string.IsNullOrWhiteSpace(listName)) + { + ClientRuntimeContext clientRuntimeContext = clientContext; + try + { + List list = clientContext.Web.Lists.GetByTitle(listName); + clientContext.Load(list, l => l.HasUniqueRoleAssignments); + clientContext.ExecuteQuery(); + if (list.HasUniqueRoleAssignments && null != permissions && null != assignUserName && permissions.Count == assignUserName.Count) + { + int position = 0; + foreach (string roleName in permissions) + { + IList userName = assignUserName[position]; + if (!string.IsNullOrWhiteSpace(roleName) && null != userName) + { + RoleDefinition roleDefinition = clientContext.Web.RoleDefinitions.GetByName(roleName); + foreach (string user in userName) + { + //check whether is present in the organization before giving permissiosn to him + if (!string.IsNullOrWhiteSpace(user) && + userDetails.CheckUserPresentInMatterCenter(clientContext, user)) + { + if (!string.IsNullOrWhiteSpace(user)) + { + /////get the user object + Principal userPrincipal = clientContext.Web.EnsureUser(user.Trim()); + /////create the role definition binding collection + RoleDefinitionBindingCollection roleDefinitionBindingCollection = new RoleDefinitionBindingCollection(clientRuntimeContext); + /////add the role definition to the collection + roleDefinitionBindingCollection.Add(roleDefinition); + /////create a RoleAssigment with the user and role definition + list.RoleAssignments.Add(userPrincipal, roleDefinitionBindingCollection); + } + } + } + /////execute the query to add everything + clientRuntimeContext.ExecuteQuery(); + } + position++; + } + ///// Success. Return a success code + result = true; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + return result; + } + + /// + /// Set permission to the specified list item + /// + /// Client context object + /// Users to give permission + /// List name + /// Unique list item id to break item level permission + /// Permissions for the users + /// Status of the unique item level permission assignment operation + public bool SetItemPermission(ClientContext clientContext, IList> assignUserName, string listName, int listItemId, IList permissions) + { + bool result = false; + try + { + if (null != clientContext) + { + ClientRuntimeContext clientRuntimeContext = clientContext; + ListItem listItem = clientContext.Web.Lists.GetByTitle(listName).GetItemById(listItemId); + clientContext.Load(listItem, item => item.HasUniqueRoleAssignments); + clientContext.ExecuteQuery(); + if (listItem.HasUniqueRoleAssignments && null != permissions && + null != assignUserName && permissions.Count == assignUserName.Count) + { + int position = 0; + foreach (string roleName in permissions) + { + IList userName = assignUserName[position]; + if (!string.IsNullOrWhiteSpace(roleName) && null != userName) + { + RoleDefinition roleDefinition = clientContext.Web.RoleDefinitions.GetByName(roleName); + foreach (string user in userName) + { + + if (!string.IsNullOrWhiteSpace(user) && + userDetails.CheckUserPresentInMatterCenter(clientContext, user)) + { + /////get the user object + Principal userPrincipal = clientContext.Web.EnsureUser(user.Trim()); + /////create the role definition binding collection + RoleDefinitionBindingCollection roleDefinitionBindingCollection = new RoleDefinitionBindingCollection(clientRuntimeContext); + /////add the role definition to the collection + roleDefinitionBindingCollection.Add(roleDefinition); + /////create a RoleAssigment with the user and role definition + listItem.RoleAssignments.Add(userPrincipal, roleDefinitionBindingCollection); + } + } + /////execute the query to add everything + clientRuntimeContext.ExecuteQuery(); + } + position++; + } + ///// Success. Return a success code + result = false; + } + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Checks if item is modified after it is loaded on the client side + /// + /// List item collection + /// Date time when current user loaded the page to see/update configuration values. + /// Success flag + public bool CheckItemModified(ListItemCollection collection, string cachedItemModifiedDate) + { + bool response = false; + int errorModifiedDate = 0; // If there is new list item being created then 'cachedItemModifiedDate' will be 0 + if (null != collection && !string.IsNullOrWhiteSpace(cachedItemModifiedDate)) + { + // Verify if new item flag is true and no list item is present in the Matter Configuration list + if (String.Equals(Convert.ToString(errorModifiedDate, CultureInfo.InvariantCulture), cachedItemModifiedDate) && collection.Count.Equals(0)) + { + response = true; + } + else if (0 < collection.Count) + { + ListItem settingsListItem = collection.FirstOrDefault(); + DateTime cachedDate; + if (DateTime.TryParse(cachedItemModifiedDate, out cachedDate)) + { + DateTime itemModifiedDate = Convert.ToDateTime(settingsListItem[ServiceConstants.MODIFIED_DATE_COLUMN], CultureInfo.InvariantCulture); + if (0 == DateTime.Compare(cachedDate, itemModifiedDate)) + { + response = true; + } + } + + } + } + return response; + } + + /// + /// Sets the value of the specified property. + /// + /// Client context + /// Property Bag + /// Name of matter to which property is to be attached + /// List of properties + public void SetPropertBagValuesForList(ClientContext clientContext, PropertyValues props, string matterName, Dictionary propertyList) + { + try + { + if (null != clientContext && !string.IsNullOrWhiteSpace(matterName) && null != props && null != propertyList) + { + List list = clientContext.Web.Lists.GetByTitle(matterName); + + foreach (var item in propertyList) + { + props[item.Key] = item.Value; + list.Update(); + } + + clientContext.ExecuteQuery(); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPPage.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPPage.cs new file mode 100644 index 00000000..ff51a774 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/SPPage.cs @@ -0,0 +1,371 @@ + + +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.WebParts; +using System; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class SPPage : ISPPage + { + #region Properties + private GeneralSettings generalSettings; + private ISPOAuthorization spoAuthorization; + private ICustomLogger customLogger; + private LogTables logTables; + private ISPList spList; + private MatterSettings matterSettings; + #endregion + + /// + /// All the dependencies are injected + /// + /// + /// + public SPPage(ISPOAuthorization spoAuthorization, IOptions generalSettings, + IOptions logTables, ICustomLogger customLogger, ISPList spList, IOptions matterSettings) + { + this.generalSettings = generalSettings.Value; + this.spoAuthorization = spoAuthorization; + this.logTables = logTables.Value; + this.customLogger = customLogger; + this.spList = spList; + this.matterSettings = matterSettings.Value; + } + + + public int CreateWebPartPage(ClientContext clientContext, string pageName, string layout, string masterpagelistName, string listName, string pageTitle) + { + int response = -1; + if (null != clientContext && !string.IsNullOrWhiteSpace(pageName) && !string.IsNullOrWhiteSpace(layout) && !string.IsNullOrWhiteSpace(masterpagelistName) && !string.IsNullOrWhiteSpace(listName)) + { + try + { + //// Find Default Layout from Master Page Gallery to create Web Part Page + + Web web = clientContext.Web; + ListItemCollection collection = spList.GetData(clientContext, masterpagelistName); + clientContext.Load(collection, listItemCollectionProperties => listItemCollectionProperties.Include(listItemProperties => listItemProperties.Id, listItemProperties => listItemProperties.DisplayName)); + clientContext.ExecuteQuery(); + ListItem fileName = null; + foreach (ListItem findLayout in collection) + { + if (findLayout.DisplayName.Equals(layout, StringComparison.OrdinalIgnoreCase)) + { + fileName = findLayout; + break; + } + } + FileCreationInformation objFileInfo = new FileCreationInformation(); + objFileInfo.Url = pageName; + Microsoft.SharePoint.Client.File fileLayout = fileName.File; + clientContext.Load(fileLayout); + clientContext.ExecuteQuery(); + ClientResult filedata = fileLayout.OpenBinaryStream(); + List sitePageLib = web.Lists.GetByTitle(listName); + clientContext.Load(sitePageLib); + clientContext.ExecuteQuery(); + StreamReader reader = new StreamReader(filedata.Value); + objFileInfo.Content = System.Text.Encoding.ASCII.GetBytes(reader.ReadToEnd()); + Microsoft.SharePoint.Client.File matterLandingPage = sitePageLib.RootFolder.Files.Add(objFileInfo); + ListItem matterLandingPageDetails = matterLandingPage.ListItemAllFields; + // Update the title of the page + matterLandingPageDetails[ServiceConstants.TITLE] = pageTitle; + matterLandingPageDetails.Update(); + clientContext.Load(matterLandingPageDetails, matterLandingPageProperties => matterLandingPageProperties[ServiceConstants.TITLE], matterLandingPageProperties => matterLandingPageProperties.Id); + clientContext.ExecuteQuery(); + response = matterLandingPageDetails.Id; + } + catch (Exception) + { + response = -1; + } + } + return response; + } + + /// + /// Adds all web parts on matter landing page. + /// + /// Client Context + /// LimitedWebPartManager object to import web parts + /// WebPartDefinition object to add web parts on page + /// Array of web parts that should be added on Matter Landing Page + /// Array of Zone IDs + /// Success flag + public bool AddWebPart(ClientContext clientContext, LimitedWebPartManager limitedWebPartManager, WebPartDefinition webPartDefinition, + string[] webParts, string[] zones) + { + bool result = false; + if (null != clientContext && null != limitedWebPartManager && null != webParts && null != zones) + { + int index = 0; + try + { + for (index = 0; index < webParts.Length; index++) + { + if (!string.IsNullOrWhiteSpace(webParts[index])) + { + webPartDefinition = limitedWebPartManager.ImportWebPart(webParts[index]); + limitedWebPartManager.AddWebPart(webPartDefinition.WebPart, zones[index], ServiceConstants.ZONE_INDEX); + clientContext.ExecuteQuery(); + } + } + } + catch (Exception) + { + result = false; + } + } + return result; + } + + /// + /// Configures XML of web parts. + /// + /// Request Object + /// Client object containing Client data + /// Matter object containing Matter data + /// SharePoint Client Context + /// SharePoint List of matter library + /// Object of FileCreationInformation + /// To get URL segments + /// Web object of the current context + /// List of Web Parts + public string[] ConfigureXMLCodeOfWebParts(Client client, Matter matter, ClientContext clientContext, string pageName, Uri uri, + Web web, MatterConfigurations matterConfigurations) + { + string[] result = null; + try + { + List sitePageLib = web.Lists.GetByTitle(matter.Name); + clientContext.Load(sitePageLib); + clientContext.ExecuteQuery(); + + ////Configure list View Web Part XML + string listViewWebPart = ConfigureListViewWebPart(sitePageLib, clientContext, pageName, client, matter, + string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}", uri.AbsolutePath, ServiceConstants.FORWARD_SLASH, matter.Name, + ServiceConstants.FORWARD_SLASH, pageName)); + string[] contentEditorSectionIds = matterSettings.MatterLandingPageSections.Split(Convert.ToChar(ServiceConstants.COMMA, CultureInfo.InvariantCulture)); + + ////Configure content Editor Web Part of user information XML + string contentEditorWebPartTasks = string.Empty; + if (matterConfigurations.IsTaskSelected) + { + contentEditorWebPartTasks = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, + string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, + contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.TaskPanel, CultureInfo.InvariantCulture)])); + } + + string calendarWebpart = string.Empty, rssFeedWebPart = string.Empty, rssTitleWebPart = string.Empty; + if (matterConfigurations.IsRSSSelected) + { + rssFeedWebPart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.RSS_FEED_WEB_PART, WebUtility.UrlEncode(matter.Name)); + rssTitleWebPart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, + string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, + contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.RSSTitlePanel, CultureInfo.InvariantCulture)])); + } + + ////Configure calendar Web Part XML + if (matterConfigurations.IsCalendarSelected) + { + ////If create calendar is enabled configure calendar Web Part XML; else dont configure + calendarWebpart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.CalendarPanel, CultureInfo.InvariantCulture)])); + } + + string matterInformationSection = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.InformationPanel, CultureInfo.InvariantCulture)])); + string cssLink = string.Format(CultureInfo.InvariantCulture, matterSettings.MatterLandingCSSFileName, matterSettings.MatterLandingFolderName); + string commonCssLink = string.Format(CultureInfo.InvariantCulture, matterSettings.CommonCSSFileLink, matterSettings.CommonFolderName); + string jsLinkMatterLandingPage = string.Format(CultureInfo.InvariantCulture, matterSettings.MatterLandingJSFileName, matterSettings.MatterLandingFolderName); + string jsLinkJQuery = string.Format(CultureInfo.InvariantCulture, matterSettings.JQueryFileName, matterSettings.CommonFolderName); + string jsLinkCommon = string.Format(CultureInfo.InvariantCulture, matterSettings.CommonJSFileLink, matterSettings.CommonFolderName); + string headerWebPartSection = string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.HeaderPanel, CultureInfo.InvariantCulture)]); + string footerWebPartSection = string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.FooterPanel, CultureInfo.InvariantCulture)]); + headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.STYLE_TAG, cssLink), headerWebPartSection); + headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.STYLE_TAG, commonCssLink), headerWebPartSection); + headerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.SCRIPT_TAG_WITH_CONTENTS, string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_STAMP_PROPERTIES, matter.Name, matter.MatterGuid)), headerWebPartSection); + footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.SCRIPT_TAG, jsLinkMatterLandingPage), footerWebPartSection); + footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.SCRIPT_TAG, jsLinkCommon), footerWebPartSection); + footerWebPartSection = string.Concat(string.Format(CultureInfo.InvariantCulture, ServiceConstants.SCRIPT_TAG, jsLinkJQuery), footerWebPartSection); + string headerWebPart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, headerWebPartSection); + string footerWebPart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, footerWebPartSection); + string oneNoteWebPart = string.Format(CultureInfo.InvariantCulture, ServiceConstants.CONTENT_EDITOR_WEB_PART, string.Format(CultureInfo.InvariantCulture, ServiceConstants.MATTER_LANDING_SECTION_CONTENT, contentEditorSectionIds[Convert.ToInt32(MatterLandingSection.OneNotePanel, CultureInfo.InvariantCulture)])); + string[] webParts = { headerWebPart, matterInformationSection, oneNoteWebPart, listViewWebPart, rssFeedWebPart, rssTitleWebPart, footerWebPart, calendarWebpart, contentEditorWebPartTasks }; + result = webParts; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Configures XML code of List View web part. + /// + /// Request Object + /// SharePoint List of matter library + /// SharePoint Client Context + /// Object of FileCreationInformation + /// Client object containing Client data + /// Matter object containing Matter data + /// Segment of URL + /// Configured ListView Web Part + internal string ConfigureListViewWebPart(List sitePageLib, ClientContext clientContext, string pageName, Client client, Matter matter, string titleUrl) + { + string viewName = string.Empty; + string result = string.Empty; + try + { + Uri uri = new Uri(client.Url); + ViewCollection viewColl = sitePageLib.Views; + clientContext.Load( + viewColl, + views => views.Include( + view => view.Title, + view => view.Id)); + clientContext.ExecuteQuery(); + foreach (View view in viewColl) + { + viewName = Convert.ToString(view.Id, CultureInfo.InvariantCulture); + break; + } + viewName = string.Concat(ServiceConstants.OPENING_CURLY_BRACE, viewName, ServiceConstants.CLOSING_CURLY_BRACE); + string listViewWebPart = ServiceConstants.LIST_VIEW_WEBPART; + listViewWebPart = string.Format(CultureInfo.InvariantCulture, listViewWebPart, + Convert.ToString(sitePageLib.Id, CultureInfo.InvariantCulture), titleUrl, + string.Concat(ServiceConstants.OPENING_CURLY_BRACE, Convert.ToString(sitePageLib.Id, CultureInfo.InvariantCulture), + ServiceConstants.CLOSING_CURLY_BRACE), viewName, string.Concat(uri.AbsolutePath, ServiceConstants.FORWARD_SLASH, + matter.Name, ServiceConstants.FORWARD_SLASH, pageName)); + result = listViewWebPart; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Will check whether a url exists in the current site collection or not + /// + /// Contains the url in which we need to check whether a page exists or not + /// The page + /// + public bool UrlExists(Client client, string pageUrl) + { + bool pageExists = false; + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + string[] requestedUrls = pageUrl.Split(new string[] { ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR }, + StringSplitOptions.RemoveEmptyEntries); + if (1 < requestedUrls.Length) + { + foreach (string url in requestedUrls) + { + if (IsFileExists(clientContext, url)) + { + pageExists = true; + break; + } + } + } + else + { + pageExists = IsFileExists(clientContext, pageUrl) ? true : false; + } + } + return pageExists; + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Checks the file at the specified location and return the file existence status. + /// + /// Client Context + /// File URL + /// Success flag + public bool IsFileExists(ClientContext clientContext, string pageUrl) + { + bool success = false; + if (null != clientContext && !string.IsNullOrWhiteSpace(pageUrl)) + { + Microsoft.SharePoint.Client.File clientFile = clientContext.Web.GetFileByServerRelativeUrl(pageUrl); + clientContext.Load(clientFile, cf => cf.Exists); + clientContext.ExecuteQuery(); + success = clientFile.Exists; + } + return success; + } + + /// + /// Checks if the requested page exists or not. + /// + /// URL of the page, for which check is to be performed + /// ClientContext for SharePoint + /// true or false string based upon the existence of the page, referred in requestedUrl + public bool PageExists(string requestedUrl, ClientContext clientContext) + { + bool pageExists = false; + try + { + string[] requestedUrls = requestedUrl.Split(new string[] { ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR }, StringSplitOptions.RemoveEmptyEntries); + if (1 < requestedUrls.Length) + { + foreach (string url in requestedUrls) + { + if (IsFileExists(clientContext, url)) + { + pageExists = true; + break; + } + } + } + else + { + pageExists = IsFileExists(clientContext, requestedUrl) ? true : false; + } + } + catch (Exception exception) + { + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); + } + return pageExists; + } + + /// + /// Deletes the page + /// + /// Client Context + /// Page URL + public void Delete(ClientContext clientContext, string pageUrl) + { + if (null != clientContext && !string.IsNullOrWhiteSpace(pageUrl)) + { + SharePoint.Client.File clientFile = clientContext.Web.GetFileByServerRelativeUrl(pageUrl); + if (IsFileExists(clientContext, pageUrl)) + { + clientFile.DeleteObject(); + clientContext.ExecuteQuery(); + } + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Search.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Search.cs new file mode 100644 index 00000000..12a80bf5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Search.cs @@ -0,0 +1,1566 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.ProviderService +// Author : v-lapedd +// Created : 04-09-2016 +//*************************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file provide methods to perform SharePoint search functionalities +// *********************************************************************** + +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Search.Query; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Net; +using System.Linq; +using System.Reflection; +using Newtonsoft.Json; +using Microsoft.SharePoint.Client.Utilities; +using Microsoft.SharePoint.ApplicationPages.ClientPickerQuery; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This class contains all the methods which are related to spo search + /// + public class Search:ISearch + { + private GeneralSettings generalSettings; + private SearchSettings searchSettings; + private ISPOAuthorization spoAuthorization; + private ClientContext clientContext; + private IUsersDetails userDetails; + private ICustomLogger customLogger; + private LogTables logTables; + private ISPList spList; + private CamlQueries camlQueries; + private ListNames listNames; + private SharedSettings sharedSettings; + private ErrorSettings errorSettings; + /// + /// + /// + /// + /// + /// + public Search(ISPOAuthorization spoAuthorization, + ICustomLogger customLogger, + IUsersDetails userDetails, + ISPList spList, + IOptions generalSettings, + IOptions sharedSettings, + IOptions logTables, + IOptions searchSettings, + IOptions camlQueries, + IOptions listNames, + IOptions errorSettings) + { + this.spoAuthorization = spoAuthorization; + this.generalSettings = generalSettings.Value; + this.searchSettings = searchSettings.Value; + this.userDetails = userDetails; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.spList = spList; + this.camlQueries = camlQueries.Value; + this.listNames = listNames.Value; + this.sharedSettings = sharedSettings.Value; + this.errorSettings = errorSettings.Value; + } + + #region Public Methods + + /// + /// Gets the matters based on search criteria. + /// + /// + /// + public SearchResponseVM GetMatters(SearchRequestVM searchRequestVM) + { + SearchResponseVM searchResponseVM = null; + var client = searchRequestVM.Client; + var searchObject = searchRequestVM.SearchObject; + try + { + clientContext = null; + clientContext = spoAuthorization.GetClientContext(client.Url); + KeywordQuery keywordQuery = new KeywordQuery(clientContext); + if (string.IsNullOrWhiteSpace(searchObject.SearchTerm)) + { + searchObject.SearchTerm = ServiceConstants.ASTERISK; + } + + if (searchObject.Filters != null) + { + if (searchObject.Filters.FilterByMe == 1) + { + + Users currentUserDetail = userDetails.GetLoggedInUserDetails(clientContext); + string userTitle = currentUserDetail.Name; + searchObject.SearchTerm = string.Concat(searchObject.SearchTerm, ServiceConstants.SPACE, + ServiceConstants.OPERATOR_AND, ServiceConstants.SPACE, + ServiceConstants.OPENING_BRACKET, searchSettings.ManagedPropertyResponsibleAttorney, + ServiceConstants.COLON, ServiceConstants.SPACE, ServiceConstants.DOUBLE_QUOTE, userTitle, + ServiceConstants.DOUBLE_QUOTE, ServiceConstants.SPACE, ServiceConstants.OPERATOR_AND, ServiceConstants.SPACE, + searchSettings.ManagedPropertyTeamMembers, ServiceConstants.COLON, ServiceConstants.SPACE, + ServiceConstants.DOUBLE_QUOTE, userTitle, + ServiceConstants.DOUBLE_QUOTE, ServiceConstants.SPACE, ServiceConstants.CLOSING_BRACKET); + } + + keywordQuery = FilterMatters(searchObject, keywordQuery); + + keywordQuery = KeywordQueryMetrics(client, searchObject, keywordQuery, + ServiceConstants.DOCUMENT_LIBRARY_FILTER_CONDITION, + searchSettings.ManagedPropertyIsMatter, true); + + // Create a list of managed properties which are required to be present in search results + List managedProperties = new List(); + managedProperties.Add(searchSettings.ManagedPropertyTitle); + managedProperties.Add(searchSettings.ManagedPropertyName); + managedProperties.Add(searchSettings.ManagedPropertyDescription); + managedProperties.Add(searchSettings.ManagedPropertySiteName); + managedProperties.Add(searchSettings.ManagedPropertyLastModifiedTime); + managedProperties.Add(searchSettings.ManagedPropertyPracticeGroup); + managedProperties.Add(searchSettings.ManagedPropertyAreaOfLaw); + managedProperties.Add(searchSettings.ManagedPropertySubAreaOfLaw); + managedProperties.Add(searchSettings.ManagedPropertyMatterId); + managedProperties.Add(searchSettings.ManagedPropertyCustomTitle); + managedProperties.Add(searchSettings.ManagedPropertyPath); + managedProperties.Add(searchSettings.ManagedPropertyMatterName); + managedProperties.Add(searchSettings.ManagedPropertyOpenDate); + managedProperties.Add(searchSettings.ManagedPropertyClientName); + managedProperties.Add(searchSettings.ManagedPropertyBlockedUploadUsers); + managedProperties.Add(searchSettings.ManagedPropertyResponsibleAttorney); + managedProperties.Add(searchSettings.ManagedPropertyClientID); + managedProperties.Add(searchSettings.ManagedPropertyMatterGuid); + //Filter on Result source to fetch only Matter Center specific results + keywordQuery.SourceId = new Guid(searchSettings.SearchResultSourceID); + keywordQuery = AssignKeywordQueryValues(keywordQuery, managedProperties); + keywordQuery.BypassResultTypes = true; + searchResponseVM = FillResultData(clientContext, keywordQuery, searchRequestVM, true, managedProperties); + } + clientContext.Dispose(); + return searchResponseVM; + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// Gets the matters based on search criteria. + /// + /// + /// + public SearchResponseVM GetDocuments(SearchRequestVM searchRequestVM) + { + SearchResponseVM searchResponseVM = null; + try + { + var client = searchRequestVM.Client; + var searchObject = searchRequestVM.SearchObject; + clientContext = null; + clientContext = spoAuthorization.GetClientContext(client.Url); + KeywordQuery keywordQuery = new KeywordQuery(clientContext); + if (string.IsNullOrWhiteSpace(searchObject.SearchTerm)) + { + searchObject.SearchTerm = ServiceConstants.ASTERISK; + } + + if (searchObject.Filters != null) + { + if (searchObject.Filters.FilterByMe == 1) + { + ////Get logged in user alias + Users currentUserDetail = userDetails.GetLoggedInUserDetails(clientContext); + string userTitle = currentUserDetail.Name; + searchObject.SearchTerm = string.Concat(searchObject.SearchTerm, ServiceConstants.SPACE, ServiceConstants.OPERATOR_AND, + ServiceConstants.SPACE, ServiceConstants.OPENING_BRACKET, searchSettings.ManagedPropertyResponsibleAttorney, + ServiceConstants.COLON, ServiceConstants.SPACE, ServiceConstants.DOUBLE_QUOTE, userTitle, ServiceConstants.DOUBLE_QUOTE, + ServiceConstants.SPACE, ServiceConstants.OPERATOR_OR, ServiceConstants.SPACE, searchSettings.ManagedPropertyTeamMembers, + ServiceConstants.COLON, ServiceConstants.SPACE, ServiceConstants.DOUBLE_QUOTE, userTitle, ServiceConstants.DOUBLE_QUOTE, + ServiceConstants.SPACE, ServiceConstants.CLOSING_BRACKET); + } + + keywordQuery = FilterDocuments(searchObject, keywordQuery); + + keywordQuery = KeywordQueryMetrics(client, searchObject, keywordQuery, ServiceConstants.DOCUMENT_ITEM_FILTER_CONDITION, + searchSettings.ManagedPropertyIsDocument, false); + + // Create a list of managed properties which are required to be present in search results + List managedProperties = new List(); + managedProperties.Add(searchSettings.ManagedPropertyFileName); + managedProperties.Add(searchSettings.ManagedPropertyTitle); + managedProperties.Add(searchSettings.ManagedPropertyCreated); + managedProperties.Add(searchSettings.ManagedPropertyUIVersionStringOWSTEXT); + managedProperties.Add(searchSettings.ManagedPropertyServerRelativeUrl); + managedProperties.Add(searchSettings.ManagedPropertyFileExtension); + managedProperties.Add(searchSettings.ManagedPropertyDocumentMatterId); + managedProperties.Add(searchSettings.ManagedPropertyDocumentLastModifiedTime); + managedProperties.Add(searchSettings.ManagedPropertySiteTitle); + managedProperties.Add(searchSettings.ManagedPropertyDocumentClientId); + managedProperties.Add(searchSettings.ManagedPropertyDocumentClientName); + managedProperties.Add(searchSettings.ManagedPropertyDocumentMatterName); + managedProperties.Add(searchSettings.ManagedPropertyDocumentId); + managedProperties.Add(searchSettings.ManagedPropertyCheckOutByUser); + managedProperties.Add(searchSettings.ManagedPropertySiteName); + managedProperties.Add(searchSettings.ManagedPropertySPWebUrl); + managedProperties.Add(searchSettings.ManagedPropertyDocumentVersion); + managedProperties.Add(searchSettings.ManagedPropertyDocumentCheckOutUser); + managedProperties.Add(searchSettings.ManagedPropertySPWebUrl); + managedProperties.Add(searchSettings.ManagedPropertyAuthor); + //Filter on Result source to fetch only Matter Center specific results + keywordQuery.SourceId = new Guid(searchSettings.SearchResultSourceID); + keywordQuery = AssignKeywordQueryValues(keywordQuery, managedProperties); + + searchResponseVM = FillResultData(clientContext, keywordQuery, searchRequestVM, false, managedProperties); + clientContext.Dispose(); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return searchResponseVM; + } + + /// + /// + /// + /// + /// + /// + /// + /// + public SearchResponseVM GetPinnedData(Client client, string listName, string listColumnName, bool isShowDocument) + { + ////Holds logged-in user alias + string userAlias = string.Empty; + ////Object to store all the list items retrieved from SharePoint list + ListItemCollection listItems; + ////Stores the JSON structure with the meta-data of pinned matter/document + string userPinnedDetails = string.Empty; + + SearchResponseVM searchResponse = new SearchResponseVM(); + using (clientContext = spoAuthorization.GetClientContext(client.Url)) + { + try + { + ////Get logged in user alias + Users currentUserDetail = userDetails.GetLoggedInUserDetails(clientContext); + userAlias = currentUserDetail.LogOnName; + listItems = spList.GetData(clientContext, listName, string.Format(CultureInfo.InvariantCulture, + camlQueries.UserPinnedDetailsQuery, searchSettings.PinnedListColumnUserAlias, userAlias, listColumnName)); + if (listItems!=null && listItems.Count > 0) + { + ////Since we are maintaining only single list item per user, listItems collection will have only one object; hence accessing first object + ////Check if column holds null or empty string. If non empty, pinned matter/document exists + if (!string.IsNullOrEmpty(Convert.ToString(listItems[0][listColumnName], CultureInfo.InvariantCulture))) + { + string userPinnedMatter = Convert.ToString(listItems[0][listColumnName], CultureInfo.InvariantCulture); + if (isShowDocument) + { + Dictionary userpinnedDocumentCollection = + JsonConvert.DeserializeObject>(userPinnedMatter); + searchResponse.TotalRows = userpinnedDocumentCollection.Count; + searchResponse.DocumentDataList = userpinnedDocumentCollection.Values.Reverse(); + } + else + { + Dictionary userpinnedMatterCollection = + JsonConvert.DeserializeObject>(userPinnedMatter); + searchResponse.TotalRows = userpinnedMatterCollection.Count; + searchResponse.MatterDataList = userpinnedMatterCollection.Values.Reverse(); + } + } + } + else + { + searchResponse.TotalRows = 0; + searchResponse.NoPinnedMessage = ServiceConstants.NO_PINNED_MESSAGE; + } + return searchResponse; + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } + + /// + /// Removes pinned item from user pinned details. + /// + /// Request object containing SharePoint App Token + /// Client object containing Client data + /// Matter object containing Matter data + /// + /// Document object containing Document data + /// Status of update + public bool UnPinMatter(PinRequestMatterVM pinRequestMatterVM) + { + try + { + clientContext = spoAuthorization.GetClientContext(pinRequestMatterVM.Client.Url); + return UnPinThisRecord(clientContext, pinRequestMatterVM.Client, pinRequestMatterVM.MatterData, true); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Add a new pin item to the user pinned matter list + /// + /// + /// + public bool PinMatter(PinRequestMatterVM pinRequestMatterVM) + { + try + { + using (clientContext = spoAuthorization.GetClientContext(pinRequestMatterVM.Client.Url)) + { + return PinThisRecord(clientContext, pinRequestMatterVM.Client, pinRequestMatterVM.MatterData, true); + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// Removes pinned item from user pinned document list. + /// + /// + /// + public bool UnPinDocument(PinRequestDocumentVM pinRequestDocumentVM) + { + try + { + using (clientContext = spoAuthorization.GetClientContext(pinRequestDocumentVM.Client.Url)) + { + return UnPinThisRecord(clientContext, pinRequestDocumentVM.Client, pinRequestDocumentVM.DocumentData, false); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Add a new pin document to the user pinned document list + /// + /// + /// + public bool PinDocument(PinRequestDocumentVM pinRequestDocumentVM) + { + try + { + using (clientContext = spoAuthorization.GetClientContext(pinRequestDocumentVM.Client.Url)) + { + return PinThisRecord(clientContext, pinRequestDocumentVM.Client, pinRequestDocumentVM.DocumentData, false); + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// + /// + /// + /// + /// + /// + public List GetMatterHelp(Client client, string selectedPage, string listName) + { + try + { + List contextHelpData = null; + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + //Object to store all the list items retrieved from SharePoint list + ListItemCollection contextualHelpSectionListItems; + + // Get MatterCenterHelpSection list data + contextualHelpSectionListItems = spList.GetData(clientContext, listName, + String.Format(CultureInfo.InvariantCulture, camlQueries.RetrieveContextualHelpSectionsQuery, selectedPage)); + //If these exists any content for contextual help flyout + if (null != contextualHelpSectionListItems && 0 < contextualHelpSectionListItems.Count) + { + contextHelpData = FetchContextualHelpContentUtility(clientContext, contextualHelpSectionListItems); + } + } + return contextHelpData; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Fetches contextual help content from SPList. + /// + /// String object which stores json object in string format + /// String object which contains selected section id + /// Collections of section id for contextual help functionality + /// Collection of ContextHelpData + /// ClientContext for SharePoint + /// List collection object for contextual help section list + /// + public List FetchContextualHelpContentUtility(ClientContext clientContext, ListItemCollection contextualHelpSectionListItems) + { + try + { + string[] contextualHelpLinksQueryParts = camlQueries.ContextualHelpQueryIncludeOrCondition.Split(';'); + IList sectionID = new List(); + string selectedSectionIDs = string.Empty; + ListItemCollection contextualHelpLinksListItems; + List contextHelpCollection = new List(); + foreach (ListItem oListItem in contextualHelpSectionListItems) + { + // Retrieve and save content from MatterCenterHelpSectionList + sectionID.Add(Convert.ToString(oListItem[sharedSettings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture)); + } + + // Using section ids, create caml query which will retrieve links from MatterCenterHelpLinksList + for (int index = 0; index < sectionID.Count; index++) + { + if (index < 2) + { + selectedSectionIDs = string.Concat(selectedSectionIDs, String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[0], + sharedSettings.ContextualHelpSectionColumnSectionID, sectionID[index])); + } + else + { + selectedSectionIDs = String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[1], selectedSectionIDs); + selectedSectionIDs = string.Concat(selectedSectionIDs, String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[0], + sharedSettings.ContextualHelpSectionColumnSectionID, sectionID[index])); + } + } + if (sectionID.Count > 1) + { + selectedSectionIDs = String.Format(CultureInfo.InvariantCulture, contextualHelpLinksQueryParts[1], selectedSectionIDs); + } + + // get Contextual Help links form MatterCenterHelpLinksList + contextualHelpLinksListItems = spList.GetData(clientContext, listNames.MatterCenterHelpLinksListName, + String.Format(CultureInfo.InvariantCulture, camlQueries.RetrieveContextualHelpLinksQuery, selectedSectionIDs)); + //If these exists any links for contextual help flyout + if (null != contextualHelpLinksListItems && 0 < contextualHelpLinksListItems.Count) + { + foreach (ListItem oListItem in contextualHelpLinksListItems) + { + foreach (ListItem oListItemHelpSection in contextualHelpSectionListItems) + { + if (Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture) == + ((Microsoft.SharePoint.Client.FieldLookupValue)(oListItem[sharedSettings.ContextualHelpLinksColumnSectionID])).LookupValue) + { + string currentLinkOrder = Convert.ToString(oListItem[sharedSettings.ContextualHelpLinksColumnLinkOrder], CultureInfo.InvariantCulture); + string currentLinkTitle = Convert.ToString(oListItem[sharedSettings.ContextualHelpLinksColumnLinkTitle], CultureInfo.InvariantCulture); + string currentLinkUrl = ((Microsoft.SharePoint.Client.FieldUrlValue)oListItem[sharedSettings.ContextualHelpLinksColumnLinkURL]).Url; + string currentPageName = Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnPageName], CultureInfo.InvariantCulture); + string numberOfColumns = Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnNumberOfColumns], CultureInfo.InvariantCulture); + + ContextHelpData contextData = new ContextHelpData + { + ContextSection = new ContextHelpSection + { + SectionID = Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnSectionID], CultureInfo.InvariantCulture), + SectionTitle = Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnSectionTitle], CultureInfo.InvariantCulture), + SectionOrder = Convert.ToString(oListItemHelpSection[sharedSettings.ContextualHelpSectionColumnSectionOrder], CultureInfo.InvariantCulture), + PageName = currentPageName, + NumberOfColumns = numberOfColumns + }, + LinkOrder = currentLinkOrder, + LinkTitle = currentLinkTitle, + LinkURL = currentLinkUrl + }; + contextHelpCollection.Add(contextData); + } + } + } + } + contextHelpCollection = contextHelpCollection.OrderBy(c => c.ContextSection.SectionOrder).ThenBy(c => c.LinkOrder).ToList(); + return contextHelpCollection; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + public List GetWebRoleDefinitions(Client client) + { + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + Web web = clientContext.Web; + clientContext.Load(web.RoleDefinitions, roledefinitions => roledefinitions.Include(thisRole => thisRole.Name, thisRole => thisRole.Id)); + clientContext.ExecuteQuery(); + string userAllowedPermissions = searchSettings.UserPermissions; + + List roleDefinition = new List(); + if (!String.IsNullOrWhiteSpace(userAllowedPermissions)) + { + //// Get the user permissions from the Resource file + List userPermissions = userAllowedPermissions.ToUpperInvariant().Trim().Split(new string[] { ServiceConstants.COMMA }, StringSplitOptions.RemoveEmptyEntries).ToList(); + //// Filter only the allowed roles using LINQ query + roleDefinition = (from webRole in web.RoleDefinitions.ToList() + where userPermissions.Contains(webRole.Name.ToUpperInvariant()) + select webRole).ToList(); + } + return roleDefinition; + + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// + /// + /// + /// + public IList SearchUsers(SearchRequestVM searchRequestVM) + { + var client = searchRequestVM.Client; + var searchObject = searchRequestVM.SearchObject; + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + + ClientPeoplePickerQueryParameters queryParams = new ClientPeoplePickerQueryParameters(); + queryParams.AllowMultipleEntities = searchSettings.PeoplePickerAllowMultipleEntities; + queryParams.MaximumEntitySuggestions = searchSettings.PeoplePickerMaximumEntitySuggestions; + queryParams.PrincipalSource = PrincipalSource.All; + queryParams.PrincipalType = PrincipalType.User | PrincipalType.SecurityGroup; + queryParams.QueryString = searchObject.SearchTerm; + int peoplePickerMaxRecords = searchSettings.PeoplePickerMaxRecords; + + ClientResult clientResult = ClientPeoplePickerWebServiceInterface.ClientPeoplePickerSearchUser(clientContext, queryParams); + clientContext.ExecuteQuery(); + string results = clientResult.Value; + IList foundUsers = JsonConvert.DeserializeObject>(results).Where(result => (string.Equals(result.EntityType, ServiceConstants.PEOPLE_PICKER_ENTITY_TYPE_USER, + StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.Description)) || (!string.Equals(result.EntityType, + ServiceConstants.PEOPLE_PICKER_ENTITY_TYPE_USER, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.EntityData.Email))).Take(peoplePickerMaxRecords).ToList(); + return foundUsers; + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + public GenericResponseVM GetConfigurations(string siteCollectionUrl, string listName) + { + try + { + GenericResponseVM genericResponse = null; + ListItem settingsItem = null; + using (ClientContext clientContext = spoAuthorization.GetClientContext(siteCollectionUrl)) + { + if (spList.CheckPermissionOnList(clientContext, listName, PermissionKind.EditListItems)) + { + string listQuery = string.Format(CultureInfo.InvariantCulture, camlQueries.MatterConfigurationsListQuery, + searchSettings.ManagedPropertyTitle, searchSettings.MatterConfigurationTitleValue); + settingsItem = spList.GetData(clientContext, listNames.MatterConfigurationsList, listQuery).FirstOrDefault(); + if (settingsItem != null) + { + genericResponse = new GenericResponseVM(); + genericResponse.Code = WebUtility.HtmlDecode(Convert.ToString(settingsItem[searchSettings.MatterConfigurationColumn])); + genericResponse.Value = Convert.ToString(settingsItem[searchSettings.ColumnNameModifiedDate], CultureInfo.InvariantCulture); + return genericResponse; + } + else + { + genericResponse = new GenericResponseVM(); + genericResponse.Code = "0"; + genericResponse.Value = string.Empty; + return genericResponse; + } + } + else + { + genericResponse = new GenericResponseVM(); + genericResponse.Code = errorSettings.UserNotSiteOwnerCode; + genericResponse.Value = errorSettings.UserNotSiteOwnerMessage; + genericResponse.IsError = true; + return genericResponse; + } + + } + + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + #endregion + + #region Private Methods + /// + /// Pins the record and associate to logged-in user. + /// + /// The client context object + /// This is an object that contains the details of the specific pinned matter/document. + /// If the user is pinning a matter, this will be true, else will be false. + /// It returns a string object, that contains the execution status of the PinThisRecord function. + internal bool PinThisRecord(ClientContext clientContext, Client client, object getUserPinnedDetails, bool isMatterView) + { + bool status = false; + if (clientContext!=null) + { + string userAlias = string.Empty; + string pinnedDetailsJson = string.Empty; + ListItemCollection listItems; + PinUnpinDetails userPinnedDetails = GetCurrentUserPinnedDetails(isMatterView, getUserPinnedDetails); + try + { + List list = clientContext.Web.Lists.GetByTitle(userPinnedDetails.ListName); + Users currentUserDetail = userDetails.GetLoggedInUserDetails(clientContext); + userAlias = currentUserDetail.LogOnName; + listItems = spList.GetData(clientContext, userPinnedDetails.ListName, string.Format(CultureInfo.InvariantCulture, + camlQueries.UserPinnedDetailsQuery, + searchSettings.PinnedListColumnUserAlias, userAlias, userPinnedDetails.PinnedListColumnDetails)); + ////Pinned matter/document(s) exists for users + if (null != listItems && 0 < listItems.Count) + { + ////Logic to create pinned matter/document + if (isMatterView) + { + string userPinnedMatter = !string.IsNullOrEmpty(Convert.ToString(listItems[0][searchSettings.PinnedListColumnMatterDetails], + CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][searchSettings.PinnedListColumnMatterDetails], + CultureInfo.InvariantCulture) : string.Empty; + // Check if empty entry is retrieved + if (!string.IsNullOrWhiteSpace(userPinnedMatter)) + { + Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); + // Check if matter is already pinned + if (!userpinnedMatterCollection.ContainsKey(userPinnedDetails.UserPinnedMatterData.MatterUrl)) + { + userpinnedMatterCollection.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData); + pinnedDetailsJson = JsonConvert.SerializeObject(userpinnedMatterCollection, Newtonsoft.Json.Formatting.Indented); + } + else + { + status = true; + } + } + else + { + pinnedDetailsJson = GetFirstPinnedMatter(userPinnedDetails); + } + } + else + { + string userPinnedDocument = !string.IsNullOrEmpty(Convert.ToString(listItems[0][searchSettings.PinnedListColumnDocumentDetails], + CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][searchSettings.PinnedListColumnDocumentDetails], CultureInfo.InvariantCulture) : string.Empty; + if (!string.IsNullOrWhiteSpace(userPinnedDocument)) + { + Dictionary userpinnedDocumentCollection = JsonConvert.DeserializeObject>(userPinnedDocument); + // Check if document is already pinned + if (!userpinnedDocumentCollection.ContainsKey(userPinnedDetails.URL)) + { + userpinnedDocumentCollection.Add(userPinnedDetails.URL, userPinnedDetails.UserPinnedDocumentData); + pinnedDetailsJson = JsonConvert.SerializeObject(userpinnedDocumentCollection, Newtonsoft.Json.Formatting.Indented); + } + else + { + status = true; + } + } + else + { + pinnedDetailsJson = GetFirstPinnedDocument(userPinnedDetails); + } + } + + // Run update query only when status is false + if (!status) + { + ////We are maintaining single list item entry for user + listItems[0][userPinnedDetails.PinnedListColumnDetails] = pinnedDetailsJson; + listItems[0].Update(); + clientContext.ExecuteQuery(); + status = true; + } + } + else + { + ////No pinned matter/document(s) for logged in user. Create pinned matter/document for the user. + ////Create pin request + if (isMatterView) + { + pinnedDetailsJson = GetFirstPinnedMatter(userPinnedDetails); + } + else + { + pinnedDetailsJson = GetFirstPinnedDocument(userPinnedDetails); + } + ////Logic to create list item entry for user + ListItemCreationInformation listItemInformation = new ListItemCreationInformation(); + ListItem listItem = list.AddItem(listItemInformation); + listItem[searchSettings.PinnedListColumnUserAlias] = userAlias; + listItem[userPinnedDetails.PinnedListColumnDetails] = pinnedDetailsJson; + listItem.Update(); + clientContext.ExecuteQuery(); + listItem.BreakRoleInheritance(false, true); // Remove inheriting permissions on item + clientContext.ExecuteQuery(); + status = true; + } + return status; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + return status; + } + + /// + /// Gets the first pinned document serialized JSON object + /// + /// User document pin details object + /// + private string GetFirstPinnedDocument(PinUnpinDetails userPinnedDetails) + { + try + { + Dictionary userFirstPinnedDocument = new Dictionary(); + userFirstPinnedDocument.Add(userPinnedDetails.URL, userPinnedDetails.UserPinnedDocumentData); + string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedDocument, Newtonsoft.Json.Formatting.Indented); + return pinnedDetailsJson; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Gets the first pinned matter serialized JSON object + /// + /// User matter pin details object + /// JSON format of pin data + private string GetFirstPinnedMatter(PinUnpinDetails userPinnedDetails) + { + try + { + Dictionary userFirstPinnedMatter = new Dictionary(); + userFirstPinnedMatter.Add(userPinnedDetails.UserPinnedMatterData.MatterUrl, userPinnedDetails.UserPinnedMatterData); + string pinnedDetailsJson = JsonConvert.SerializeObject(userFirstPinnedMatter, Newtonsoft.Json.Formatting.Indented); + return pinnedDetailsJson; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Removes the record and dissociate from logged-in user. + /// + /// The client context. + /// This is an object that contains the details of the specific pinned matter/document. + /// If the user is pinning a matter, this will be true, else will be false. + /// It returns a string object, that contains the execution status of the function. + internal bool UnPinThisRecord(ClientContext clientContext, Client client, object getUserPinnedDetails, bool isMatterView) + { + bool status = false; + if (null != clientContext) + { + string userAlias = string.Empty; + ListItemCollection listItems; + PinUnpinDetails userPinnedDetails = GetCurrentUserPinnedDetails(isMatterView, getUserPinnedDetails); + try + { + Users currentUserDetail = userDetails.GetLoggedInUserDetails(clientContext); + userAlias = currentUserDetail.LogOnName; + listItems = spList.GetData(clientContext, userPinnedDetails.ListName, string.Format(CultureInfo.InvariantCulture, + camlQueries.UserPinnedDetailsQuery, searchSettings.PinnedListColumnUserAlias, + userAlias, userPinnedDetails.PinnedListColumnDetails)); + + ////Pinned matter/document(s) exists for users + if (null != listItems && 0 < listItems.Count) + { + ////Logic to create pinned matter/document + if (isMatterView) + { + string userPinnedMatter = + !string.IsNullOrEmpty(Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture)) ? + Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], CultureInfo.InvariantCulture) : string.Empty; + Dictionary userpinnedMatterCollection = JsonConvert.DeserializeObject>(userPinnedMatter); + + if (!string.IsNullOrWhiteSpace(userPinnedDetails.UserPinnedMatterData.MatterName) && + userpinnedMatterCollection.ContainsKey(userPinnedDetails.UserPinnedMatterData.MatterName)) + { + ////Only 1 pinned request for user + if (1 == userpinnedMatterCollection.Count) + { + ////We are maintaining single list item entry for user + listItems[0].DeleteObject(); + } + else + { + ////Matter already exists + userpinnedMatterCollection.Remove(userPinnedDetails.UserPinnedMatterData.MatterName); + string updatedMatter = JsonConvert.SerializeObject(userpinnedMatterCollection, Formatting.Indented); + ////We are maintaining single list item entry for user + listItems[0][searchSettings.PinnedListColumnMatterDetails] = updatedMatter; + listItems[0].Update(); + } + } + } + else + { + string userPinnedDocument = !string.IsNullOrEmpty(Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], + CultureInfo.InvariantCulture)) ? Convert.ToString(listItems[0][userPinnedDetails.PinnedListColumnDetails], + CultureInfo.InvariantCulture) : string.Empty; + Dictionary userpinnedDocumentCollection = + JsonConvert.DeserializeObject>(userPinnedDocument); + if (!string.IsNullOrWhiteSpace(userPinnedDetails.URL) && userpinnedDocumentCollection.ContainsKey(userPinnedDetails.URL)) + { + ////Only 1 pinned request for user + if (1 == userpinnedDocumentCollection.Count) + { + ////We are maintaining single list item entry for user + listItems[0].DeleteObject(); + } + else + { + //// Matter already exists + userpinnedDocumentCollection.Remove(userPinnedDetails.URL); + string updatedDocument = JsonConvert.SerializeObject(userpinnedDocumentCollection, Newtonsoft.Json.Formatting.Indented); + + ////We are maintaining single list item entry for user + listItems[0][userPinnedDetails.PinnedListColumnDetails] = updatedDocument; + listItems[0].Update(); + } + } + } + + clientContext.ExecuteQuery(); + status = true; + } + return status; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + return status; + } + + /// + /// Gets the current user pinned details. + /// + /// If the user is pinning a matter, this will be true, else will be false. + /// This is an object that contains the details of the specific pinned matter/document. + /// This returns an object that contains the details of the specific pinned matter/document. + internal PinUnpinDetails GetCurrentUserPinnedDetails(bool isMatterView, object getUserPinnedDetails) + { + PinUnpinDetails userPinnedDetails = new PinUnpinDetails(); + try + { + if (isMatterView) + { + userPinnedDetails.UserPinnedMatterData = (MatterData)getUserPinnedDetails; + } + else + { + userPinnedDetails.UserPinnedDocumentData = (DocumentData)getUserPinnedDetails; + } + + userPinnedDetails.ListName = isMatterView ? listNames.UserPinnedMatterListName : listNames.UserPinnedDocumentListName; + userPinnedDetails.PinnedListColumnDetails = isMatterView ? searchSettings.PinnedListColumnMatterDetails : searchSettings.PinnedListColumnDocumentDetails; + userPinnedDetails.URL = isMatterView ? userPinnedDetails.UserPinnedMatterData.MatterUrl : userPinnedDetails.UserPinnedDocumentData.DocumentUrl; + return userPinnedDetails; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + /// + /// Returns the query to filter the matters. + /// + /// The search object. + /// The keyword query. + /// It returns a keyword query object. + private KeywordQuery FilterMatters(SearchObject searchObject, KeywordQuery keywordQuery) + { + string filterValues = string.Empty; + try { + if (null != searchObject && null != keywordQuery) + { + if (null != searchObject.Filters) + { + if (null != searchObject.Filters.AOLList && 0 < searchObject.Filters.AOLList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.AOLList[0])) + { + filterValues = FormFilterQuery(searchSettings.ManagedPropertyAreaOfLaw, searchObject.Filters.AOLList); + keywordQuery.RefinementFilters.Add(filterValues); + } + + if (null != searchObject.Filters.PGList && 0 < searchObject.Filters.PGList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.PGList[0])) + { + filterValues = FormFilterQuery(searchSettings.ManagedPropertyPracticeGroup, searchObject.Filters.PGList); + keywordQuery.RefinementFilters.Add(filterValues); + } + keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.FromDate, searchObject.Filters.ToDate, searchSettings.ManagedPropertyOpenDate); + if (null != searchObject.Filters.ClientsList && 0 < searchObject.Filters.ClientsList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.ClientsList[0])) + { + filterValues = FormFilterQuery(searchSettings.ManagedPropertyClientName, searchObject.Filters.ClientsList); + keywordQuery.RefinementFilters.Add(filterValues); + } + } + + keywordQuery = FilterMattersUtility(searchObject, keywordQuery); + + keywordQuery = FilterCommonDetails(searchObject, keywordQuery, true); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return keywordQuery; + } + + /// + /// Prepares and returns the query to filter the documents. + /// + /// The search object. + /// The keyword query. + /// It returns a Keyword Query object. + internal KeywordQuery FilterDocuments(SearchObject searchObject, KeywordQuery keywordQuery) + { + string filterValues = string.Empty; + try + { + if (null != searchObject && null != keywordQuery) + { + if (null != searchObject.Filters) + { + keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.FromDate, searchObject.Filters.ToDate, searchSettings.ManagedPropertyCreated); + if (null != searchObject.Filters.DocumentAuthor && !string.IsNullOrWhiteSpace(searchObject.Filters.DocumentAuthor)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyAuthor, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.DocumentAuthor, ServiceConstants.DOUBLE_QUOTE)); + } + + if (0 < searchObject.Filters.ClientsList.Count && !string.IsNullOrWhiteSpace(searchObject.Filters.ClientsList[0])) + { + filterValues = FormFilterQuery(searchSettings.ManagedPropertyDocumentClientName, searchObject.Filters.ClientsList); + keywordQuery.RefinementFilters.Add(filterValues); + } + + /* New refinement filters for list view control */ + + if (!string.IsNullOrWhiteSpace(searchObject.Filters.Name)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyFileName, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.Name, ServiceConstants.DOUBLE_QUOTE)); + } + + if (!string.IsNullOrWhiteSpace(searchObject.Filters.ClientName)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyDocumentClientName, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.ClientName, ServiceConstants.DOUBLE_QUOTE)); + } + + if (null != searchObject.Filters.DocumentCheckoutUsers && !string.IsNullOrWhiteSpace(searchObject.Filters.DocumentCheckoutUsers)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyDocumentCheckOutUser, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.DocumentCheckoutUsers, ServiceConstants.DOUBLE_QUOTE)); + } + } + keywordQuery = FilterCommonDetails(searchObject, keywordQuery, false); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return keywordQuery; + } + + /// + /// Forms filter query for the specified property and data list. + /// + /// Name of the property + /// List of values as data + /// Filter query + private string FormFilterQuery(string propertyName, IList dataList) + { + string previousFilterValues = string.Empty; + string result = string.Empty; + try + { + if (!string.IsNullOrWhiteSpace(propertyName) && null != dataList) + { + if (1 == dataList.Count) + { + previousFilterValues = string.Concat(propertyName, ServiceConstants.COLON); + } + else + { + previousFilterValues = string.Concat(propertyName, ServiceConstants.COLON, ServiceConstants.SPACE, + ServiceConstants.OPENING_BRACKET, ServiceConstants.OPERATOR_OR, ServiceConstants.OPENING_BRACKET); + } + for (int counter = 0; counter < dataList.Count; counter++) + { + if (0 < counter) + { + previousFilterValues += ServiceConstants.COMMA; + } + previousFilterValues += string.Concat(ServiceConstants.DOUBLE_QUOTE, dataList[counter], ServiceConstants.DOUBLE_QUOTE); + } + if (1 != dataList.Count) + { + previousFilterValues += string.Concat(ServiceConstants.CLOSING_BRACKET, ServiceConstants.CLOSING_BRACKET); + } + } + result = previousFilterValues; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Adds date refinement filter to the keyword query object + /// + /// The keyword query + /// From date + /// To date + /// Managed property name + /// Returns a keyword query object + private KeywordQuery AddDateRefinementFilter(KeywordQuery keywordQuery, string fromDate, string toDate, string managedProperty) + { + try + { + if (!string.IsNullOrWhiteSpace(fromDate) && !string.IsNullOrWhiteSpace(toDate)) + { + keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ServiceConstants.COLON, ServiceConstants.OPERATOR_RANGE, + ServiceConstants.OPENING_BRACKET, fromDate, ServiceConstants.COMMA, toDate, ServiceConstants.CLOSING_BRACKET)); + } + else if (string.IsNullOrWhiteSpace(fromDate) && !string.IsNullOrWhiteSpace(toDate)) + { + keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ServiceConstants.COLON, ServiceConstants.OPERATOR_RANGE, + ServiceConstants.OPENING_BRACKET, ServiceConstants.MIN_DATE, ServiceConstants.COMMA, toDate, ServiceConstants.CLOSING_BRACKET)); + } + else if (!string.IsNullOrWhiteSpace(fromDate) && string.IsNullOrWhiteSpace(toDate)) + { + keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ServiceConstants.COLON, ServiceConstants.OPERATOR_RANGE, + ServiceConstants.OPENING_BRACKET, fromDate, ServiceConstants.COMMA, ServiceConstants.MAX_DATE, ServiceConstants.CLOSING_BRACKET)); + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return keywordQuery; + } + + /// + /// Returns the query to filter the matters. + /// + /// The search object. + /// The keyword query. + /// It returns a keyword query object. + private KeywordQuery FilterMattersUtility(SearchObject searchObject, KeywordQuery keywordQuery) + { + try + { + if (null != searchObject && null != keywordQuery && null != searchObject.Filters) + { + /* New refinement filters for list view control */ + if (!string.IsNullOrWhiteSpace(searchObject.Filters.Name)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyMatterName, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.Name, ServiceConstants.DOUBLE_QUOTE)); + } + + if (!string.IsNullOrWhiteSpace(searchObject.Filters.ClientName)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyClientName, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.ClientName, ServiceConstants.DOUBLE_QUOTE)); + } + + if (null != searchObject.Filters.ResponsibleAttorneys && !string.IsNullOrWhiteSpace(searchObject.Filters.ResponsibleAttorneys)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertyResponsibleAttorney, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.ResponsibleAttorneys, ServiceConstants.DOUBLE_QUOTE)); + } + + if (!string.IsNullOrWhiteSpace(searchObject.Filters.SubareaOfLaw)) + { + keywordQuery.RefinementFilters.Add(string.Concat(searchSettings.ManagedPropertySubAreaOfLaw, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, searchObject.Filters.SubareaOfLaw, ServiceConstants.DOUBLE_QUOTE)); + } + if (null != searchObject.Filters.DateFilters) + { + ////// Add refiner for Open date value + keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.OpenDateFrom, + searchObject.Filters.DateFilters.OpenDateTo, searchSettings.ManagedPropertyOpenDate); + } + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + return keywordQuery; + } + + /// + /// Returns the query to filter the matters/ documents for common filters. + /// + /// The search object. + /// The keyword query. + /// Flag to identify matters/documents view. + /// It returns a keyword query object. + private KeywordQuery FilterCommonDetails(SearchObject searchObject, KeywordQuery keywordQuery, bool isMatterView) + { + try + { + if (null != searchObject && null != keywordQuery) + { + + if (null != searchObject.Filters.DateFilters) + { + string lastModifiedTime = searchSettings.ManagedPropertyLastModifiedTime; + //// Add refiner for Modified date value + if (!isMatterView) + { + lastModifiedTime = searchSettings.ManagedPropertyDocumentLastModifiedTime; + } + keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.ModifiedFromDate, + searchObject.Filters.DateFilters.ModifiedToDate, lastModifiedTime); + + ////// Add refiner for Created date value + keywordQuery = AddDateRefinementFilter(keywordQuery, searchObject.Filters.DateFilters.CreatedFromDate, + searchObject.Filters.DateFilters.CreatedToDate, searchSettings.ManagedPropertyCreated); + } + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return keywordQuery; + } + + /// + /// Prepares and returns the keyword query to get data from SharePoint Search based on filtering condition. + /// + /// The client object + /// The search object. + /// The keyword query. + /// The filter condition. + /// The managed property. + /// If the user is pinning a matter, this will be true, else will be false. + /// It returns a Keyword Query object. + private KeywordQuery KeywordQueryMetrics(Client client, SearchObject searchObject, KeywordQuery keywordQuery, + string filterCondition, string managedProperty, bool isMatterView) + { + KeywordQuery result = null; + try + { + if (generalSettings.IsTenantDeployment) + { + keywordQuery.QueryText = searchObject.SearchTerm; + } + else + { + keywordQuery.QueryText = "(" + searchObject.SearchTerm + " AND site:" + client.Url + ")"; + } + + keywordQuery.RefinementFilters.Add(filterCondition); + if (isMatterView) + { + keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ServiceConstants.COLON, + ServiceConstants.DOUBLE_QUOTE, true, ServiceConstants.DOUBLE_QUOTE)); + } + else + { + + string[] invalidExtensions = searchSettings.FindDocumentInvalidExtensions.Split(','); + string chunk = string.Empty; + + foreach (string extension in invalidExtensions) + { + chunk = chunk + "equals" + ServiceConstants.OPENING_BRACKET + ServiceConstants.DOUBLE_QUOTE + extension + + ServiceConstants.DOUBLE_QUOTE + ServiceConstants.CLOSING_BRACKET + ServiceConstants.COMMA; + } + chunk = chunk.Remove(chunk.Length - 1); + + keywordQuery.RefinementFilters.Add(string.Concat("not" + ServiceConstants.OPENING_BRACKET + "FileType", ServiceConstants.COLON, ServiceConstants.OPERATOR_OR + ServiceConstants.OPENING_BRACKET + + chunk + ServiceConstants.CLOSING_BRACKET + ServiceConstants.CLOSING_BRACKET + )); + keywordQuery.RefinementFilters.Add(string.Concat(managedProperty, ServiceConstants.COLON, "equals", ServiceConstants.OPENING_BRACKET + ServiceConstants.DOUBLE_QUOTE + + "1" + ServiceConstants.DOUBLE_QUOTE + ServiceConstants.CLOSING_BRACKET + )); + } + + keywordQuery.TrimDuplicates = false; + if (0 < searchObject.PageNumber && 0 < searchObject.ItemsPerPage) + { + keywordQuery.StartRow = (searchObject.PageNumber - 1) * searchObject.ItemsPerPage; + keywordQuery.RowLimit = searchObject.ItemsPerPage; + } + + result = keywordQuery; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Assigns the keyword query values. + /// + /// The keyword query. + /// The managed properties. + /// It returns a Keyword Query object. + private KeywordQuery AssignKeywordQueryValues(KeywordQuery keywordQuery, List managedProperties) + { + KeywordQuery result = null; + try + { + if (keywordQuery != null) + { + keywordQuery.SelectProperties.Clear(); + foreach (string selectProperties in managedProperties) + { + keywordQuery.SelectProperties.Add(selectProperties); + } + result = keywordQuery; + } + else + { + result = null; + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Fires query on SharePoint Search and fills the result data. + /// + /// The client context. + /// The keyword query. + /// The search object. + /// The flag to determine weather call is from Search Matter or Search Document. + /// List of managed properties + /// It returns a string object, that contains all the results combined with dollar pipe dollar separator. + private SearchResponseVM FillResultData(ClientContext clientContext, KeywordQuery keywordQuery, + SearchRequestVM searchRequestVM, Boolean isMatterSearch, List managedProperties) + { + SearchResponseVM searchResponseVM = new SearchResponseVM() ; + Boolean isReadOnly; + try + { + var searchObject = searchRequestVM.SearchObject; + //var client = searchRequestVM.Client; + if (null != searchObject.Sort) + { + keywordQuery.EnableSorting = true; + keywordQuery = GetSortByProperty(keywordQuery, searchObject, isMatterSearch); + } + SearchExecutor searchExecutor = new SearchExecutor(clientContext); + ClientResult resultsTableCollection = searchExecutor.ExecuteQuery(keywordQuery); + Users currentLoggedInUser = userDetails.GetLoggedInUserDetails(clientContext); + + if (null != resultsTableCollection && null != resultsTableCollection.Value && 0 < + resultsTableCollection.Value.Count && null != resultsTableCollection.Value[0].ResultRows) + { + if (isMatterSearch && 0 < resultsTableCollection.Value.Count && + null != resultsTableCollection.Value[0].ResultRows && !string.IsNullOrWhiteSpace(currentLoggedInUser.Email)) + { + foreach (IDictionary matterMetadata in resultsTableCollection.Value[0].ResultRows) + { + isReadOnly = false; + if (null != matterMetadata) + { + // Decode matter properties + DecodeMatterProperties(matterMetadata); + string readOnlyUsers = Convert.ToString(matterMetadata[searchSettings.ManagedPropertyBlockedUploadUsers], CultureInfo.InvariantCulture); + if (!string.IsNullOrWhiteSpace(readOnlyUsers)) + { + isReadOnly = IsUserReadOnlyForMatter(isReadOnly, currentLoggedInUser.Name, + currentLoggedInUser.Email, readOnlyUsers); + } + matterMetadata.Add(generalSettings.IsReadOnlyUser, isReadOnly); + } + } + } + else + { + /*Keeping the code to clean the author values*/ + foreach (IDictionary documentMetadata in resultsTableCollection.Value[0].ResultRows) + { + if (null != documentMetadata) + { + string authorData = Convert.ToString(documentMetadata[searchSettings.ManagedPropertyAuthor], CultureInfo.InvariantCulture); + int ltIndex = authorData.IndexOf(ServiceConstants.OPENING_ANGULAR_BRACKET, StringComparison.Ordinal); + int gtIndex = authorData.IndexOf(ServiceConstants.CLOSING_ANGULAR_BRACKET, StringComparison.Ordinal); + authorData = (0 <= ltIndex && ltIndex < gtIndex) ? authorData.Remove(ltIndex, (gtIndex - ltIndex) + 1) : authorData; + authorData = authorData.Replace(ServiceConstants.ENCODED_DOUBLE_QUOTES, string.Empty); + documentMetadata[searchSettings.ManagedPropertyAuthor] = authorData.Trim(); + } + } + } + if (resultsTableCollection.Value.Count>1) + { + searchResponseVM.TotalRows = resultsTableCollection.Value[0].TotalRows; + searchResponseVM.SearchResults = resultsTableCollection.Value[0].ResultRows; + } + else + { + if (resultsTableCollection.Value[0].TotalRows==0) + { + searchResponseVM = NoDataRow(managedProperties); + } + else + { + searchResponseVM.TotalRows = resultsTableCollection.Value[0].TotalRows; + searchResponseVM.SearchResults = resultsTableCollection.Value[0].ResultRows; + } + } + } + else + { + searchResponseVM = NoDataRow(managedProperties); + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return searchResponseVM; + } + + /// + /// Defines the sorting property and direction for querying SharePoint Search. + /// + /// Keyword object + /// Search object + /// Boolean flag which determines current search is for matters or documents + /// + private KeywordQuery GetSortByProperty(KeywordQuery keywordQuery, SearchObject searchObject, Boolean isMatterSearch) + { + string matterIDRefiner = string.Empty; + try + { + ////Sorting by specified property 0 --> Ascending order and 1 --> Descending order + if (!string.IsNullOrWhiteSpace(searchObject.Sort.ByProperty)) + { + keywordQuery = AddSortingRefiner(keywordQuery, searchObject.Sort.ByProperty, searchObject.Sort.Direction); + //// Add Matter ID property as second level sort for Client.MatterID column based on Search Matter or Search Document + if (searchSettings.ManagedPropertyClientID == searchObject.Sort.ByProperty || + searchSettings.ManagedPropertyDocumentClientId == searchObject.Sort.ByProperty) + { + if (isMatterSearch) + { + matterIDRefiner = searchSettings.ManagedPropertyMatterId; + } + else + { + matterIDRefiner = searchSettings.ManagedPropertyDocumentMatterId; + } + keywordQuery = AddSortingRefiner(keywordQuery, matterIDRefiner, searchObject.Sort.Direction); + } + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return keywordQuery; + } + + /// + /// Decodes matter properties before sending them to UI + /// + /// Dictionary object contains matter meta data + private void DecodeMatterProperties(IDictionary matterMetadata) + { + + // Decode matter properties + matterMetadata[searchSettings.ManagedPropertyTitle] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyTitle]); + matterMetadata[searchSettings.ManagedPropertySiteName] = DecodeValues(matterMetadata[searchSettings.ManagedPropertySiteName]); + matterMetadata[searchSettings.ManagedPropertyDescription] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyDescription]); + matterMetadata[searchSettings.ManagedPropertyPracticeGroup] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyPracticeGroup]); + matterMetadata[searchSettings.ManagedPropertyAreaOfLaw] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyAreaOfLaw]); + matterMetadata[searchSettings.ManagedPropertySubAreaOfLaw] = DecodeValues(matterMetadata[searchSettings.ManagedPropertySubAreaOfLaw]); + matterMetadata[searchSettings.ManagedPropertyCustomTitle] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyCustomTitle]); + matterMetadata[searchSettings.ManagedPropertyPath] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyPath]); + matterMetadata[searchSettings.ManagedPropertyMatterName] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyMatterName]); + matterMetadata[searchSettings.ManagedPropertyOpenDate] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyOpenDate]); + matterMetadata[searchSettings.ManagedPropertyClientName] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyClientName]); + matterMetadata[searchSettings.ManagedPropertyBlockedUploadUsers] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyBlockedUploadUsers]); + matterMetadata[searchSettings.ManagedPropertyResponsibleAttorney] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyResponsibleAttorney]); + matterMetadata[searchSettings.ManagedPropertyClientID] = DecodeValues(matterMetadata[searchSettings.ManagedPropertyClientID]); + } + + /// + /// Provides the required matter properties + /// + /// Matter Properties object + /// Decoded String + private static string DecodeValues(object value) => null != value ? WebUtility.HtmlDecode(Convert.ToString(value, CultureInfo.InvariantCulture)) : string.Empty; + + + /// + /// Checks if logged-in user has read permission on matter. + /// + /// Flag indicating if user has read permission on matter + /// Current logged-in user name + /// List of read only user for matter + /// Flag indicating if user has read permission on matter + private bool IsUserReadOnlyForMatter(Boolean isReadOnly, string currentLoggedInUser, string currentLoggedInUserEmail, string readOnlyUsers) + { + try { + List readOnlyUsersList = readOnlyUsers.Trim().Split(new string[] { ServiceConstants.SEMICOLON }, StringSplitOptions.RemoveEmptyEntries).ToList(); + List currentReadOnlyUser = (from readOnlyUser in readOnlyUsersList + where string.Equals(readOnlyUser.Trim(), currentLoggedInUser.Trim(), StringComparison.OrdinalIgnoreCase) || + string.Equals(readOnlyUser.Trim(), currentLoggedInUserEmail.Trim(), StringComparison.OrdinalIgnoreCase) + select readOnlyUser).ToList(); + if (null != currentReadOnlyUser && 0 < currentReadOnlyUser.Count) + { + isReadOnly = true; + } + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return isReadOnly; + } + + /// + /// Returns the Keyword query object with refiners added for sorting + /// + /// Keyword object + /// Property by which sort is applied + /// Direction in which sort is applied (0 --> Ascending order and 1 --> Descending order) + /// Keyword object with sorting refiners applied + private static KeywordQuery AddSortingRefiner(KeywordQuery keywordQuery, string sortByProperty, int sortDirection) + { + if (0 == sortDirection) + { + keywordQuery.SortList.Add(sortByProperty, SortDirection.Ascending); + } + else if (1 == sortDirection) + { + keywordQuery.SortList.Add(sortByProperty, SortDirection.Descending); + } + return keywordQuery; + } + + /// + /// Function to return no data row + /// + /// Managed properties information + /// No data row + private SearchResponseVM NoDataRow(List managedProperties) + { + SearchResponseVM searchResponseVM = new SearchResponseVM(); + try { + List> noDataList = new List>(); + Dictionary noDataObject = new Dictionary(); + managedProperties.Add(ServiceConstants.PATH_FIELD_NAME); + foreach (string managedProperty in managedProperties) + { + if (!noDataObject.ContainsKey(managedProperty)) + { + noDataObject.Add(managedProperty, string.Empty); + } + } + + noDataList.Add(noDataObject); + searchResponseVM.TotalRows = 0; + searchResponseVM.SearchResults = noDataList; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + //string result = string.Concat(ServiceConstants.OPEN_SQUARE_BRACE, + // JsonConvert.SerializeObject(noDataObject), ServiceConstants.CLOSE_SQUARE_BRACE, + // ServiceConstants.DOLLAR, ServiceConstants.PIPE, ServiceConstants.DOLLAR, 0); + return searchResponseVM; + } + + + #endregion + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Site.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Site.cs new file mode 100644 index 00000000..d258b85d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Site.cs @@ -0,0 +1,29 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class Site:ISite + { + ISPOAuthorization spoAuthorization; + ClientContext clientContext; + public Site(ISPOAuthorization spoAuthorization) + { + this.spoAuthorization = spoAuthorization; + } + + public string GetCurrentSite(Client client) + { + clientContext = spoAuthorization.GetClientContext(client.Url); + var spWeb = clientContext.Web; + clientContext.Load(spWeb); + clientContext.ExecuteQuery(); + return spWeb.Title.ToString(); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Taxonomy.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Taxonomy.cs new file mode 100644 index 00000000..9a2b07cc --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/Taxonomy.cs @@ -0,0 +1,545 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Repository +// Author : v-rijadh +// Created : 06-19-2014 +//*************************************************************************** +// History +// Modified : 07-07-2016 +// Modified By : v-lapedd +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file provide methods to perform SharePoint term store functionalities. +// *********************************************************************** + + +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Taxonomy; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; + +#region Matter Namepspaces +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository.Extensions; +using System.Text; +using Newtonsoft.Json; +using System.IO; +using Microsoft.Extensions.Configuration; +#endregion + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This class contains all the methods which will read the SPO term store and returns taxonomy object + /// + public class Taxonomy:ITaxonomy + { + + #region Properties + private GeneralSettings generalSettings; + private ContentTypesConfig contentTypeSettings; + private LogTables logTables; + private readonly TaxonomySettings taxonomySettings; + private ISPOAuthorization spoAuthorization; + private ClientContext clientContext; + private TaxonomyResponseVM taxonomyResponseVM; + private ICustomLogger customLogger; + private IConfigurationRoot configuration; + //Initialize the minimum number of taxonomy levels. By default minimum levels will be 2 + private int level = 3; + #endregion + + /// + /// Constructor to inject required dependencies + /// + /// + /// + /// + /// + /// + public Taxonomy(IOptions generalSettings, + IOptions taxonomySettings, + IOptions contentTypeSettings, + IOptions logTables, + ISPOAuthorization spoAuthorization, ICustomLogger customLogger, + IConfigurationRoot configuration) + { + this.generalSettings = generalSettings.Value; + this.taxonomySettings = taxonomySettings.Value; + this.contentTypeSettings = contentTypeSettings.Value; + this.logTables = logTables.Value; + this.spoAuthorization = spoAuthorization; + taxonomyResponseVM = new TaxonomyResponseVM(); + this.customLogger = customLogger; + + this.configuration = configuration; + } + + /// + /// This method will return the taxonomy hierarchy either for the practice group term set or for client term sets + /// + /// The return type from this class + /// The sharepoint client context + /// The term store deatils that client has passed to we apiu + /// The general settings config values + /// The taxonomy settings config values + /// + public TaxonomyResponseVM GetTaxonomyHierarchy(Client client, TermStoreDetails termStoreDetails) + { + try + { + using (clientContext = spoAuthorization.GetClientContext(client.Url)) + { + TaxonomySession taxonomySession = TaxonomySession.GetTaxonomySession(clientContext); + TermStore termStore; + clientContext.Load(taxonomySession.TermStores); + clientContext.ExecuteQuery(); + termStore = taxonomySession.TermStores[0]; + clientContext.Load( + termStore, + store => store.Name, + store => store.Groups.Include( + group => group.Name)); + clientContext.ExecuteQuery(); + taxonomyResponseVM = GetTaxonomyHierarchy(termStore, termStoreDetails); + } + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return taxonomyResponseVM; + } + + /// + /// Iterates through the taxonomy hierarchy for the specified term set group. + /// + /// Client content for specified site + /// Term Store object + /// Term Store object containing Term store data + /// Fetch Group Terms Status + private TaxonomyResponseVM GetTaxonomyHierarchy (TermStore termStore, TermStoreDetails termStoreDetails) + { + try { + if (generalSettings.IsTenantDeployment) + { + foreach (TermGroup termGroup in termStore.Groups) + { + if (termGroup.Name == termStoreDetails.TermGroup) + { + taxonomyResponseVM = FetchGroupTerms(termGroup, termStoreDetails); + break; + } + } + } + else + { + TermGroup termGroup = termStore.GetSiteCollectionGroup(clientContext.Site, false); + taxonomyResponseVM = FetchGroupTerms(termGroup, termStoreDetails); + } + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return taxonomyResponseVM; + } + + /// + /// Fetches the term store data for the term group specified + /// + /// Client Context + /// Term Group from the Term store + /// Details of the Term Group + /// hierarchy of the Term Group + /// Hierarchy of the Term Group + private TaxonomyResponseVM FetchGroupTerms(TermGroup termGroup, + TermStoreDetails termStoreDetails) + { + try + { + //As a first step, load Practice Group Term set and anf its child terms only and not its child child terms + clientContext.Load( + termGroup, + group => group.Name, + group => group.TermSets.Include( + termSet => termSet.Name, + termSet => termSet.Id, + termSet => termSet.Terms.Include( + term => term.Name, + term => term.Id, + term => term.TermsCount, + term => term.CustomProperties + ))); + + clientContext.ExecuteQuery(); + + //This loop of the term set will get all the client termset and practice group term sets + foreach (TermSet termSet in termGroup.TermSets) + { + if (termSet.Name == termStoreDetails.TermSetName) + { + //This condition is if the UI is requesting practice group terms + if (termStoreDetails.TermSetName == taxonomySettings.PracticeGroupTermSetName) + { + taxonomyResponseVM.TermSets = GetManagedTermSetHierarchy(clientContext, termSet, termStoreDetails); + } + //This condition is if the UI is requesting client terms and the clients are defined as term set and not terms + else if (termStoreDetails.TermSetName == taxonomySettings.ClientTermSetName && + taxonomySettings.ClientTermPath==ServiceConstants.CLIENT_TERM_PATH) + { + taxonomyResponseVM.ClientTermSets = GetClientTermSetHierarchy(clientContext, termSet, termStoreDetails); + } + + } + } + + if (termStoreDetails.TermSetName == taxonomySettings.ClientTermSetName && + taxonomySettings.ClientTermPath != ServiceConstants.CLIENT_TERM_PATH) + { + //This condition is if the UI is requesting client terms and the clients are defined as terms and not term sets + foreach (TermSet termSet in termGroup.TermSets) + { + Term term = null; + if (termSet.TermExists(clientContext, termStoreDetails.TermSetName, ref term)) + { + taxonomyResponseVM.ClientTermSets = GetClientTerms(clientContext, term, termStoreDetails); + break; + } + } + } + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return taxonomyResponseVM; + } + + + + + /// + /// Gets the managed term set hierarchy with generic code using JSONWriter + /// + /// Term set object holding Practice Group terms + /// Term Store object containing Term store data + /// Serialized Object of Term Set + private string GetManagedTermSetHierarchy(ClientContext clientContext, TermSet termSet, TermStoreDetails termStoreDetails) + { + level = 3; + StringBuilder sb = new StringBuilder(); + JsonWriter jw = new JsonTextWriter(new StringWriter(sb)); + jw.Formatting = Formatting.Indented; + jw.WriteStartObject(); + jw.WritePropertyName("name"); + jw.WriteValue(termSet.Name); + jw.WritePropertyName("levels"); + jw.WriteValue(taxonomySettings.Levels); + jw.WritePropertyName(taxonomySettings.Level1Name); + jw.WriteStartArray(); + TermCollection termColl = termSet.Terms; + foreach (Term term in termColl) + { + jw.WriteStartObject(); + //Create level1 terms - Practice Groups + jw.WritePropertyName("termName"); + jw.WriteValue(term.Name); + jw.WritePropertyName("id"); + jw.WriteValue(Convert.ToString(term.Id, CultureInfo.InvariantCulture)); + jw.WritePropertyName("parentTermName"); + jw.WriteValue(termSet.Name); + jw.WritePropertyName("siteColumnName"); + jw.WriteValue(configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName1"]); + foreach (KeyValuePair customProperty in term.CustomProperties) + { + if (customProperty.Key.Equals(taxonomySettings.PracticeGroupCustomPropertyFolderNames, StringComparison.Ordinal)) + { + jw.WritePropertyName("folderNames"); + jw.WriteValue(customProperty.Value); + } + } + //Create level 2 terms - Area Of Law + jw.WritePropertyName(taxonomySettings.Level2Name); + if (term.TermsCount > 0) + { + jw.WriteStartArray(); + TermCollection termCollLevel2 = term.LoadTerms(clientContext); + foreach (Term termLevel2 in termCollLevel2) + { + if (termLevel2.Name != taxonomySettings.ClientTermSetName) + { + jw.WriteStartObject(); + jw.WritePropertyName("termName"); + jw.WriteValue(termLevel2.Name); + jw.WritePropertyName("id"); + jw.WriteValue(Convert.ToString(termLevel2.Id, CultureInfo.InvariantCulture)); + jw.WritePropertyName("parentTermName"); + jw.WriteValue(term.Name); + jw.WritePropertyName("siteColumnName"); + jw.WriteValue(configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName2"]); + foreach (KeyValuePair customProperty in term.CustomProperties) + { + if (customProperty.Key.Equals(taxonomySettings.PracticeGroupCustomPropertyFolderNames, StringComparison.Ordinal)) + { + jw.WritePropertyName("folderNames"); + jw.WriteValue(customProperty.Value); + } + } + //If the number of levels that are configured are more than 2, try to get the + //3rd level hierarchy + if (taxonomySettings.Levels > 2) + { + //Create level 3 terms - Sub Area Of LAW + if (termLevel2.TermsCount > 0) + { + jw.WritePropertyName(taxonomySettings.Level3Name); + jw.WriteStartArray(); + TermCollection termCollLevel3 = termLevel2.LoadTerms(clientContext); + string siteColumnName = configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName3"]; + int termLevelHierarchyPosition = 0; + GetChildTermsWithCustomProperties(termCollLevel3, termStoreDetails, termLevel2, jw, + siteColumnName, termLevelHierarchyPosition); + jw.WriteEndArray(); + } + jw.WriteEndObject(); + } + } + } + jw.WriteEndArray(); + } + jw.WriteEndObject(); + } + jw.WriteEndArray(); + jw.WriteEndObject(); + return sb.ToString(); + } + + /// + /// This method will update the taxonomy hierarchy object with custom properties that needs to be send to client. This is a recursive function + /// and it will loop until a term does not have any child terms + /// + /// The Term Collection object to which terms will be added + /// The term store details which the client has sent + /// The parent term from where the custom properties are read and assign to its child terms + /// + private void GetChildTermsWithCustomProperties(TermCollection termCollection, + TermStoreDetails termStoreDetails, Term parentTerm, JsonWriter jw, string siteColumnName, int termLevelHierarchyPosition) + { + try + { + //var subAreaTerms = new List(); + foreach (Term term in termCollection) + { + if (term.Name != taxonomySettings.ClientTermSetName) + { + jw.WriteStartObject(); + jw.WritePropertyName("termName"); + jw.WriteValue(term.Name); + jw.WritePropertyName("id"); + jw.WriteValue(Convert.ToString(term.Id, CultureInfo.InvariantCulture)); + jw.WritePropertyName("parentTermName"); + jw.WriteValue(parentTerm.Name); + jw.WritePropertyName("siteColumnName"); + jw.WriteValue(siteColumnName); + IDictionary childCustomProperties = term.CustomProperties; + IDictionary parentCustomProperties = parentTerm.CustomProperties; + foreach (KeyValuePair parentProperty in parentTerm.CustomProperties) + { + //if the key is present in the parent and not in the child, add that key value to the child custom properties + if (!childCustomProperties.Keys.Contains(parentProperty.Key)) + { + if (parentProperty.Key.Equals(termStoreDetails.CustomPropertyName, StringComparison.Ordinal)) + { + childCustomProperties.Add(parentProperty.Key, parentProperty.Value); + } + else if (parentProperty.Key.Equals(taxonomySettings.SubAreaOfLawDocumentTemplates, StringComparison.Ordinal)) + { + childCustomProperties.Add(parentProperty.Key, parentProperty.Value); + } + else + { + childCustomProperties.Add(parentProperty.Key, parentProperty.Value); + } + } + + //If the key is present in both and parent and child and if child value is empty and the parent value is not empty, + //update the child value with the parent value for the same key + if (childCustomProperties.Keys.Contains(parentProperty.Key) && childCustomProperties[parentProperty.Key] == string.Empty) + { + childCustomProperties[parentProperty.Key] = parentProperty.Value; + } + } + + //Add the custom properties to the subAreaTerms list collection + foreach (KeyValuePair customProperty in childCustomProperties) + { + if (customProperty.Key.Equals(termStoreDetails.CustomPropertyName, StringComparison.Ordinal)) + { + jw.WritePropertyName("documentTemplates"); + jw.WriteValue(customProperty.Value); + } + else if (customProperty.Key.Equals(taxonomySettings.SubAreaCustomPropertyFolderNames, StringComparison.Ordinal)) + { + + jw.WritePropertyName("folderNames"); + jw.WriteValue(customProperty.Value); + } + else if (customProperty.Key.Equals(taxonomySettings.SubAreaCustomPropertyisNoFolderStructurePresent, StringComparison.Ordinal)) + { + + jw.WritePropertyName("isNoFolderStructurePresent"); + jw.WriteValue(customProperty.Value); + } + else if (customProperty.Key.Equals(taxonomySettings.SubAreaOfLawDocumentTemplates, StringComparison.Ordinal)) + { + jw.WritePropertyName("documentTemplateNames"); + jw.WriteValue(customProperty.Value); + } + } + //Increment the level + level = level + 1; + //Check if we need to get more terms. + if (level <= taxonomySettings.Levels) + { + if (term.TermsCount > 0) + { + if(level==4) + { + jw.WritePropertyName(taxonomySettings.Level4Name); + } + //The app will support upto five level of hierarchy + if (level == 5) + { + jw.WritePropertyName(taxonomySettings.Level5Name); + } + jw.WriteStartArray(); + TermCollection termCollLevel4 = term.LoadTerms(clientContext); + siteColumnName = configuration.GetSection("ContentTypes").GetSection("ManagedColumns")["ColumnName"+ level]; + //Recursive function which will call it self until a given term does not have any child terms + GetChildTermsWithCustomProperties(termCollLevel4, termStoreDetails, term, jw, siteColumnName, termLevelHierarchyPosition); + jw.WriteEndArray(); + } + } + jw.WriteEndObject(); + } + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + + + /// + /// This method will be called if the clients are defined as terms and not as term sets + /// + /// The sharepoint client context + /// + /// + /// + private ClientTermSets GetClientTerms(ClientContext clientContext, Term term, TermStoreDetails termStoreDetails) + { + ClientTermSets tempClientTermSet = new ClientTermSets(); + try + { + tempClientTermSet.Name = taxonomySettings.ClientTermSetName; + /////Retrieve the Terms - level 1 + tempClientTermSet.ClientTerms = new List(); + TermCollection termColl = null; + termColl = term.LoadTerms(clientContext); + + return GetClientTermProperties(termColl, termStoreDetails, tempClientTermSet); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, + MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// This method will be called if the clients are defined as term set and not as terms + /// + /// Term set object holding Client terms + /// Term Store object containing Term store data + /// Serialized Object of Client Term Set + private ClientTermSets GetClientTermSetHierarchy(ClientContext clientContext, TermSet termSet, TermStoreDetails termStoreDetails) + { + ClientTermSets tempClientTermSet = new ClientTermSets(); + try + { + tempClientTermSet.Name = taxonomySettings.ClientTermSetName; + /////Retrieve the Terms - level 1 + tempClientTermSet.ClientTerms = new List(); + TermCollection termColl = null; + termColl = termSet.Terms; + return GetClientTermProperties(termColl, termStoreDetails, tempClientTermSet); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, + MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// This method will get all client term properties such as ID and URL + /// + /// The taxonomy client terms + /// The term store details which the UI has sent to the clients + /// The ClientTermSets object to which all the client terms are added + /// + private ClientTermSets GetClientTermProperties(TermCollection termColl, TermStoreDetails termStoreDetails, ClientTermSets clientTermSet) + { + try + { + foreach (Term term in termColl) + { + Client tempTermPG = new Client(); + tempTermPG.Name = term.Name; + if (term.CustomProperties.Count > 0) + { + tempTermPG.Url = string.Empty; + tempTermPG.Id = string.Empty; + foreach (KeyValuePair customProperty in term.CustomProperties) + { + if (customProperty.Key.Equals(termStoreDetails.CustomPropertyName, StringComparison.Ordinal)) + { + tempTermPG.Url = customProperty.Value; + } + + if (customProperty.Key.Equals(taxonomySettings.ClientCustomPropertiesId, StringComparison.Ordinal)) + { + tempTermPG.Id = customProperty.Value; + } + } + } + clientTermSet.ClientTerms.Add(tempTermPG); + } + return clientTermSet; + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/UsersDetails.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/UsersDetails.cs new file mode 100644 index 00000000..9e5a1b3a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/SharePointInfo/UsersDetails.cs @@ -0,0 +1,412 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Repository +// Author : v-rijadh +// Created : 07-07-2016 +//*************************************************************************** +// History +// Modified : 07-07-2016 +// Modified By : v-lapedd +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file provide methods to get information related to user +using Microsoft.SharePoint.Client; +using System; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Extensions.Options; +using Microsoft.SharePoint.Client.UserProfiles; +using System.Globalization; +using System.IO; +using Microsoft.SharePoint.ApplicationPages.ClientPickerQuery; +using Microsoft.SharePoint.Client.Utilities; +using Microsoft.AspNetCore.Http; +#endregion + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This class contains all the methods which are related to user information + /// + public class UsersDetails : IUsersDetails + { + private MatterSettings matterSettings; + private ISPOAuthorization spoAuthorization; + private IHttpContextAccessor httpContextAccessor; + private ListNames listNames; + private ICustomLogger customLogger; + private LogTables logTables; + private GeneralSettings generalSettings; + /// + /// Constructir where all the dependencies are injected + /// + /// + public UsersDetails(IOptions matterSettings, + IOptions listNames, + ISPOAuthorization spoAuthorization, + ICustomLogger customLogger, + IOptions logTables, + IHttpContextAccessor httpContextAccessor, + IOptions generalSettings) + { + this.matterSettings = matterSettings.Value; + this.listNames = listNames.Value; + this.spoAuthorization = spoAuthorization; + //this.spList = spList; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.httpContextAccessor = httpContextAccessor; + this.generalSettings = generalSettings.Value; + } + + + /// + /// Get HttpContext object from IHttpContextAccessor to read Http Request Headers + /// + private HttpContext Context => httpContextAccessor.HttpContext; + + /// + /// This method will get user profile picture of the login user + /// + /// + /// + public Users GetUserProfilePicture(Client client) + { + ClientContext clientContext = spoAuthorization.GetClientContext(client.Url); + PeopleManager peopleManager = new PeopleManager(clientContext); + string accountName = $"i:0#.f|membership|{Context.User.Identity.Name}"; + ClientResult userProfile = peopleManager.GetUserProfilePropertyFor(accountName, "PictureURL"); + clientContext.ExecuteQuery(); + string personalURL = userProfile.Value; + + string smallProfilePicture = personalURL.Replace("MThumb.jpg", "SThumb.jpg"); + string mediumProfilePicture = personalURL; + Users users = new Users(); + + users.SmallPictureUrl = smallProfilePicture; + users.LargePictureUrl = mediumProfilePicture; + return users; + //return null; + } + + /// + /// This method will check whether user exists in a sharepoint site or not + /// + /// + /// + public bool CheckUserPresentInMatterCenter(ClientContext clientContext, string email) + { + try + { + //If the current email is part of current organization, no need to check for validity of the user email + if (email.Trim().ToLower().IndexOf(generalSettings.OrgDomainName.Trim().ToLower()) > 0) + { + return true; + } + string userAlias = email; + ClientPeoplePickerQueryParameters queryParams = new ClientPeoplePickerQueryParameters(); + queryParams.AllowMultipleEntities = false; + queryParams.MaximumEntitySuggestions = 500; + queryParams.PrincipalSource = PrincipalSource.All; + queryParams.PrincipalType = PrincipalType.User | PrincipalType.SecurityGroup; + queryParams.QueryString = userAlias; + ClientResult clientResult = ClientPeoplePickerWebServiceInterface.ClientPeoplePickerSearchUser(clientContext, queryParams); + clientContext.ExecuteQuery(); + string results = clientResult.Value; + int peoplePickerMaxRecords = 30; + IList foundUsers = Newtonsoft.Json.JsonConvert.DeserializeObject>(results).Where(result => (string.Equals(result.EntityType, ServiceConstants.PEOPLE_PICKER_ENTITY_TYPE_USER, + StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.Description)) || (!string.Equals(result.EntityType, + ServiceConstants.PEOPLE_PICKER_ENTITY_TYPE_USER, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(result.EntityData.Email))).Take(peoplePickerMaxRecords).ToList(); + return foundUsers.Count > 0; + } + catch (Exception ex) + { + throw; + } + } + + + + /// + /// This method will check whether user exists in a sharepoint site or not + /// + /// + /// + /// + public bool CheckUserPresentInMatterCenter(string clientUrl, string email) + { + try + { + //If the current email is part of current organization, no need to check for validity of the user + if(email.Trim().ToLower().IndexOf(generalSettings.OrgDomainName.Trim().ToLower()) >0) + { + return true; + } + var clientContext = spoAuthorization.GetClientContext(clientUrl); + return CheckUserPresentInMatterCenter(clientContext, email); + } + catch (Exception ex) + { + throw; + } + } + + /// + /// This method will check whether the given login user is present in a + /// sharepoint group or not + /// + /// + /// + /// + //public bool CheckUserPermissionsInGroup(Client client, string groupName) + //{ + // try + // { + // ClientContext clientContext = spoAuthorization.GetClientContext(client.Url); + // Web web = clientContext.Web; + // //Get the group name in which to check the user + // Group group = web.SiteGroups.GetByName(groupName); + // clientContext.Load(group, grp => grp.Title, grp => grp.Users); + // clientContext.ExecuteQuery(); + // //Loop through all the users in that group + // foreach (User usr in group.Users) + // { + // //If the user is found in that group, return true else return false + // if (usr.Email.ToLower().Trim() == Context.User.Identity.Name.ToLower().Trim()) + // { + // return true; + // } + // } + // return false; + // } + // catch (Exception ex) + // { + // //If the user doesn't belong to the user, the code will throw the exception and the user may not belong to the group and + // //log the message and return false from the method + // customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + // return false; + + // } + //} + + /// + /// This method will return the user object who has currently logged into the system + /// + /// + /// + public Users GetLoggedInUserDetails(ClientContext clientContext) + { + Users currentUserDetail = new Users(); + try + { + clientContext.Load(clientContext.Web.CurrentUser, userInfo => userInfo.Title, userInfo => userInfo.Email, userInfo => userInfo.LoginName); + clientContext.ExecuteQuery(); + currentUserDetail.Name = clientContext.Web.CurrentUser.Title; + currentUserDetail.Email = clientContext.Web.CurrentUser.Email; + + //Check if email is available to get account name, if not use login name + if (!String.IsNullOrEmpty(currentUserDetail.Email)) + { + currentUserDetail.LogOnName = currentUserDetail.Email; + } + else + { + currentUserDetail.LogOnName = clientContext.Web.CurrentUser.LoginName; + } + + //Retrieve user name from login + int splitPositionStart; + int splitPositionEnd = currentUserDetail.LogOnName.LastIndexOf(ServiceConstants.SYMBOL_AT, StringComparison.OrdinalIgnoreCase); + if (splitPositionEnd == -1) //The user is an on-premise account + { + splitPositionStart = currentUserDetail.LogOnName.LastIndexOf(ServiceConstants.BACKWARD_SLASH, StringComparison.OrdinalIgnoreCase) + 1; + splitPositionEnd = currentUserDetail.LogOnName.Length; + } + else + { + splitPositionStart = currentUserDetail.LogOnName.LastIndexOf(ServiceConstants.PIPE, StringComparison.OrdinalIgnoreCase) + 1; + } + currentUserDetail.LogOnName = currentUserDetail.LogOnName.Substring(splitPositionStart, splitPositionEnd - splitPositionStart); + return currentUserDetail; + } + + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// Over loaded method + /// + /// + /// + public Users GetLoggedInUserDetails(Client client) + { + try + { + ClientContext clientContext = spoAuthorization.GetClientContext(client.Url); + return GetLoggedInUserDetails(clientContext); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Function to check user full permission on document library + /// + /// + /// + /// + public bool CheckUserFullPermission(ClientContext clientContext, Matter matter) + { + bool result = false; + try + { + if (null != matter) + { + Web web = clientContext.Web; + List list = web.Lists.GetByTitle(matter.Name); + Users userDetails = GetLoggedInUserDetails(clientContext); + Principal userPrincipal = web.EnsureUser(userDetails.Name); + RoleAssignment userRole = list.RoleAssignments.GetByPrincipal(userPrincipal); + clientContext.Load(userRole, userRoleProperties => userRoleProperties.Member, + userRoleProperties => userRoleProperties.RoleDefinitionBindings.Include(userRoleDefinition => userRoleDefinition.Name).Where(userRoleDefinitionName => userRoleDefinitionName.Name == + matterSettings.EditMatterAllowedPermissionLevel)); + clientContext.ExecuteQuery(); + if (0 < userRole.RoleDefinitionBindings.Count) + { + result = true; + } + } + return result; + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + /// + /// Gets the user access. + /// + /// + /// + //public bool GetUserAccess(Client client) => spList.CheckPermissionOnList(client, listNames.SendMailListName, PermissionKind.EditListItems); + + + public IList ResolveUserNames(ClientContext clientContext, IList userNames) + { + List userList = new List(); + foreach (string userName in userNames) + { + //Check has been made to check whether the user is present in the system as part of external sharing implementation + if (!string.IsNullOrWhiteSpace(userName) && + CheckUserPresentInMatterCenter(clientContext, userName)) + { + User user = clientContext.Web.EnsureUser(userName.Trim()); + ///// Only Fetch the User ID which is required + clientContext.Load(user, u => u.Id); + clientContext.ExecuteQuery(); + ///// Add the user to the first element of the FieldUserValue array. + FieldUserValue tempUser = new FieldUserValue(); + tempUser.LookupId = user.Id; + userList.Add(tempUser); + } + } + return userList; + } + /// + /// Bulk resolves the specified users. + /// + /// Client context + /// Name of the users to be resolved + /// List of resolved users + public IList ResolveUserNames(Client client, IList userNames) + { + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + return ResolveUserNames(clientContext, userNames); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Get the principal associated to the user + /// + /// + /// Matter Information + /// The userids for which we need to return the principals + /// + public List> GetUserPrincipal(Client client, Matter matter, IList userIds) + { + List> teamMemberPrincipalCollection = new List>(); + int securityGroupRowNumber = -1; + try + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(client.Url)) + { + int teamMembersRowCount = matter.AssignUserNames.Count; + + List blockedUsers = matter.BlockUserNames.Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); + if (0 < teamMembersRowCount) + { + securityGroupRowNumber = -2; // Invalid user + for (int iterator = 0; iterator < teamMembersRowCount; iterator++) + { + List currentRowTeamMembers = matter.AssignUserNames[iterator].Where(user => !string.IsNullOrWhiteSpace(user.Trim())).ToList(); + foreach (string teamMember in currentRowTeamMembers) + { + //Check has been made to check whether the user is present in the system as part of external sharing implementation + if (CheckUserPresentInMatterCenter(clientContext, teamMember)) + { + Principal teamMemberPrincipal = clientContext.Web.EnsureUser(teamMember); + clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => + teamMemberPrincipalProperties.PrincipalType, + teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); + teamMemberPrincipalCollection.Add(new Tuple(iterator, teamMemberPrincipal)); + } + } + } + } + if (0 < blockedUsers.Count) + { + foreach (string blockedUser in blockedUsers) + { + Principal teamMemberPrincipal = clientContext.Web.EnsureUser(blockedUser); + clientContext.Load(teamMemberPrincipal, teamMemberPrincipalProperties => teamMemberPrincipalProperties.PrincipalType, teamMemberPrincipalProperties => teamMemberPrincipalProperties.Title); + teamMemberPrincipalCollection.Add(new Tuple(-1, teamMemberPrincipal)); + } + } + clientContext.ExecuteQuery(); + return teamMemberPrincipalCollection; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/ISharedRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/ISharedRepository.cs new file mode 100644 index 00000000..9139254e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/ISharedRepository.cs @@ -0,0 +1,13 @@ +using Microsoft.Legal.MatterCenter.Models; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ISharedRepository + { + Task UrlExistsAsync(Client client, string pageUrl); + Task> GetMatterHelpAsync(Client client, string selectedPage); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/SharedRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/SharedRepository.cs new file mode 100644 index 00000000..904baf26 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Shared/SharedRepository.cs @@ -0,0 +1,52 @@ +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using System.Collections.Generic; +using System.Threading.Tasks; + + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class SharedRepository:ISharedRepository + { + #region Private Variables + private ISPPage spPage; + private ListNames listNames; + private ISearch search; + #endregion + /// + /// + /// + /// + /// + /// + public SharedRepository(ISPPage spPage, IOptions listNames, ISearch search) + { + this.spPage = spPage; + this.listNames = listNames.Value; + this.search = search; + } + + /// + /// + /// + /// + /// + /// + public async Task UrlExistsAsync(Client client, string pageUrl) + { + return await Task.FromResult(spPage.UrlExists(client, pageUrl)); + } + + /// + /// + /// + /// + /// + /// + public async Task> GetMatterHelpAsync(Client client, string selectedPage) + { + return await Task.FromResult(search.GetMatterHelp(client, selectedPage, listNames.MatterCenterHelpSectionListName)); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/ITaxonomyRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/ITaxonomyRepository.cs new file mode 100644 index 00000000..2a25c56d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/ITaxonomyRepository.cs @@ -0,0 +1,11 @@ +using Microsoft.Legal.MatterCenter.Models; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public interface ITaxonomyRepository + { + Task GetTaxonomyHierarchyAsync(TermStoreViewModel termStoreViewModel); + string GetCurrentSiteName(Client client); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/TaxonomyRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/TaxonomyRepository.cs new file mode 100644 index 00000000..a204d2ef --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/Taxonomy/TaxonomyRepository.cs @@ -0,0 +1,66 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System.Threading.Tasks; +using System; +using Microsoft.Extensions.Options; +#endregion + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// This class will talk to Taxonomy class which will handle all the request and response to SPO from term store perspective + /// + public class TaxonomyRepository : ITaxonomyRepository + { + private ITaxonomy taxonomy; + private ISite site; + /// + /// All the required dependencies are injected into constructor + /// + /// + /// + /// + public TaxonomyRepository(ISPOAuthorization spoAuthorization, ITaxonomy taxonomy, ISite site) + { + this.taxonomy = taxonomy; + this.site = site; + } + + /// + /// This method will get the taxonomy hierarchy object for the given search criterai and return to the service + /// + /// + /// The request object for which the taxonomy has to be retrieved + /// Client TermSet or SPO TermSet + public async Task GetTaxonomyHierarchyAsync(TermStoreViewModel termStoreViewModel) + { + return await Task.FromResult(taxonomy.GetTaxonomyHierarchy(termStoreViewModel.Client, termStoreViewModel.TermStoreDetails)); + } + + + /// + /// This method will get the current SPO site title for the url that is there in the client object. + /// This is a test method and will be removed later + /// + /// + /// + public string GetCurrentSiteName(Client client) + { + return site.GetCurrentSite(client); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/IUserRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/IUserRepository.cs new file mode 100644 index 00000000..d35e1d30 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/IUserRepository.cs @@ -0,0 +1,66 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + /// + /// + /// + public interface IUserRepository + { + /// + /// This method will get logged in user infor object + /// + /// + /// + Users GetLoggedInUserDetails(ClientContext clientContext); + + /// + /// This method will get logged in user infor object + /// + /// + /// + Users GetLoggedInUserDetails(Client client); + + + /// + /// This method will return all users for the filter criteria that user has specified in the UI + /// + /// + /// + Task> GetUsersAsync(SearchRequestVM searchRequestVM); + + /// + /// Thios method will get all roles such as attorney journal etc which are configured in the catalog site collection + /// + /// + /// Task> + Task> GetRolesAsync(Client client); + + /// + /// This method will get all permissions levels that are configured for a given site collection + /// + /// + /// Task> + Task> GetPermissionLevelsAsync(Client client); + + /// + /// This method will get current user profile picture of the current logged in user + /// + /// + /// Users + Users GetUserProfilePicture(Client client); + + /// + /// This method will check whether user exists in a sharepoint site or not + /// + /// + /// + /// bool + bool CheckUserPresentInMatterCenter(Client client); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/UserRepository.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/UserRepository.cs new file mode 100644 index 00000000..b6aa958c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/UserRepository/UserRepository.cs @@ -0,0 +1,139 @@ +using Microsoft.Extensions.Options; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Repository +{ + public class UserRepository:IUserRepository + { + private IUsersDetails userDetails; + private ISPList spList; + private CamlQueries camlQueries; + private MatterSettings matterSettings; + private ISearch search; + private ListNames listNames; + + public UserRepository(IUsersDetails userDetails, ISPList spList, IOptions listNames, IOptions camlQueries, + IOptions matterSettings, ISearch search) + { + this.userDetails = userDetails; + this.spList = spList; + this.matterSettings = matterSettings.Value; + this.camlQueries = camlQueries.Value; + this.search = search; + this.listNames = listNames.Value; + } + + /// + /// + /// + /// + /// + public Users GetUserProfilePicture(Client client) + { + return userDetails.GetUserProfilePicture(client); + } + + /// + /// + /// + /// + /// + public Users GetLoggedInUserDetails(ClientContext clientContext)=> userDetails.GetLoggedInUserDetails(clientContext); + + /// + /// + /// + /// + /// + public Users GetLoggedInUserDetails(Client client) => userDetails.GetLoggedInUserDetails(client); + + /// + /// + /// + /// + /// + public async Task> GetUsersAsync(SearchRequestVM searchRequestVM) + { + IList foundUsers = await Task.FromResult(search.SearchUsers(searchRequestVM)); + IList users = new List(); + if (foundUsers != null && foundUsers.Count != 0) + { + foreach (PeoplePickerUser item in foundUsers) + { + Users tempUser = new Users(); + tempUser.Name = Convert.ToString(item.DisplayText, CultureInfo.InvariantCulture); + tempUser.LogOnName = Convert.ToString(item.Key, CultureInfo.InvariantCulture); + tempUser.Email = string.Equals(item.EntityType, ServiceConstants.PEOPLE_PICKER_ENTITY_TYPE_USER, StringComparison.OrdinalIgnoreCase) ? + Convert.ToString(item.Description, CultureInfo.InvariantCulture) : Convert.ToString(item.EntityData.Email, CultureInfo.InvariantCulture); + tempUser.EntityType = Convert.ToString(item.EntityType, CultureInfo.InvariantCulture); + users.Add(tempUser); + } + return users; + } + return users; + } + + /// + /// Thios method will get all roles such as attorney journal etc which are configured in the catalog site collection + /// + /// + /// async Task> + public async Task> GetRolesAsync(Client client) + { + IList roles = new List(); + ListItemCollection collListItem = await Task.FromResult(spList.GetData(client, listNames.DMSRoleListName, camlQueries.DMSRoleQuery)); + if (null != collListItem && 0 != collListItem.Count) + { + foreach (ListItem item in collListItem) + { + Role tempRole = new Role(); + tempRole.Id = Convert.ToString(item[matterSettings.ColumnNameGuid], CultureInfo.InvariantCulture); + tempRole.Name = Convert.ToString(item[matterSettings.RoleListColumnRoleName], CultureInfo.InvariantCulture); + tempRole.Mandatory = Convert.ToBoolean(item[matterSettings.RoleListColumnIsRoleMandatory], CultureInfo.InvariantCulture); + roles.Add(tempRole); + } + } + return roles; + } + + + /// + /// This method will get all permissions levels that are configured for a given site collection + /// + /// + /// + public async Task> GetPermissionLevelsAsync(Client client) + { + IList roles = new List(); + List roleDefinitions = await Task.FromResult(search.GetWebRoleDefinitions(client)); + if (roleDefinitions.Count != 0) + { + foreach (RoleDefinition role in roleDefinitions) + { + Role tempRole = new Role(); + tempRole.Name = role.Name; + tempRole.Id = Convert.ToString(role.Id, CultureInfo.InvariantCulture); + roles.Add(tempRole); + } + } + return roles; + } + + /// + /// This method will check whether user exists in a sharepoint site or not + /// + /// + /// + /// bool + public bool CheckUserPresentInMatterCenter(Client client) + { + return userDetails.CheckUserPresentInMatterCenter(client.Url, client.Name); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.IncrementalCache b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.IncrementalCache new file mode 100644 index 00000000..bcc8aecc --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.IncrementalCache @@ -0,0 +1 @@ +{"inputs":["C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\project.json","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\project.lock.json","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\ICommonRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Document\\DocumentRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Document\\IDocumentRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Matter\\IMatterRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Matter\\MatterRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Properties\\AssemblyInfo.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Shared\\ISharedRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Shared\\SharedRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\ExternalSharing.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Search.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Site.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\SPContentTypes.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\SPList.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\SPPage.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Taxonomy.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\UsersDetails.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Extensions\\TaxonomyExtensions.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\IExternalSharing.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ISearch.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ISite.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ISPContentTypes.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ISPList.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ISPPage.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\ITaxonomy.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\SharePointInfo\\Interfaces\\IUsersDetails.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Taxonomy\\ITaxonomyRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\Taxonomy\\TaxonomyRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\UserRepository\\IUserRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\UserRepository\\UserRepository.cs","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Models\\bin\\Debug\\net451\\Microsoft.Legal.MatterCenter.Models.dll","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Utility\\bin\\Debug\\net451\\Microsoft.Legal.MatterCenter.Utility.dll"],"outputs":["C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\bin\\Debug\\net451\\Microsoft.Legal.MatterCenter.Repository.dll","C:\\projects\\mc2\\tree\\master\\cloud\\src\\solution\\Microsoft.Legal.MatterCenter.Service\\Microsoft.Legal.MatterCenter.Repository\\bin\\Debug\\net451\\Microsoft.Legal.MatterCenter.Repository.pdb"]} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.SDKVersion b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.SDKVersion new file mode 100644 index 00000000..fdf0129b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/.SDKVersion @@ -0,0 +1,4 @@ +6cde21225e18fc48eeab3f4345ece3e6bb122e53 +1.0.0-preview1-002702 + +win10-x64 \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile-csc.rsp b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile-csc.rsp new file mode 100644 index 00000000..2dd53bf4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile-csc.rsp @@ -0,0 +1,179 @@ +-d:DEBUG +-d:TRACE +-d:NET451 +-nowarn:CS1701 +-nowarn:CS1702 +-nowarn:CS1705 +-t:library +-debug:full +-nostdlib +-nologo +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\obj\Debug\net451\dotnet-compile.assemblyinfo.cs" +-out:"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\bin\Debug\net451\Microsoft.Legal.MatterCenter.Repository.dll" +-r:"C:\Users\Premchand\.nuget\packages\MailKit\1.3.0-beta7\lib\net451\MailKit.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Antiforgery\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Antiforgery.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Authorization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Authorization.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Cors\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Cors.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Cryptography.Internal\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Cryptography.Internal.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.DataProtection\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.DataProtection.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.DataProtection.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.DataProtection.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Diagnostics.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.AspNetCore.Diagnostics.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Hosting.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Hosting.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Hosting.Server.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Html.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.AspNetCore.Html.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Extensions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Extensions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Features\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Features.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.JsonPatch\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.AspNetCore.JsonPatch.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Localization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Localization.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.ApiExplorer\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.ApiExplorer.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Core\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Core.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Cors\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Cors.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.DataAnnotations\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.DataAnnotations.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Formatters.Json\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Formatters.Json.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Localization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Localization.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Razor\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Razor.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Razor.Host\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Razor.Host.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.TagHelpers\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.TagHelpers.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.ViewFeatures\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.ViewFeatures.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Razor\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Razor.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Razor.Runtime\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Razor.Runtime.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Routing\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Routing.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Routing.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Routing.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.WebUtilities\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.WebUtilities.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Azure.KeyVault.Core\1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.CodeAnalysis.Common\1.3.0-beta1-20160429-01\lib\net45\Microsoft.CodeAnalysis.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.CodeAnalysis.CSharp\1.3.0-beta1-20160429-01\lib\net45\Microsoft.CodeAnalysis.CSharp.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Microsoft.CSharp.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Data.Edm\5.6.4\lib\net40\Microsoft.Data.Edm.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Data.OData\5.6.4\lib\net40\Microsoft.Data.OData.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Data.Services.Client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.DotNet.InternalAbstractions\1.0.0-rc2-002702\lib\net451\Microsoft.DotNet.InternalAbstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Caching.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Caching.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Caching.Memory\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.Caching.Memory.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Configuration.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Configuration.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration.Binder\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Configuration.Binder.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyInjection\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyInjection.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyModel\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.DependencyModel.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.FileProviders.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Composite\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.FileProviders.Composite.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Physical\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.FileProviders.Physical.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileSystemGlobbing\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.FileSystemGlobbing.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Globalization.CultureInfoCache\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Globalization.CultureInfoCache.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Localization\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.Localization.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Localization.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Localization.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Logging.Abstractions\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.ObjectPool\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.ObjectPool.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Options\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Options.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Options.ConfigurationExtensions\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.PlatformAbstractions\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.PlatformAbstractions.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Primitives\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.WebEncoders\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.WebEncoders.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.IdentityModel.Clients.ActiveDirectory\3.9.302261508-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.IdentityModel.Clients.ActiveDirectory\3.9.302261508-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.Net.Http.Headers\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Net.Http.Headers.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.Client.Policy.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.Client.TranslationServices.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.SharePoint.Tools.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.ProjectServer.Client.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Publishing.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.Windows.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Search.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll" +-r:"C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.dll" +-r:"C:\Users\Premchand\.nuget\packages\MimeKit\1.3.0-beta7\lib\net451\BouncyCastle.dll" +-r:"C:\Users\Premchand\.nuget\packages\MimeKit\1.3.0-beta7\lib\net451\MimeKit.dll" +-r:"C:\Users\Premchand\.nuget\packages\Newtonsoft.Json\8.0.3\lib\net45\Newtonsoft.Json.dll" +-r:"C:\Users\Premchand\.nuget\packages\StackExchange.Redis\1.1.604-alpha\lib\net45\StackExchange.Redis.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Buffers\4.0.0-rc2-24027\lib\netstandard1.1\System.Buffers.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Collections.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Collections.Concurrent.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Collections.Immutable\1.1.37\lib\dotnet\System.Collections.Immutable.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.ComponentModel.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.ComponentModel.Primitives\4.0.1-rc2-24027\ref\net45\System.ComponentModel.Primitives.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.ComponentModel.TypeConverter\4.0.1-rc2-24027\ref\net45\System.ComponentModel.TypeConverter.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Contracts.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Debug.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Diagnostics.DiagnosticSource\4.0.0-rc2-24027\lib\portable-net45+win8+wpa81\System.Diagnostics.DiagnosticSource.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Tools.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Tracing.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Globalization.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.IO.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.IO.Compression.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Linq.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Linq.Expressions.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Net.Http.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Net.Primitives.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.ObjectModel.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.Extensions.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Reflection.Metadata\1.2.0\lib\portable-net45+win8\System.Reflection.Metadata.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.Primitives.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Resources.ResourceManager.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Extensions.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.InteropServices.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Runtime.InteropServices.RuntimeInformation\4.0.0-rc2-24027\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Numerics.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Serialization.Primitives.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Spatial\5.6.4\lib\net40\System.Spatial.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.Encoding.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.Encoding.Extensions.dll" +-r:"C:\Users\Premchand\.nuget\packages\System.Text.Encodings.Web\4.0.0-rc2-24027\lib\netstandard1.0\System.Text.Encodings.Web.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.RegularExpressions.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.Tasks.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.Timer.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Xml.ReaderWriter.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Xml.XDocument.dll" +-r:"C:\Users\Premchand\.nuget\packages\WindowsAzure.Storage\7.0.1-preview\lib\net40\Microsoft.WindowsAzure.Storage.dll" +-r:"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Models\bin\Debug\net451\Microsoft.Legal.MatterCenter.Models.dll" +-r:"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Utility\bin\Debug\net451\Microsoft.Legal.MatterCenter.Utility.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Core.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Data.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Security.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Xml.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Xml.Linq.dll" +-r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.ComponentModel.DataAnnotations.dll" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\ICommonRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Document\DocumentRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Document\IDocumentRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Matter\IMatterRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Matter\MatterRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Properties\AssemblyInfo.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Shared\ISharedRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Shared\SharedRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\ExternalSharing.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Search.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Site.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPContentTypes.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPList.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPPage.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Taxonomy.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\UsersDetails.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Extensions\TaxonomyExtensions.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\IExternalSharing.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISearch.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISite.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPContentTypes.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPList.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPPage.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ITaxonomy.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\IUsersDetails.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Taxonomy\ITaxonomyRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Taxonomy\TaxonomyRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\UserRepository\IUserRepository.cs" +"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\UserRepository\UserRepository.cs" diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.assemblyinfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.assemblyinfo.cs new file mode 100644 index 00000000..c2688e15 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.assemblyinfo.cs @@ -0,0 +1,5 @@ +// This file has been auto generated. +[assembly:System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly:System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly:System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.1")] \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.rsp b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.rsp new file mode 100644 index 00000000..d6e4a0e2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/obj/Debug/net451/dotnet-compile.rsp @@ -0,0 +1,182 @@ +--temp-output:C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\obj\Debug\net451\ +--out:C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\bin\Debug\net451\Microsoft.Legal.MatterCenter.Repository.dll +--define:DEBUG +--define:TRACE +--define:NET451 +--suppress-warning:CS1701 +--suppress-warning:CS1702 +--suppress-warning:CS1705 +--optimize:False +--output-name:Microsoft.Legal.MatterCenter.Repository +--description:Microsoft.Legal.MatterCenter.Repository Class Library +--file-version:1.0.0.0 +--version:1.0.0.0 +--informational-version:1.0.0 +--target-framework:.NETFramework,Version=v4.5.1 +--reference:C:\Users\Premchand\.nuget\packages\MailKit\1.3.0-beta7\lib\net451\MailKit.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Antiforgery\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Antiforgery.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Authorization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Authorization.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Cors\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Cors.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Cryptography.Internal\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Cryptography.Internal.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.DataProtection\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.DataProtection.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.DataProtection.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.DataProtection.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Diagnostics.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.AspNetCore.Diagnostics.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Hosting.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Hosting.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Hosting.Server.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Html.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.AspNetCore.Html.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Extensions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Extensions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Http.Features\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Http.Features.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.JsonPatch\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.AspNetCore.JsonPatch.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Localization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Localization.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.ApiExplorer\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.ApiExplorer.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Core\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Core.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Cors\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Cors.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.DataAnnotations\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.DataAnnotations.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Formatters.Json\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Formatters.Json.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Localization\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Localization.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Razor\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Razor.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.Razor.Host\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.Razor.Host.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.TagHelpers\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.TagHelpers.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Mvc.ViewFeatures\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Mvc.ViewFeatures.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Razor\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Razor.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Razor.Runtime\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Razor.Runtime.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Routing\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Routing.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.Routing.Abstractions\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.Routing.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.AspNetCore.WebUtilities\1.0.0-rc2-final\lib\net451\Microsoft.AspNetCore.WebUtilities.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Azure.KeyVault.Core\1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.CodeAnalysis.Common\1.3.0-beta1-20160429-01\lib\net45\Microsoft.CodeAnalysis.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.CodeAnalysis.CSharp\1.3.0-beta1-20160429-01\lib\net45\Microsoft.CodeAnalysis.CSharp.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Microsoft.CSharp.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Data.Edm\5.6.4\lib\net40\Microsoft.Data.Edm.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Data.OData\5.6.4\lib\net40\Microsoft.Data.OData.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Data.Services.Client\5.6.4\lib\net40\Microsoft.Data.Services.Client.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.DotNet.InternalAbstractions\1.0.0-rc2-002702\lib\net451\Microsoft.DotNet.InternalAbstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Caching.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Caching.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Caching.Memory\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.Caching.Memory.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Configuration.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Configuration.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Configuration.Binder\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Configuration.Binder.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyInjection\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyInjection.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.DependencyModel\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.DependencyModel.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.FileProviders.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Composite\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.FileProviders.Composite.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileProviders.Physical\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.FileProviders.Physical.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.FileSystemGlobbing\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.FileSystemGlobbing.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Globalization.CultureInfoCache\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Globalization.CultureInfoCache.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Localization\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.Localization.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Localization.Abstractions\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Localization.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Logging.Abstractions\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.ObjectPool\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.ObjectPool.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Options\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Options.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Options.ConfigurationExtensions\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Extensions.Options.ConfigurationExtensions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.PlatformAbstractions\1.0.0-rc2-final\lib\net451\Microsoft.Extensions.PlatformAbstractions.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.Primitives\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Extensions.WebEncoders\1.0.0-rc2-final\lib\netstandard1.0\Microsoft.Extensions.WebEncoders.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.IdentityModel.Clients.ActiveDirectory\3.9.302261508-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.IdentityModel.Clients.ActiveDirectory\3.9.302261508-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.Net.Http.Headers\1.0.0-rc2-final\lib\netstandard1.1\Microsoft.Net.Http.Headers.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.Client.Policy.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.Client.TranslationServices.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Office.SharePoint.Tools.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.ProjectServer.Client.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Publishing.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.Windows.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Search.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll +--reference:C:\Users\Premchand\.nuget\packages\Microsoft.SharePointOnline.CSOM\16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.dll +--reference:C:\Users\Premchand\.nuget\packages\MimeKit\1.3.0-beta7\lib\net451\BouncyCastle.dll +--reference:C:\Users\Premchand\.nuget\packages\MimeKit\1.3.0-beta7\lib\net451\MimeKit.dll +--reference:C:\Users\Premchand\.nuget\packages\Newtonsoft.Json\8.0.3\lib\net45\Newtonsoft.Json.dll +--reference:C:\Users\Premchand\.nuget\packages\StackExchange.Redis\1.1.604-alpha\lib\net45\StackExchange.Redis.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Buffers\4.0.0-rc2-24027\lib\netstandard1.1\System.Buffers.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Collections.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Collections.Concurrent.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Collections.Immutable\1.1.37\lib\dotnet\System.Collections.Immutable.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.ComponentModel.dll +--reference:C:\Users\Premchand\.nuget\packages\System.ComponentModel.Primitives\4.0.1-rc2-24027\ref\net45\System.ComponentModel.Primitives.dll +--reference:C:\Users\Premchand\.nuget\packages\System.ComponentModel.TypeConverter\4.0.1-rc2-24027\ref\net45\System.ComponentModel.TypeConverter.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Contracts.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Debug.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Diagnostics.DiagnosticSource\4.0.0-rc2-24027\lib\portable-net45+win8+wpa81\System.Diagnostics.DiagnosticSource.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Tools.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Diagnostics.Tracing.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Globalization.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.IO.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.IO.Compression.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Linq.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Linq.Expressions.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Net.Http.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Net.Primitives.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.ObjectModel.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.Extensions.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Reflection.Metadata\1.2.0\lib\portable-net45+win8\System.Reflection.Metadata.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Reflection.Primitives.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Resources.ResourceManager.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Extensions.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.InteropServices.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Runtime.InteropServices.RuntimeInformation\4.0.0-rc2-24027\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Numerics.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Runtime.Serialization.Primitives.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Spatial\5.6.4\lib\net40\System.Spatial.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.Encoding.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.Encoding.Extensions.dll +--reference:C:\Users\Premchand\.nuget\packages\System.Text.Encodings.Web\4.0.0-rc2-24027\lib\netstandard1.0\System.Text.Encodings.Web.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Text.RegularExpressions.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.Tasks.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Threading.Timer.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Xml.ReaderWriter.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\System.Xml.XDocument.dll +--reference:C:\Users\Premchand\.nuget\packages\WindowsAzure.Storage\7.0.1-preview\lib\net40\Microsoft.WindowsAzure.Storage.dll +--reference:C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Models\bin\Debug\net451\Microsoft.Legal.MatterCenter.Models.dll +--reference:C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Utility\bin\Debug\net451\Microsoft.Legal.MatterCenter.Utility.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Core.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Data.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Security.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Xml.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Xml.Linq.dll +--reference:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.ComponentModel.DataAnnotations.dll +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\ICommonRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Document\DocumentRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Document\IDocumentRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Matter\IMatterRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Matter\MatterRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Properties\AssemblyInfo.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Shared\ISharedRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Shared\SharedRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\ExternalSharing.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Search.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Site.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPContentTypes.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPList.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\SPPage.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Taxonomy.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\UsersDetails.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Extensions\TaxonomyExtensions.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\IExternalSharing.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISearch.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISite.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPContentTypes.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPList.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ISPPage.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\ITaxonomy.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\SharePointInfo\Interfaces\IUsersDetails.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Taxonomy\ITaxonomyRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\Taxonomy\TaxonomyRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\UserRepository\IUserRepository.cs +C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Service\Microsoft.Legal.MatterCenter.Repository\UserRepository\UserRepository.cs diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/project.json new file mode 100644 index 00000000..30fbe9b9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Repository/project.json @@ -0,0 +1,18 @@ +{ + "version": "1.0.0-*", + "description": "Microsoft.Legal.MatterCenter.Repository Class Library", + "authors": [ "v-lapedd" ], + + "dependencies": { + "Microsoft.Extensions.Options": "1.0.0", + "System.Threading.Tasks": "4.0.10", + "System.Xml.XDocument": "4.0.10", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Newtonsoft.Json": "9.0.1", + "Microsoft.Legal.MatterCenter.Utility": "1.0.0-*", + "Microsoft.Legal.MatterCenter.Models": "1.0.0-*" + }, + "frameworks": { + "net46": {} + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/EditFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/EditFunctions.cs new file mode 100644 index 00000000..7a1427b8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/EditFunctions.cs @@ -0,0 +1,90 @@ +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Microsoft.SharePoint.Client.Utilities; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; + +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public class EditFunctions : IEditFunctions + { + private MatterSettings matterSettings; + private ErrorSettings errorSettings; + private ListNames listNames; + private CamlQueries camlQueries; + private ISPList spList; + private IMatterRepository matterRespository; + public EditFunctions(ISPList spList, IOptions matterSettings, + IOptions errorSettings, IMatterRepository matterRespository, + IOptions listNames, IOptions camlQueries) + { + this.matterSettings = matterSettings.Value; + this.spList = spList; + this.errorSettings = errorSettings.Value; + this.matterRespository = matterRespository; + this.listNames = listNames.Value; + this.camlQueries = camlQueries.Value; + } + + public GenericResponseVM CheckSecurityGroupInTeamMembers(Client client, Matter matter, IList userId) + { + try + { + GenericResponseVM genericResponse = null; + int securityGroupRowNumber = -1; // Blocked user field has security group + List> teamMemberPrincipalCollection = new List>(); + if (null != matter && null != matter.AssignUserNames && null != matter.BlockUserNames) + { + teamMemberPrincipalCollection = matterRespository.CheckUserSecurity(client, matter, userId); + foreach (Tuple teamMemberPrincipal in teamMemberPrincipalCollection) + { + Principal currentTeamMemberPrincipal = teamMemberPrincipal.Item2; + if (currentTeamMemberPrincipal.PrincipalType == PrincipalType.SecurityGroup) + { + securityGroupRowNumber = teamMemberPrincipal.Item1; + return ServiceUtility.GenericResponse(errorSettings.ErrorCodeSecurityGroupExists, + errorSettings.ErrorMessageSecurityGroupExists + ServiceConstants.DOLLAR + userId[securityGroupRowNumber]); + } + } + } + else + { + return ServiceUtility.GenericResponse(errorSettings.IncorrectTeamMembersCode, + errorSettings.IncorrectTeamMembersMessage); + } + return genericResponse; + } + catch (Exception) + { + throw; + } + } + + /// + /// Validates if there is at-least one user with full control in assign list. + /// + /// Matter object + /// Status of Full Control permission + public bool ValidateFullControlPermission(Matter matter) + { + + bool hasFullConrol = false; + if (null != matter && null != matter.Permissions && 0 != matter.Permissions.Count) + { + hasFullConrol = matter.Permissions.Contains(matterSettings.EditMatterAllowedPermissionLevel); + } + return hasFullConrol; + } + + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IEditFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IEditFunctions.cs new file mode 100644 index 00000000..d36a120a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IEditFunctions.cs @@ -0,0 +1,15 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public interface IEditFunctions + { + GenericResponseVM CheckSecurityGroupInTeamMembers(Client client, Matter matter, IList userId); + bool ValidateFullControlPermission(Matter matter); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterCenterServiceFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterCenterServiceFunctions.cs new file mode 100644 index 00000000..a208de3d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterCenterServiceFunctions.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNet.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public interface IMatterCenterServiceFunctions + { + ObjectResult ServiceResponse(object value, int statusCode); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterProvision.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterProvision.cs new file mode 100644 index 00000000..52f1a6a6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IMatterProvision.cs @@ -0,0 +1,16 @@ +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public interface IMatterProvision + { + GenericResponseVM UpdateMatter(MatterInformationVM matterInformation); + GenericResponseVM UpdateMatterMetadata(MatterMetdataVM matterMetadata); + GenericResponseVM CreateMatter(); + GenericResponseVM DeleteMatter(Client client, Matter matter); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IValidationFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IValidationFunctions.cs new file mode 100644 index 00000000..89c76b76 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/IValidationFunctions.cs @@ -0,0 +1,13 @@ +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter +{ + public interface IValidationFunctions + { + GenericResponseVM IsMatterValid(MatterInformationVM matterInformation, int methodNumber, MatterConfigurations matterConfigurations); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterCenterServiceFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterCenterServiceFunctions.cs new file mode 100644 index 00000000..bb2b3531 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterCenterServiceFunctions.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNet.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public class MatterCenterServiceFunctions: IMatterCenterServiceFunctions + { + public ObjectResult ServiceResponse(object value, int statusCode) + { + return new ObjectResult(value) + { + StatusCode = statusCode + }; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterProvision.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterProvision.cs new file mode 100644 index 00000000..fccb2853 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/MatterProvision.cs @@ -0,0 +1,516 @@ +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public class MatterProvision:IMatterProvision + { + private MatterSettings matterSettings; + private IMatterRepository matterRepositoy; + private ISPOAuthorization spoAuthorization; + private IEditFunctions editFunctions; + private ErrorSettings errorSettings; + private ICustomLogger customLogger; + private LogTables logTables; + private MailSettings mailSettings; + private ValidationFunctions validationFunctions; + public MatterProvision(IMatterRepository matterRepositoy, IOptions matterSettings, IOptions errorSettings, + ISPOAuthorization spoAuthorization, IEditFunctions editFunctions, ValidationFunctions validationFunctions, + ICustomLogger customLogger, IOptions logTables, IOptions mailSettings) + { + this.matterRepositoy = matterRepositoy; + this.matterSettings = matterSettings.Value; + this.spoAuthorization = spoAuthorization; + this.editFunctions = editFunctions; + this.errorSettings = errorSettings.Value; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.validationFunctions = validationFunctions; + this.mailSettings = mailSettings.Value; + } + + + public GenericResponseVM UpdateMatter(MatterInformationVM matterInformation) + { + var matter = matterInformation.Matter; + var matterDetails = matterInformation.MatterDetails; + var client = matterInformation.Client; + int listItemId = -1; + string loggedInUserName = ""; + bool isEditMode = matterInformation.EditMode; + ClientContext clientContext = null; + IEnumerable userPermissionOnLibrary = null; + GenericResponseVM genericResponse = null; + try + { + clientContext = spoAuthorization.GetClientContext(matterInformation.Client.Url); + PropertyValues matterStampedProperties = matterRepositoy.GetStampedProperties(clientContext, matter.Name); + loggedInUserName = matterRepositoy.GetLoggedInUserDetails(clientContext).Name; + bool isFullControlPresent = editFunctions.ValidateFullControlPermission(matter); + + if (!isFullControlPresent) + { + return ServiceUtility.GenericResponse(errorSettings.IncorrectInputSelfPermissionRemoval, errorSettings.ErrorEditMatterMandatoryPermission); + } + + // Get matter library current permissions + userPermissionOnLibrary = matterRepositoy.FetchUserPermissionForLibrary(clientContext, matter.Name); + string originalMatterName = matterRepositoy.GetMatterName(clientContext, matter.Name); + listItemId = matterRepositoy.RetrieveItemId(clientContext, matterSettings.MatterLandingPageRepositoryName, originalMatterName); + List usersToRemove = RetrieveMatterUsers(userPermissionOnLibrary); + bool hasFullPermission = CheckFullPermissionInAssignList(matter.AssignUserNames, matter.Permissions, loggedInUserName); + List listExists = matterRepositoy.MatterAssociatedLists(clientContext, matter.Name); + matterRepositoy.AssignRemoveFullControl(clientContext, matter, loggedInUserName, listItemId, listExists, true, hasFullPermission); + bool result = false; + if (listExists.Contains(matter.Name)) + { + result = matterRepositoy.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.OneNoteLibrarySuffix)) + { + result = matterRepositoy.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.OneNoteLibrarySuffix, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.CalendarNameSuffix)) + { + result = matterRepositoy.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.CalendarNameSuffix, -1, isEditMode); + } + if (listExists.Contains(matter.Name + matterSettings.TaskNameSuffix)) + { + result = matterRepositoy.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, false, matter.Name + matterSettings.TaskNameSuffix, -1, isEditMode); + } + if (0 <= listItemId) + { + result = matterRepositoy.UpdatePermission(clientContext, matter, usersToRemove, loggedInUserName, true, matterSettings.MatterLandingPageRepositoryName, listItemId, isEditMode); + } + // Update matter metadata + result = matterRepositoy.UpdateMatterStampedProperties(clientContext, matterDetails, matter, matterStampedProperties, isEditMode); + if(result) + { + return genericResponse; + } + } + catch(Exception ex) + { + MatterRevertList matterRevertListObject = new MatterRevertList() + { + MatterLibrary = matter.Name, + MatterOneNoteLibrary = matter.Name + matterSettings.OneNoteLibrarySuffix, + MatterCalendar = matter.Name + matterSettings.CalendarNameSuffix, + MatterTask = matter.Name + matterSettings.TaskNameSuffix, + MatterSitePages = matterSettings.MatterLandingPageRepositoryName + }; + matterRepositoy.RevertMatterUpdates(client, matter, clientContext, matterRevertListObject, loggedInUserName, + userPermissionOnLibrary, listItemId, isEditMode); + } + return ServiceUtility.GenericResponse("9999999", "Error in updating matter information"); + } + + + public GenericResponseVM CreateMatter() + { + return null; + } + + public GenericResponseVM UpdateMatterMetadata(MatterMetdataVM matterMetadata) + { + var matter = matterMetadata.Matter; + var matterDetails = matterMetadata.MatterDetails; + var client = matterMetadata.Client; + ClientContext clientContext = null; + GenericResponseVM returnFlag = null; + try + { + clientContext = spoAuthorization.GetClientContext(matterMetadata.Client.Url); + PropertyValues matterStampedProperties = matterRepositoy.GetStampedProperties(clientContext, matter.Name); + Dictionary propertyList = SetStampProperty(client, matter, matterDetails); + matterRepositoy.SetPropertBagValuesForList(clientContext, matterStampedProperties, matter.Name, propertyList); + if (matterMetadata.MatterProvisionFlags.SendEmailFlag) + { + returnFlag = ShareMatter(matterMetadata, matterMetadata.MatterProvisionFlags.MatterLandingFlag); + } + else + { + ServiceUtility.GenericResponse("", "Matter Update Success"); + } + } + catch(Exception ex) + { + DeleteMatter(client, matter); + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return returnFlag; + } + + public GenericResponseVM DeleteMatter(Client client, Matter matter) + { + GenericResponseVM genericResponse = matterRepositoy.DeleteMatter(client, matter); + return genericResponse; + } + + #region private functions + + /// + /// Creates an item in the specific list with the list of users to whom the matter will be shared. + /// + /// Request Object containing SharePoint App Token + /// Client object containing Client data + /// Matter object containing Matter data + /// true if success else false + /// /// + internal GenericResponseVM ShareMatter(MatterMetdataVM matterMetadata, string matterLandingFlag) + { + GenericResponseVM returnFlag = null; + var matter = matterMetadata.Matter; + var matterDetails = matterMetadata.MatterDetails; + var client = matterMetadata.Client; + var matterConfigurations = matterMetadata.MatterConfigurations; + if (null != client && null != matter && null != matterDetails) + { + try + { + Uri mailListURL = new Uri(string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}", matterSettings.ProvisionMatterAppURL, + ServiceConstants.FORWARD_SLASH, ServiceConstants.LISTS, ServiceConstants.FORWARD_SLASH, matterSettings.SendMailListName)); + string centralMailListURL = Convert.ToString(mailListURL, CultureInfo.InvariantCulture); + string mailSiteURL = centralMailListURL.Substring(0, centralMailListURL.LastIndexOf(string.Concat(ServiceConstants.FORWARD_SLASH, + ServiceConstants.LISTS, ServiceConstants.FORWARD_SLASH), StringComparison.OrdinalIgnoreCase)); + ///// Retrieve the specific site where the Mail List is present along with the required List Name + if (null != mailListURL && null != client.Url) + { + if (!string.IsNullOrWhiteSpace(mailSiteURL)) + { + returnFlag = ShareMatterUtility(client, matter, matterDetails, + mailSiteURL, centralMailListURL, matterLandingFlag, matterConfigurations); + } + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + return returnFlag; + } + + /// + /// Function to share the matter. + /// + /// Request Object containing SharePoint App Token + /// Client object containing Client data + /// Matter object containing Matter data + /// String contains all sub area of law + /// URL contains list of mail recipients + /// Result of operation: Matter Shared successfully or not + internal GenericResponseVM ShareMatterUtility(Client client, Matter matter, MatterDetails matterDetails, string mailSiteURL, string centralMailListURL, string matterLandingFlag, MatterConfigurations matterConfigurations) + { + bool shareFlag = false; + string mailListName = centralMailListURL.Substring(centralMailListURL.LastIndexOf(ServiceConstants.FORWARD_SLASH, StringComparison.OrdinalIgnoreCase) + 1); + string matterLocation = string.Concat(client.Url, ServiceConstants.FORWARD_SLASH, matter.Name); + string ProvisionMatterValidation = string.Empty; + GenericResponseVM genericResponse = null; + if (!string.IsNullOrWhiteSpace(mailSiteURL)) + { + using (ClientContext clientContext = spoAuthorization.GetClientContext(mailSiteURL)) + { + + genericResponse = validationFunctions.MatterDetailsValidation(matter, client, + int.Parse(ServiceConstants.ProvisionMatterShareMatter, CultureInfo.InvariantCulture), matterConfigurations); + if(genericResponse!=null) + { + return genericResponse; + } + + // Get the current logged in User + clientContext.Load(clientContext.Web.CurrentUser); + clientContext.ExecuteQuery(); + string matterMailBody, blockUserNames; + // Generate Mail Subject + string matterMailSubject = string.Format(CultureInfo.InvariantCulture, mailSettings.MatterMailSubject, + matter.Id, matter.Name, clientContext.Web.CurrentUser.Title); + + // Logic to Create Mail body + // Step 1: Create Matter Information + // Step 2: Create Team Information + // Step 3: Create Access Information + // Step 4: Create Conflict check Information based on the conflict check flag and create mail body + + // Step 1: Create Matter Information + string defaultContentType = string.Format(CultureInfo.InvariantCulture, + mailSettings.MatterMailDefaultContentTypeHtmlChunk, matter.DefaultContentType); + string matterType = string.Join(";", matter.ContentTypes.ToArray()).TrimEnd(';').Replace(matter.DefaultContentType, defaultContentType); + + // Step 2: Create Team Information + string secureMatter = ServiceConstants.FALSE.ToUpperInvariant() == matter.Conflict.SecureMatter.ToUpperInvariant() ? + ServiceConstants.NO : ServiceConstants.YES; + string mailBodyTeamInformation = string.Empty; + mailBodyTeamInformation = TeamMembersPermissionInformation(matterDetails, mailBodyTeamInformation); + + // Step 3: Create Access Information + if (ServiceConstants.TRUE == matterLandingFlag) + { + matterLocation = string.Concat(client.Url, ServiceConstants.FORWARD_SLASH, + matterSettings.MatterLandingPageRepositoryName.Replace(ServiceConstants.SPACE, string.Empty), + ServiceConstants.FORWARD_SLASH, matter.MatterGuid, ServiceConstants.ASPX_EXTENSION); + } + string oneNotePath = string.Concat(client.Url, ServiceConstants.FORWARD_SLASH, + matter.MatterGuid, matterSettings.OneNoteLibrarySuffix, + ServiceConstants.FORWARD_SLASH, matter.MatterGuid, ServiceConstants.FORWARD_SLASH, matter.MatterGuid); + + // Step 4: Create Conflict check Information based on the conflict check flag and create mail body + if (matterConfigurations.IsConflictCheck) + { + string conflictIdentified = ServiceConstants.FALSE.ToUpperInvariant() == matter.Conflict.Identified.ToUpperInvariant() ? + ServiceConstants.NO : ServiceConstants.YES; + blockUserNames = string.Join(";", matter.BlockUserNames.ToArray()).Trim().TrimEnd(';'); + + blockUserNames = !String.IsNullOrEmpty(blockUserNames) ? string.Format(CultureInfo.InvariantCulture, + "
{0}: {1}
", "Conflicted User", blockUserNames) : string.Empty; + matterMailBody = string.Format(CultureInfo.InvariantCulture, + mailSettings.MatterMailBodyMatterInformation, client.Name, client.Id, + matter.Name, matter.Id, matter.Description, matterType) + string.Format(CultureInfo.InvariantCulture, + mailSettings.MatterMailBodyConflictCheck, ServiceConstants.YES, matter.Conflict.CheckBy, + Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture).ToString(matterSettings.MatterCenterDateFormat, CultureInfo.InvariantCulture), + conflictIdentified) + string.Format(CultureInfo.InvariantCulture, + mailSettings.MatterMailBodyTeamMembers, secureMatter, mailBodyTeamInformation, + blockUserNames, client.Url, oneNotePath, matter.Name, matterLocation, matter.Name); + } + else + { + blockUserNames = string.Empty; + matterMailBody = string.Format(CultureInfo.InvariantCulture, mailSettings.MatterMailBodyMatterInformation, + client.Name, client.Id, matter.Name, matter.Id, + matter.Description, matterType) + string.Format(CultureInfo.InvariantCulture, mailSettings.MatterMailBodyTeamMembers, secureMatter, + mailBodyTeamInformation, blockUserNames, client.Url, oneNotePath, matter.Name, matterLocation, matter.Name); + } + + Web web = clientContext.Web; + List mailList = web.Lists.GetByTitle(mailListName); + List userList = new List(); + List userEmailList = GenerateMailList(matter, new Client {Url = mailSiteURL }, ref userList); + ///// Add the Matter URL in list + FieldUrlValue matterPath = new FieldUrlValue() + { + Url = string.Concat(client.Url.Replace(String.Concat(ServiceConstants.HTTPS, ServiceConstants.COLON, + ServiceConstants.FORWARD_SLASH, ServiceConstants.FORWARD_SLASH), String.Concat(ServiceConstants.HTTP, ServiceConstants.COLON, + ServiceConstants.FORWARD_SLASH, ServiceConstants.FORWARD_SLASH)), ServiceConstants.FORWARD_SLASH, matter.Name, + ServiceConstants.FORWARD_SLASH, matter.Name), + Description = matter.Name + }; + List columnNames = new List() { matterSettings.ShareListColumnMatterPath, matterSettings.ShareListColumnMailList, + mailSettings.ShareListColumnMailBody, mailSettings.ShareListColumnMailSubject }; + List columnValues = new List() { matterPath, userEmailList, matterMailBody, matterMailSubject }; + // To avoid the invalid symbol error while parsing the JSON, return the response in lower case + matterRepositoy.AddItem(clientContext, mailList, columnNames, columnValues); + + } + } + return genericResponse; + } + + + /// + /// Generates list of users for sending email. + /// + /// Matter details + /// SharePoint client context + /// List of users associated with the matter + /// List of users to whom mail is to be sent + internal List GenerateMailList(Matter matter, Client client, ref List userList) + { + List result = null; + try + { + List userEmailList = new List(); + if (null != matter.AssignUserNames) + { + foreach (IList userNames in matter.AssignUserNames) + { + userList = matterRepositoy.ResolveUserNames(client, userNames).ToList(); + foreach (FieldUserValue userEmail in userList) + { + userEmailList.Add(userEmail); + } + } + } + result = userEmailList; + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + return result; + } + + /// + /// Provides the team members and their respective permission details. + /// + /// Matter Details object + /// Team members permission information + /// Team members permission information + private static string TeamMembersPermissionInformation(MatterDetails matterDetails, string mailBodyTeamInformation) + { + if (null != matterDetails && !string.IsNullOrWhiteSpace(matterDetails.RoleInformation)) + { + Dictionary roleInformation = JsonConvert.DeserializeObject>(matterDetails.RoleInformation); + + foreach (KeyValuePair entry in roleInformation) + { + mailBodyTeamInformation = string.Format(CultureInfo.InvariantCulture, ServiceConstants.RoleInfoHtmlChunk, entry.Key, entry.Value) + + mailBodyTeamInformation; + } + } + return mailBodyTeamInformation; + } + + /// + /// Function to create dictionary object for stamp property + /// + /// Client object containing Client data + /// Matter object containing Matter data + /// Matter details object which has data of properties to be stamped + /// returns dictionary object + internal Dictionary SetStampProperty(Client client, Matter matter, MatterDetails matterDetails) + { + string matterCenterPermission = string.Join(ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, matter.Permissions); + string matterCenterRoles = string.Join(ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, matter.Roles); + string documentTemplateCount = string.Join(ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR, matter.DocumentTemplateCount); + string matterCenterUsers = string.Empty; + string separator = string.Empty; + foreach (IList userNames in matter.AssignUserNames) + { + matterCenterUsers += separator + string.Join(ServiceConstants.SEMICOLON, userNames.Where(user => !string.IsNullOrWhiteSpace(user))); + separator = ServiceConstants.DOLLAR + ServiceConstants.PIPE + ServiceConstants.DOLLAR; + } + List keys = new List(); + Dictionary propertyList = new Dictionary(); + keys.Add(matterSettings.StampedPropertyPracticeGroup); + keys.Add(matterSettings.StampedPropertyAreaOfLaw); + keys.Add(matterSettings.StampedPropertySubAreaOfLaw); + keys.Add(matterSettings.StampedPropertyMatterName); + keys.Add(matterSettings.StampedPropertyMatterID); + keys.Add(matterSettings.StampedPropertyClientName); + keys.Add(matterSettings.StampedPropertyClientID); + keys.Add(matterSettings.StampedPropertyResponsibleAttorney); + keys.Add(matterSettings.StampedPropertyTeamMembers); + keys.Add(matterSettings.StampedPropertyIsMatter); + keys.Add(matterSettings.StampedPropertyOpenDate); + keys.Add(matterSettings.StampedPropertySecureMatter); + keys.Add(matterSettings.StampedPropertyBlockedUploadUsers); + keys.Add(matterSettings.StampedPropertyMatterDescription); + keys.Add(matterSettings.StampedPropertyConflictCheckDate); + keys.Add(matterSettings.StampedPropertyConflictCheckBy); + keys.Add(matterSettings.StampedPropertyMatterCenterRoles); + keys.Add(matterSettings.StampedPropertyMatterCenterPermissions); + keys.Add(matterSettings.StampedPropertyMatterCenterUsers); + keys.Add(matterSettings.StampedPropertyDefaultContentType); + keys.Add(matterSettings.StampedPropertyIsConflictIdentified); + keys.Add(matterSettings.StampedPropertyDocumentTemplateCount); + keys.Add(matterSettings.StampedPropertyBlockedUsers); + keys.Add(matterSettings.StampedPropertyMatterGUID); + + propertyList.Add(matterSettings.StampedPropertyPracticeGroup, WebUtility.HtmlEncode(matterDetails.PracticeGroup)); + propertyList.Add(matterSettings.StampedPropertyAreaOfLaw, WebUtility.HtmlEncode(matterDetails.AreaOfLaw)); + propertyList.Add(matterSettings.StampedPropertySubAreaOfLaw, WebUtility.HtmlEncode(matterDetails.SubareaOfLaw)); + propertyList.Add(matterSettings.StampedPropertyMatterName, WebUtility.HtmlEncode(matter.Name)); + propertyList.Add(matterSettings.StampedPropertyMatterID, WebUtility.HtmlEncode(matter.Id)); + propertyList.Add(matterSettings.StampedPropertyClientName, WebUtility.HtmlEncode(client.Name)); + propertyList.Add(matterSettings.StampedPropertyClientID, WebUtility.HtmlEncode(client.Id)); + propertyList.Add(matterSettings.StampedPropertyResponsibleAttorney, WebUtility.HtmlEncode(matterDetails.ResponsibleAttorney)); + propertyList.Add(matterSettings.StampedPropertyTeamMembers, WebUtility.HtmlEncode(matterDetails.TeamMembers)); + propertyList.Add(matterSettings.StampedPropertyIsMatter, ServiceConstants.TRUE); + propertyList.Add(matterSettings.StampedPropertyOpenDate, WebUtility.HtmlEncode(DateTime.Now.ToString(matterSettings.ValidDateFormat, CultureInfo.InvariantCulture))); + propertyList.Add(matterSettings.PropertyNameVtiIndexedPropertyKeys, WebUtility.HtmlEncode(ServiceUtility.GetEncodedValueForSearchIndexProperty(keys))); + propertyList.Add(matterSettings.StampedPropertySecureMatter, (matter.Conflict != null) ? (matter.Conflict.SecureMatter != null) ? WebUtility.HtmlEncode(matter.Conflict.SecureMatter) : "False" : "False"); + propertyList.Add(matterSettings.StampedPropertyBlockedUploadUsers, WebUtility.HtmlEncode(string.Join(";", matterDetails.UploadBlockedUsers))); + propertyList.Add(matterSettings.StampedPropertyMatterDescription, WebUtility.HtmlEncode(matter.Description)); + propertyList.Add(matterSettings.StampedPropertyConflictCheckDate, (string.IsNullOrEmpty(matter.Conflict.CheckOn)) ? + "" : WebUtility.HtmlEncode(Convert.ToDateTime(matter.Conflict.CheckOn, CultureInfo.InvariantCulture).ToString(matterSettings.ValidDateFormat, CultureInfo.InvariantCulture))); + propertyList.Add(matterSettings.StampedPropertyConflictCheckBy, WebUtility.HtmlEncode(matter.Conflict.CheckBy)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterRoles, WebUtility.HtmlEncode(matterCenterRoles)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterPermissions, WebUtility.HtmlEncode(matterCenterPermission)); + propertyList.Add(matterSettings.StampedPropertyMatterCenterUsers, WebUtility.HtmlEncode(matterCenterUsers)); + propertyList.Add(matterSettings.StampedPropertyDefaultContentType, WebUtility.HtmlEncode(matter.DefaultContentType)); + propertyList.Add(matterSettings.StampedPropertyIsConflictIdentified, WebUtility.HtmlEncode(matter.Conflict.Identified)); + propertyList.Add(matterSettings.StampedPropertyDocumentTemplateCount, WebUtility.HtmlEncode(documentTemplateCount)); + propertyList.Add(matterSettings.StampedPropertyBlockedUsers, WebUtility.HtmlEncode(string.Join(";", matter.BlockUserNames))); + propertyList.Add(matterSettings.StampedPropertyMatterGUID, WebUtility.HtmlEncode(matter.MatterGuid)); + propertyList.Add(matterSettings.StampedPropertySuccess, ServiceConstants.TRUE); + return propertyList; + } + + /// + /// Gets the display name of users having permission on library. + /// + /// Users having permission on library + /// + internal List RetrieveMatterUsers(IEnumerable userPermissionOnLibrary) + { + List users = new List(); + try + { + if (null != userPermissionOnLibrary && 0 < userPermissionOnLibrary.Count()) + { + foreach (RoleAssignment roles in userPermissionOnLibrary) + { + users.Add(roles.Member.Title); + } + } + } + catch (Exception) + { + throw; + } + return users; + } + + /// + /// Check Full Permission for logged in User. + /// + /// List of Assigned UserNames + /// List of Permission + /// Name of logged in User + /// Status of Full Permission + internal bool CheckFullPermissionInAssignList(IList> AssignUserNames, IList Permissions, string loggedInUserName) + { + bool result = false; + if (null != Permissions && null != AssignUserNames && Permissions.Count == AssignUserNames.Count) + { + int position = 0; + foreach (string roleName in Permissions) + { + IList assignUserNames = AssignUserNames[position]; + if (!string.IsNullOrWhiteSpace(roleName) && null != assignUserNames) + { + foreach (string user in assignUserNames) + { + if (!string.IsNullOrWhiteSpace(user) && user.Trim().Equals(loggedInUserName.Trim())) + { + if (roleName == matterSettings.EditMatterAllowedPermissionLevel) + { + return true; + } + } + } + } + position++; + } + return result; + } + return result; + } + #endregion + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/ValidationFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/ValidationFunctions.cs new file mode 100644 index 00000000..ea8f6f19 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Common/ValidationFunctions.cs @@ -0,0 +1,501 @@ +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.SharePoint.Client; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Linq; + +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter +{ + public class ValidationFunctions : IValidationFunctions + { + private MatterSettings matterSettings; + private ErrorSettings errorSettings; + private ListNames listNames; + private CamlQueries camlQueries; + private ISPList spList; + private IMatterRepository matterRespository; + public ValidationFunctions(ISPList spList, IOptions matterSettings, + IOptions errorSettings, IMatterRepository matterRespository, + IOptions listNames, IOptions camlQueries) + { + this.matterSettings = matterSettings.Value; + this.spList = spList; + this.errorSettings = errorSettings.Value; + this.matterRespository = matterRespository; + this.listNames = listNames.Value; + this.camlQueries = camlQueries.Value; + } + + /// + /// Checks if the lists exist + /// + /// + /// + /// + /// + private bool CheckListExists(Client client, string matterName, MatterConfigurations matterConfigurations = null) + { + List lists = new List(); + lists.Add(matterName); + lists.Add(matterName + matterSettings.OneNoteLibrarySuffix); + if (null == matterConfigurations || matterConfigurations.IsCalendarSelected) + { + lists.Add(matterName + matterSettings.CalendarNameSuffix); + } + if (null == matterConfigurations || matterConfigurations.IsTaskSelected) + { + lists.Add(matterName + matterSettings.TaskNameSuffix); + } + bool listExists = spList.Exists(client, new ReadOnlyCollection(lists)); + return listExists; + } + + public GenericResponseVM IsMatterValid(MatterInformationVM matterInformation, int methodNumber, MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponse = null; + var matterDetails = matterInformation.MatterDetails; + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) <= methodNumber && + int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) >= methodNumber && + !spList.CheckPermissionOnList(matterSettings.ProvisionMatterAppURL, matterSettings.SendMailListName, PermissionKind.EditListItems)) + { + genericResponse = new GenericResponseVM(); + //return string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, ServiceConstantStrings.IncorrectInputUserAccessCode, ServiceConstantStrings.IncorrectInputUserAccessMessage); + genericResponse.Code = errorSettings.IncorrectInputUserAccessCode; + genericResponse.Value = errorSettings.IncorrectInputUserAccessMessage; + } + else + { + + if (matterInformation.Client!=null) + { + genericResponse = new GenericResponseVM(); + genericResponse = ValidateClientInformation(matterInformation.Client, methodNumber); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (matterInformation.Matter!=null) + { + genericResponse = MatterMetadataValidation(matterInformation.Matter, matterInformation.Client, + methodNumber, matterConfigurations); + if (genericResponse!=null) + { + return genericResponse; + } + if (int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) + { + genericResponse = RoleCheck(matterInformation.Matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (matterInformation.Matter.Permissions!=null) + { + bool isFullControlPresent = ValidateFullControlPermission(matterInformation.Matter); + if (!isFullControlPresent) + { + return GenericResponse(errorSettings.IncorrectInputUserAccessCode, errorSettings.ErrorEditMatterMandatoryPermission); + } + } + } + if (null != matterDetails && !(int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber)) + { + if (string.IsNullOrWhiteSpace(matterDetails.PracticeGroup)) + { + return GenericResponse(errorSettings.IncorrectInputPracticeGroupCode, errorSettings.IncorrectInputPracticeGroupMessage); + } + if (string.IsNullOrWhiteSpace(matterDetails.AreaOfLaw)) + { + + return GenericResponse(errorSettings.IncorrectInputAreaOfLawCode, errorSettings.IncorrectInputAreaOfLawMessage); + } + if (string.IsNullOrWhiteSpace(matterDetails.SubareaOfLaw)) + { + return GenericResponse(errorSettings.IncorrectInputSubareaOfLawCode, errorSettings.IncorrectInputSubareaOfLawMessage); + } + try + { + if (string.IsNullOrWhiteSpace(matterDetails.ResponsibleAttorney)) + { + return GenericResponse(errorSettings.IncorrectInputResponsibleAttorneyCode, errorSettings.IncorrectInputResponsibleAttorneyMessage); + } + else + { + IList userNames = matterDetails.ResponsibleAttorney.Split(';').ToList(); + matterRespository.ResolveUserNames(matterInformation.Client, userNames).FirstOrDefault(); + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputResponsibleAttorneyCode, errorSettings.IncorrectInputResponsibleAttorneyMessage); + } + } + } + return genericResponse; + } + + + /// + /// Validates the roles for the matter and returns the validation status. + /// + /// Request Object containing SharePoint App Token + /// Matter object containing Matter data + /// Client Object + /// A string value indicating whether validations passed or fail + internal GenericResponseVM RoleCheck(Matter matter) + { + GenericResponseVM genericResponse = null; + try + { + + if ( matter.Roles.Count()<=0) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + IList roles = matterRespository.RoleCheck(matterSettings.CentralRepositoryUrl, listNames.DMSRoleListName, + camlQueries.DMSRoleQuery); + if (matter.Roles.Except(roles).Count() > 0) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + return genericResponse; + } + catch (Exception exception) + { + //ToDo: Why in role check function, we are deleting the matter + //ProvisionHelperFunctions.DeleteMatter(requestObject, client, matter); + //returnValue = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ServiceConstantStrings.LogTableName); + throw; + } + + + } + + /// + /// Function to validate client information + /// + /// Client object + /// Number indicating which method needs to be validated + /// String that contains error message + internal GenericResponseVM ValidateClientInformation(Client client, int methodNumber) + { + GenericResponseVM response = new GenericResponseVM(); + if (string.IsNullOrWhiteSpace(client.Url)) + { + response.Code = errorSettings.IncorrectInputClientUrlCode; + response.Value = errorSettings.IncorrectInputClientUrlMessage; + } + else if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) + { + if (string.IsNullOrWhiteSpace(client.Id)) + { + + response.Code = errorSettings.IncorrectInputClientIdCode; + response.Value = errorSettings.IncorrectInputClientIdMessage; + } + else if (string.IsNullOrWhiteSpace(client.Name)) + { + response.Code = errorSettings.IncorrectInputClientNameCode; + response.Value = errorSettings.IncorrectInputClientNameMessage; + } + } + return response; + } + + /// + /// Validates meta-data of a matter and returns the validation status (success/failure). + /// + /// Matter object containing Matter data + /// Client context object for SharePoint + /// Number indicating which method needs to be validated + /// A string value indicating whether validations passed or fail + internal GenericResponseVM MatterMetadataValidation(Matter matter, Client client, + int methodNumber, MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponseVM = null; + genericResponseVM = MatterNameValidation(matter); + if (genericResponseVM!=null) + { + return genericResponseVM; + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) + { + if (string.IsNullOrWhiteSpace(matter.Id)) + { + return GenericResponse(errorSettings.IncorrectInputMatterIdCode, errorSettings.IncorrectInputMatterIdMessage); + } + else + { + var matterId = Regex.Match(matter.Id, matterSettings.SpecialCharacterExpressionMatterId, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterIdLength, CultureInfo.InvariantCulture) < matter.Id.Length || !matterId.Success) + { + return GenericResponse(errorSettings.IncorrectInputMatterIdCode, errorSettings.IncorrectInputMatterIdMessage); + } + } + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber) + { + genericResponseVM = MatterDetailsValidation(matter, client, methodNumber, matterConfigurations); + if (genericResponseVM!=null) + { + return genericResponseVM; + } + } + try + { + if (!(int.Parse(ServiceConstants.ProvisionMatterCheckMatterExists, CultureInfo.InvariantCulture) == methodNumber) && + !(int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber)) + { + if (0 >= matter.AssignUserNames.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserNamesCode, errorSettings.IncorrectInputUserNamesMessage); + } + else + { + IList userList = matter.AssignUserNames.SelectMany(x => x).Distinct().ToList(); + //ToDo: Need to know the use of this method + matterRespository.ResolveUserNames(client, userList).FirstOrDefault(); + } + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputUserNamesCode, errorSettings.IncorrectInputUserNamesMessage); + } + + if (int.Parse(ServiceConstants.ProvisionMatterAssignUserPermissions, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterMatterLandingPage, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.EditMatterPermission, CultureInfo.InvariantCulture) == methodNumber) + { + GenericResponseVM genericResponse = CheckUserPermission(matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + if (int.Parse(ServiceConstants.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + int.Parse(ServiceConstants.ProvisionMatterShareMatter, CultureInfo.InvariantCulture) == methodNumber) + { + GenericResponseVM genericResponse = ValidateContentType(matter); + if (genericResponse!=null) + { + return genericResponse; + } + } + return genericResponseVM; + } + + /// + /// Validates the matter name. + /// + /// Matter details + /// Matter details validation result + private GenericResponseVM MatterNameValidation(Matter matter) + { + GenericResponseVM genericResponseVM = null; + string matterNameValidation = string.Empty; + if (string.IsNullOrWhiteSpace(matter.Name)) + { + return GenericResponse(errorSettings.IncorrectInputMatterNameCode, errorSettings.IncorrectInputMatterNameMessage); + } + var matterName = Regex.Match(matter.Name, matterSettings.SpecialCharacterExpressionMatterTitle, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterNameLength, CultureInfo.InvariantCulture) < matter.Name.Length || matter.Name.Length != matterName.Length) + { + + return GenericResponse(errorSettings.IncorrectInputMatterNameCode, errorSettings.IncorrectInputMatterNameMessage); + } + return genericResponseVM; + } + + /// + /// Validates details of a matter and returns the validation status. + /// + /// Matter object containing Matter data + /// Client context object for SharePoint + /// Number indicating which method needs to be validated + /// A string value indicating whether validations passed or fail + internal GenericResponseVM MatterDetailsValidation(Matter matter, Client client, int methodNumber, + MatterConfigurations matterConfigurations) + { + GenericResponseVM genericResponseVM = null; + if (matterConfigurations.IsMatterDescriptionMandatory) + { + if (string.IsNullOrWhiteSpace(matter.Description)) + { + return GenericResponse(errorSettings.IncorrectInputMatterDescriptionCode, errorSettings.IncorrectInputMatterDescriptionMessage); + } + else + { + var matterDescription = Regex.Match(matter.Description, matterSettings.SpecialCharacterExpressionMatterDescription, RegexOptions.IgnoreCase); + if (int.Parse(matterSettings.MatterDescriptionLength, CultureInfo.InvariantCulture) < matter.Description.Length || !matterDescription.Success) + { + return GenericResponse(errorSettings.IncorrectInputMatterDescriptionCode, errorSettings.IncorrectInputMatterDescriptionMessage); + } + } + } + if (matterConfigurations.IsConflictCheck) + { + DateTime conflictCheckedOnDate; + bool isValidDate = DateTime.TryParse(matter.Conflict.CheckOn, out conflictCheckedOnDate); + if (!isValidDate || 0 > DateTime.Compare(DateTime.Now, conflictCheckedOnDate)) + { + return GenericResponse(errorSettings.IncorrectInputConflictDateCode, errorSettings.IncorrectInputConflictDateMessage); + } + if (string.IsNullOrWhiteSpace(matter.Conflict.Identified)) + { + return GenericResponse(errorSettings.IncorrectInputConflictIdentifiedCode, errorSettings.IncorrectInputConflictIdentifiedMessage); + } + else + { + try + { + if (0 > string.Compare(ServiceConstants.FALSE, matter.Conflict.Identified, StringComparison.OrdinalIgnoreCase)) + { + if (0 >= matter.BlockUserNames.Count()) + { + return GenericResponse(errorSettings.IncorrectInputBlockUserNamesCode, errorSettings.IncorrectInputBlockUserNamesMessage); + } + else + { + //ToDo: Need to understand the need of this method + matterRespository.ResolveUserNames(client, matter.BlockUserNames).FirstOrDefault(); + } + } + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputBlockUserNamesCode, errorSettings.IncorrectInputBlockUserNamesMessage); + } + + } + if (string.IsNullOrWhiteSpace(matter.Conflict.CheckBy)) + { + return GenericResponse(errorSettings.IncorrectInputConflictCheckByCode, errorSettings.IncorrectInputConflictCheckByMessage); + } + else + { + try + { + //ToDo: Need to understand the need of this method + matterRespository.ResolveUserNames(client, new List() { matter.Conflict.CheckBy }).FirstOrDefault(); + } + catch (Exception) + { + return GenericResponse(errorSettings.IncorrectInputConflictCheckByCode, errorSettings.IncorrectInputConflictCheckByMessage); + } + } + } + if (int.Parse(ServiceConstants.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber && 0 >= matter.Roles.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserRolesCode, errorSettings.IncorrectInputUserRolesMessage); + } + return genericResponseVM; + } + + + public GenericResponseVM GenericResponse(string code, string value) + { + GenericResponseVM genericResponseVM = new GenericResponseVM(); + genericResponseVM.Code = errorSettings.IncorrectInputUserRolesCode; + genericResponseVM.Value = errorSettings.IncorrectInputUserRolesMessage; + return genericResponseVM; + } + + /// + /// Validates the permissions assigned to the users. + /// + /// Matter object containing Matter data + /// A string value indicating whether validations passed or fail + private GenericResponseVM CheckUserPermission(Matter matter) + { + if (0 >= matter.Permissions.Count()) + { + return GenericResponse(errorSettings.IncorrectInputUserPermissionsCode, errorSettings.IncorrectInputUserPermissionsMessage); + } + else + { + string userAllowedPermissions = matterSettings.UserPermissions; + if (!string.IsNullOrEmpty(userAllowedPermissions)) + { + List userPermissions = userAllowedPermissions.ToUpperInvariant().Trim().Split(new string[] { "," }, + StringSplitOptions.RemoveEmptyEntries).ToList(); + foreach (string Permissions in matter.Permissions) + { + if (!userPermissions.Contains(Permissions.Trim().ToUpperInvariant())) + { + return GenericResponse(errorSettings.IncorrectInputUserPermissionsCode, errorSettings.IncorrectInputUserPermissionsMessage); + } + } + } + } + return null; + } + + + /// + /// Validates content type for the matter. + /// + /// Matter object containing Matter data + /// A string value indicating whether validations passed or fail + private GenericResponseVM ValidateContentType(Matter matter) + { + if ((0 >= matter.ContentTypes.Count()) || string.IsNullOrWhiteSpace(matter.DefaultContentType)) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + else + { + foreach (string contentType in matter.ContentTypes) + { + var contentTypeCheck = Regex.Match(contentType, matterSettings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); + if (contentTypeCheck.Success || int.Parse(matterSettings.ContentTypeLength, CultureInfo.InvariantCulture) < contentType.Length) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + } + var defaultContentTypeCheck = Regex.Match(matter.DefaultContentType, matterSettings.SpecialCharacterExpressionContentType, RegexOptions.IgnoreCase); + if (defaultContentTypeCheck.Success || + int.Parse(matterSettings.ContentTypeLength, CultureInfo.InvariantCulture) < matter.DefaultContentType.Length) + { + return GenericResponse(errorSettings.IncorrectInputContentTypeCode, errorSettings.IncorrectInputContentTypeMessage); + } + } + return null; + } + + /// + /// Validates if there is at-least one user with full control in assign list. + /// + /// Matter object + /// Status of Full Control permission + private bool ValidateFullControlPermission(Matter matter) + { + + bool hasFullConrol = false; + if (null != matter && null != matter.Permissions && 0 != matter.Permissions.Count) + { + hasFullConrol = matter.Permissions.Contains(matterSettings.EditMatterAllowedPermissionLevel); + } + return hasFullConrol; + } + + + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/DocumentController.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/DocumentController.cs new file mode 100644 index 00000000..c1e35cfe --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/DocumentController.cs @@ -0,0 +1,305 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.ProviderService +// Author : v-lapedd +// Created : 04-09-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines service for Taxonomy +// *********************************************************************** + +using System; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Swashbuckle.SwaggerGen.Annotations; +using System.Net; + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository; +using System.Reflection; +using Microsoft.AspNet.Authorization; +#endregion + + +namespace Microsoft.Legal.MatterCenter.Service +{ + /// + /// Document Controller class deals with finding document, pinning document, unpinning the document etc. + /// + [Authorize(ActiveAuthenticationSchemes = "Bearer")] + [Route("api/v1/document")] + public class DocumentController:Controller + { + private ErrorSettings errorSettings; + private ISPOAuthorization spoAuthorization; + private IMatterCenterServiceFunctions matterCenterServiceFunctions; + private DocumentSettings documentSettings; + private IDocumentRepository documentRepositoy; + private ICustomLogger customLogger; + private LogTables logTables; + /// + /// Constructor where all the required dependencies are injected + /// + /// + /// + /// + /// + /// + public DocumentController(IOptions errorSettings, + IOptions documentSettings, + ISPOAuthorization spoAuthorization, + IMatterCenterServiceFunctions matterCenterServiceFunctions, + IDocumentRepository documentRepositoy, + ICustomLogger customLogger, IOptions logTables + ) + { + this.errorSettings = errorSettings.Value; + this.documentSettings = documentSettings.Value; + this.spoAuthorization = spoAuthorization; + this.matterCenterServiceFunctions = matterCenterServiceFunctions; + this.documentRepositoy = documentRepositoy; + this.customLogger = customLogger; + this.logTables = logTables.Value; + } + + /// + /// Gets the matters based on search criteria. + /// + /// + /// searchResponseVM + [HttpPost("getdocuments")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + public async Task Get([FromBody]SearchRequestVM searchRequestVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + + if (searchRequestVM == null && searchRequestVM.Client == null && searchRequestVM.SearchObject == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + + #endregion + + var searchObject = searchRequestVM.SearchObject; + // Encode all fields which are coming from js + SearchUtility.EncodeSearchDetails(searchObject.Filters, false); + // Encode Search Term + searchObject.SearchTerm = (searchObject.SearchTerm != null) ? + WebUtility.HtmlEncode(searchObject.SearchTerm).Replace(ServiceConstants.ENCODED_DOUBLE_QUOTES, ServiceConstants.DOUBLE_QUOTE) : string.Empty; + + var searchResultsVM = await documentRepositoy.GetDocumentsAsync(searchRequestVM); + return matterCenterServiceFunctions.ServiceResponse(searchResultsVM.SearchResults, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("getpinneddocuments")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// Get Pin Documents + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetPin([FromBody]Client client) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + #endregion + var pinResponseVM = await documentRepositoy.GetPinnedRecordsAsync(client); + if (pinResponseVM != null && pinResponseVM.TotalCount == 0) + { + errorResponse = new ErrorResponse() + { + Message = pinResponseVM.NoPinnedMessage, + ErrorCode = ((int)HttpStatusCode.NotFound).ToString(), + Description = "No resource found for your search criteria" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + return matterCenterServiceFunctions.ServiceResponse(pinResponseVM, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("pindocument")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// pin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task Pin([FromBody]PinRequestDocumentVM pinRequestDocumentVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (pinRequestDocumentVM == null && pinRequestDocumentVM.Client == null && pinRequestDocumentVM.DocumentData == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var isDocumentPinned = await documentRepositoy.PinRecordAsync(pinRequestDocumentVM); + var documentPinned = new + { + IsDocumentPinned = isDocumentPinned + }; + return matterCenterServiceFunctions.ServiceResponse(documentPinned, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("unpindocument")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task UnPin([FromBody]PinRequestMatterVM pinRequestMatterVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (pinRequestMatterVM == null && pinRequestMatterVM.Client == null && pinRequestMatterVM.MatterData == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var isDocumentUnPinned = await documentRepositoy.UnPinRecordAsync(pinRequestMatterVM); + var documentUnPinned = new + { + IsDocumentUnPinned = isDocumentUnPinned + }; + return matterCenterServiceFunctions.ServiceResponse(documentUnPinned, (int)HttpStatusCode.OK); + + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Returns document and list GUID + /// + /// Request object containing SharePoint App Token + /// Client object containing list data + /// Document and list GUID + [HttpPost("getassets")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + public async Task GetDocumentAssets(Client client) + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var documentAsset = await documentRepositoy.GetDocumentAndClientGUIDAsync(client); + return matterCenterServiceFunctions.ServiceResponse(documentAsset, (int)HttpStatusCode.OK); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/MatterController.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/MatterController.cs new file mode 100644 index 00000000..df735e79 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/MatterController.cs @@ -0,0 +1,728 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.ProviderService +// Author : v-lapedd +// Created : 04-09-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines service for Taxonomy +// *********************************************************************** + +using System; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.Extensions.OptionsModel; +using Swashbuckle.SwaggerGen.Annotations; +using System.Net; +using System.Reflection; +using System.Collections.Generic; +using Newtonsoft.Json; +using System.Globalization; +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.AspNet.Authorization; +#endregion +namespace Microsoft.Legal.MatterCenter.Service +{ + /// + /// Matter Controller class deals with matter provisioning, finding matter, pinning matter, unpinning the matterm, updating the matter + /// + [Authorize(ActiveAuthenticationSchemes = "Bearer")] + [Route("api/v1/matter")] + public class MatterController : Controller + { + private ErrorSettings errorSettings; + private ISPOAuthorization spoAuthorization; + private IMatterCenterServiceFunctions matterCenterServiceFunctions; + private MatterSettings matterSettings; + private IMatterRepository matterRepositoy; + private ICustomLogger customLogger; + private LogTables logTables; + private IValidationFunctions validationFunctions; + private IEditFunctions editFunctions; + private IMatterProvision matterProvision; + /// + /// Constructor where all the required dependencies are injected + /// + /// + /// + /// + /// + public MatterController(IOptions errorSettings, + IOptions matterSettings, + ISPOAuthorization spoAuthorization, + IMatterCenterServiceFunctions matterCenterServiceFunctions, + IMatterRepository matterRepositoy, + ICustomLogger customLogger, IOptions logTables, + IValidationFunctions validationFunctions, + IEditFunctions editFunctions, + IMatterProvision matterProvision + ) + { + this.errorSettings = errorSettings.Value; + this.matterSettings = matterSettings.Value; + this.spoAuthorization = spoAuthorization; + this.matterCenterServiceFunctions = matterCenterServiceFunctions; + this.matterRepositoy = matterRepositoy; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.validationFunctions = validationFunctions; + this.editFunctions = editFunctions; + this.matterProvision = matterProvision; + } + + + /// + /// Gets the matters based on search criteria. + /// + /// + /// searchResponseVM + [HttpPost("get")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + public async Task Get([FromBody]SearchRequestVM searchRequestVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + + #region Error Checking + ErrorResponse errorResponse = null; + if (searchRequestVM == null && searchRequestVM.Client == null && searchRequestVM.SearchObject == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + + #endregion + + var searchObject = searchRequestVM.SearchObject; + // Encode all fields which are coming from js + SearchUtility.EncodeSearchDetails(searchObject.Filters, false); + // Encode Search Term + searchObject.SearchTerm = (searchObject.SearchTerm != null) ? + WebUtility.HtmlEncode(searchObject.SearchTerm).Replace(ServiceConstants.ENCODED_DOUBLE_QUOTES, ServiceConstants.DOUBLE_QUOTE) : string.Empty; + + var searchResultsVM = await matterRepositoy.GetMattersAsync(searchRequestVM); + return matterCenterServiceFunctions.ServiceResponse(searchResultsVM, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("update")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// Updates matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public IActionResult Update([FromBody]MatterInformationVM matterInformation) + { + string editMatterValidation = string.Empty; + var matter = matterInformation.Matter; + var client = matterInformation.Client; + var userid = matterInformation.UserIds; + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + if (matterInformation.Client == null && matterInformation.Matter == null && matterInformation.MatterDetails == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + + #region Validations + GenericResponseVM validationResponse = validationFunctions.IsMatterValid(matterInformation, int.Parse(ServiceConstants.EditMatterPermission), null); + if(validationResponse != null) + { + errorResponse = new ErrorResponse() + { + Message = validationResponse.Value, + ErrorCode = validationResponse.Code, + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + + if (null != matter.Conflict && !string.IsNullOrWhiteSpace(matter.Conflict.Identified)) + { + if (matter.AssignUserNames.Count==0) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.IncorrectInputUserNamesMessage, + ErrorCode = errorSettings.IncorrectInputUserNamesCode, + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + else + { + if (Convert.ToBoolean(matter.Conflict.Identified, CultureInfo.InvariantCulture)) + { + validationResponse = editFunctions.CheckSecurityGroupInTeamMembers(client, matter, userid); + if (validationResponse != null) + { + errorResponse = new ErrorResponse() + { + Message = validationResponse.Value, + ErrorCode = validationResponse.Code, + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + } + } + } + else + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.IncorrectInputConflictIdentifiedMessage, + ErrorCode = errorSettings.IncorrectInputConflictIdentifiedCode, + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + + #region Upadte Matter + GenericResponseVM genericResponse = matterProvision.UpdateMatter(matterInformation); + if(genericResponse==null) + { + var result = new GenericResponseVM() + { + Code = "200", + Value= "Update Success" + }; + return matterCenterServiceFunctions.ServiceResponse(result, (int)HttpStatusCode.OK); + } + else + { + return matterCenterServiceFunctions.ServiceResponse(genericResponse, (int)HttpStatusCode.NotModified); + } + + #endregion + + } + catch (Exception ex) + { + MatterRevertList matterRevertListObject = new MatterRevertList() + { + MatterLibrary = matterInformation.Matter.Name, + MatterOneNoteLibrary = matterInformation.Matter.Name + matterSettings.OneNoteLibrarySuffix, + MatterCalendar = matterInformation.Matter.Name + matterSettings.CalendarNameSuffix, + MatterTask = matterInformation.Matter.Name + matterSettings.TaskNameSuffix, + MatterSitePages = matterSettings.MatterLandingPageRepositoryName + }; + //editFunctions.RevertMatterUpdates(client, matter, matterRevertListObject, loggedInUserName, userPermissionOnLibrary, listItemId, isEditMode); + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + finally + { + + } + } + + + + [HttpPost("updatemetadata")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// Updates matter metadata - Stamps properties to the created matter. + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public IActionResult UpdateMetadata([FromBody]MatterMetdataVM matterMetdata) + { + string editMatterValidation = string.Empty; + var matter = matterMetdata.Matter; + var client = matterMetdata.Client; + + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + if (matterMetdata.Client == null && matterMetdata.Matter == null && + matterMetdata.MatterDetails == null && matterMetdata.MatterProvisionFlags==null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + + #region Validations + MatterInformationVM matterInfo = new MatterInformationVM() + { + Client = matterMetdata.Client, + Matter = matterMetdata.Matter, + MatterDetails = matterMetdata.MatterDetails + }; + GenericResponseVM genericResponse = validationFunctions.IsMatterValid(matterInfo, + int.Parse(ServiceConstants.ProvisionMatterUpdateMetadataForList), + matterMetdata.MatterConfigurations); + if (genericResponse != null) + { + matterProvision.DeleteMatter(client, matter); + errorResponse = new ErrorResponse() + { + Message = genericResponse.Value, + ErrorCode = genericResponse.Code, + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + try + { + genericResponse = matterProvision.UpdateMatterMetadata(matterMetdata); + if (genericResponse == null) + { + var result = new GenericResponseVM() + { + Code = "200", + Value = "Update Success" + }; + return matterCenterServiceFunctions.ServiceResponse(result, (int)HttpStatusCode.OK); + } + return matterCenterServiceFunctions.ServiceResponse(genericResponse, (int)HttpStatusCode.NotModified); + } + catch(Exception ex) + { + matterProvision.DeleteMatter(client, matter); + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + + [HttpPost("pin")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// pin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task Pin([FromBody]PinRequestMatterVM pinRequestMatterVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (pinRequestMatterVM == null && pinRequestMatterVM.Client == null && pinRequestMatterVM.MatterData == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var isMatterPinned = await matterRepositoy.PinRecordAsync(pinRequestMatterVM); + var matterPinned = new + { + IsMatterPinned = isMatterPinned + }; + return matterCenterServiceFunctions.ServiceResponse(matterPinned, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("unpin")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task UnPin([FromBody]PinRequestMatterVM pinRequestMatterVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (pinRequestMatterVM == null && pinRequestMatterVM.Client == null && pinRequestMatterVM.MatterData == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var isMatterUnPinned = await matterRepositoy.UnPinRecordAsync(pinRequestMatterVM); + var matterUnPinned = new + { + IsMatterUnPinned = isMatterUnPinned + }; + return matterCenterServiceFunctions.ServiceResponse(matterUnPinned, (int)HttpStatusCode.OK); + + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("getpinned")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetPin([FromBody]Client client) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + + var pinResponseVM = await matterRepositoy.GetPinnedRecordsAsync(client); + if (pinResponseVM != null && pinResponseVM.TotalCount == 0) + { + errorResponse = new ErrorResponse() + { + Message = pinResponseVM.NoPinnedMessage, + ErrorCode = ((int)HttpStatusCode.NotFound).ToString(), + Description = "No resource found for your search criteria" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + return matterCenterServiceFunctions.ServiceResponse(pinResponseVM, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + [HttpPost("getfolderhierarchy")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetFolderHierachy([FromBody]MatterData matterData) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (matterData == null && string.IsNullOrWhiteSpace(matterData.MatterUrl) && string.IsNullOrWhiteSpace(matterData.MatterName)) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + var folderHierarchy = await matterRepositoy.GetFolderHierarchyAsync(matterData); + return matterCenterServiceFunctions.ServiceResponse(folderHierarchy, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("getroles")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetRoles([FromBody]Client client) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + IList roles = new List(); + string result = ServiceUtility.GetDataFromAzureRedisCache(ServiceConstants.CACHE_ROLES); + if (string.IsNullOrEmpty(result)) + { + roles = await matterRepositoy.GetRolesAsync(client); + ServiceUtility.SetDataIntoAzureRedisCache>(ServiceConstants.CACHE_ROLES, roles); + } + else + { + roles = JsonConvert.DeserializeObject>(result); + } + return matterCenterServiceFunctions.ServiceResponse(roles, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("getpermissionlevels")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// unpin the matter + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetPermissionLevels([FromBody]Client client) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + IList roles = new List(); + roles = await matterRepositoy.GetPermissionLevelsAsync(client); + return matterCenterServiceFunctions.ServiceResponse(roles, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + + [HttpPost("getusers")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// get users + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetUsers([FromBody]SearchRequestVM searchRequestVM) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (searchRequestVM.Client == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + searchRequestVM.SearchObject.SearchTerm = (!string.IsNullOrWhiteSpace(searchRequestVM.SearchObject.SearchTerm)) ? searchRequestVM.SearchObject.SearchTerm : string.Empty; + IList users = await matterRepositoy.GetUsersAsync(searchRequestVM); + if (users != null && users.Count != 0) + { + return matterCenterServiceFunctions.ServiceResponse(users, (int)HttpStatusCode.OK); + } + else + { + Users noResult = new Users() + { + Name = errorSettings.PeoplePickerNoResults, + LogOnName = string.Empty, + Email = string.Empty, + EntityType = string.Empty + }; + users.Add(noResult); + return matterCenterServiceFunctions.ServiceResponse(users, (int)HttpStatusCode.OK); + } + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + [HttpPost("getconfigurations")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// get users + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client /// + public async Task GetConfigurations([FromBody]string siteCollectionPath) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + if (string.IsNullOrWhiteSpace(siteCollectionPath)) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + GenericResponseVM genericResponseVM = await matterRepositoy.GetConfigurationsAsync(siteCollectionPath); + return matterCenterServiceFunctions.ServiceResponse(genericResponseVM, (int)HttpStatusCode.OK); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/SharedController.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/SharedController.cs new file mode 100644 index 00000000..067f4ae6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/SharedController.cs @@ -0,0 +1,197 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.ProviderService +// Author : v-lapedd +// Created : 04-09-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines service for Taxonomy +// *********************************************************************** + + +using System; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.Extensions.OptionsModel; + +using Swashbuckle.SwaggerGen.Annotations; +using System.Net; +using System.Reflection; + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Models; +using System.Collections.Generic; +using Newtonsoft.Json; +using Microsoft.AspNet.Authorization; +#endregion +namespace Microsoft.Legal.MatterCenter.Service +{ + [Authorize(ActiveAuthenticationSchemes = "Bearer")] + [Route("api/v1/shared")] + public class SharedController : Controller + { + private ErrorSettings errorSettings; + private ISPOAuthorization spoAuthorization; + private IMatterCenterServiceFunctions matterCenterServiceFunctions; + private SharedSettings sharedSettings; + private ISharedRepository sharedRepository; + private ICustomLogger customLogger; + private LogTables logTables; + /// + /// Constructor where all the required dependencies are injected + /// + /// + /// + /// + /// + public SharedController(IOptions errorSettings, + IOptions sharedSettings, + ISPOAuthorization spoAuthorization, + IMatterCenterServiceFunctions matterCenterServiceFunctions, + ICustomLogger customLogger, IOptions logTables, + ISharedRepository sharedRepository + ) + { + this.errorSettings = errorSettings.Value; + this.spoAuthorization = spoAuthorization; + this.matterCenterServiceFunctions = matterCenterServiceFunctions; + this.sharedRepository = sharedRepository; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.sharedSettings = sharedSettings.Value; + } + + /// + /// Returns true or false based on the existence of the matter landing page and OneNote file at the URLs provided. + /// + /// Request object containing SharePoint App Token + /// Client object containing Client data + /// String object containing the OneNote file path + /// String object containing the Matter Landing Page file path + /// $|$ Separated string indicating that the OneNote and the Matter Landing Page exist or not + [HttpPost("urlexists")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + public async Task UrlExists(Client client, string oneNoteUrl, string matterLandingPageUrl) + { + string result = string.Empty; + + try + { + + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + + if (client == null && string.IsNullOrEmpty(oneNoteUrl) && string.IsNullOrEmpty(matterLandingPageUrl)) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + #endregion + var oneNoteUrlExists = await sharedRepository.UrlExistsAsync(client, oneNoteUrl); + var matterLandingUrlExists = await sharedRepository.UrlExistsAsync(client, matterLandingPageUrl); + var urlExists = new + { + OneNoteExists = oneNoteUrlExists, + MatterLandingExists = matterLandingUrlExists + }; + return matterCenterServiceFunctions.ServiceResponse(urlExists, (int)HttpStatusCode.OK); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Returns contextual help content in JSON format. + /// + /// Request object containing SharePoint App Token + /// Client object containing Client data + /// String object containing the page number where user is on + /// IActionResult which return List of ContextHelpData in JSON format + [HttpPost("help")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + public async Task Help(Client client, string selectedPage) + { + string result = string.Empty; + try + { + + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + + if (client == null && string.IsNullOrWhiteSpace(selectedPage)) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoInputs, + ErrorCode = HttpStatusCode.BadRequest.ToString(), + Description = "No input data is passed" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + #endregion + List contextHelpCollection = new List(); + string[] pageNames = sharedSettings.MatterCenterPages.Split(';'); + switch (selectedPage) + { + case "1": + selectedPage = pageNames[1]; + break; + case "2": + selectedPage = pageNames[2]; + break; + case "4": + selectedPage = pageNames[4]; + break; + default: + selectedPage = pageNames[0]; + break; + } + string cacheKey = string.Concat(selectedPage, ServiceConstants.LINKS_STATIC_STRING); + result = ServiceUtility.GetDataFromAzureRedisCache(cacheKey); + if(string.IsNullOrEmpty(result)) + { + contextHelpCollection = await sharedRepository.GetMatterHelpAsync(client, selectedPage); + ServiceUtility.SetDataIntoAzureRedisCache>(cacheKey, contextHelpCollection); + } + else + { + contextHelpCollection = JsonConvert.DeserializeObject>(result); + } + return matterCenterServiceFunctions.ServiceResponse(contextHelpCollection, (int)HttpStatusCode.OK); + } + catch (Exception exception) + { + customLogger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/TaxonomyController.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/TaxonomyController.cs new file mode 100644 index 00000000..0dc47de9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Controllers/TaxonomyController.cs @@ -0,0 +1,238 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.ProviderService +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines service for Taxonomy +// *********************************************************************** +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.Extensions.OptionsModel; +using Microsoft.Legal.MatterCenter.Models; +using Swashbuckle.SwaggerGen.Annotations; +using Newtonsoft.Json; +using System.Reflection; +using Microsoft.AspNet.Authorization; +using System.Net; +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Service.HelperClasses; +using Microsoft.Legal.MatterCenter.Repository; +#endregion + +namespace Microsoft.Legal.MatterCenter.Service.Controllers +{ + /// + /// Taxonomy Controller will read the term store information related to matter center + /// + [Authorize(ActiveAuthenticationSchemes = "Bearer")] + [Route("api/v1/taxonomy")] + public class TaxonomyController:Controller + { + private ErrorSettings errorSettings; + private ISPOAuthorization spoAuthorization; + private IMatterCenterServiceFunctions matterCenterServiceFunctions; + private TaxonomySettings taxonomySettings; + private GeneralSettings generalSettings; + private ITaxonomyRepository taxonomyRepository; + private ICustomLogger customLogger; + private LogTables logTables; + + /// + /// Constructor where all the required dependencies are injected + /// + /// + /// + /// + /// + /// + /// + public TaxonomyController(IOptions errorSettings, + IOptions taxonomySettings, + IOptions generalSettings, + ISPOAuthorization spoAuthorization, + IMatterCenterServiceFunctions matterCenterServiceFunctions, + ITaxonomyRepository taxonomyRepository, ICustomLogger customLogger, IOptions logTables) + { + this.errorSettings = errorSettings.Value; + this.taxonomySettings = taxonomySettings.Value; + this.generalSettings = generalSettings.Value; + this.spoAuthorization = spoAuthorization; + this.matterCenterServiceFunctions = matterCenterServiceFunctions; + this.taxonomyRepository = taxonomyRepository; + this.customLogger = customLogger; + this.logTables = logTables.Value; + } + + [HttpPost("gettaxonomy")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + [SwaggerResponse(HttpStatusCode.BadRequest)] + /// + /// Gets the hierarchy of terms along with the specific custom properties of each term from term store. + /// + /// Client object containing Client data + /// Term Store object containing Term store data + /// Returns JSON object to the client + /// + public async Task GetTaxonomy([FromBody]TermStoreViewModel termStoreViewModel) + { + try + { + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + #region Error Checking + ErrorResponse errorResponse = null; + //if the token is not valid, immediately return no authorization error to the user + if (errorResponse != null && !errorResponse.IsTokenValid) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.Unauthorized); + } + + ValidationHelperFunctions.ErrorSettings = errorSettings; + errorResponse = ValidationHelperFunctions.TaxonomyValidation(termStoreViewModel.Client); + if (errorResponse != null && !String.IsNullOrWhiteSpace(errorResponse.Message)) + { + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.BadRequest); + } + #endregion + + string cacheValue = string.Empty; + string key = string.Empty; + var details = termStoreViewModel.TermStoreDetails; + if (details.TermSetName == taxonomySettings.PracticeGroupTermSetName) + { + key = ServiceConstants.CACHE_MATTER_TYPE; + } + else if (details.TermSetName == taxonomySettings.ClientTermSetName) + { + key = ServiceConstants.CACHE_CLIENTS; + } + + ServiceUtility.GeneralSettings = generalSettings; + //cacheValue = ServiceUtility.GetDataFromAzureRedisCache(key); + TaxonomyResponseVM taxonomyRepositoryVM = null; + if (String.IsNullOrEmpty(cacheValue)) + { + taxonomyRepositoryVM = await taxonomyRepository.GetTaxonomyHierarchyAsync(termStoreViewModel); + if (termStoreViewModel.TermStoreDetails.TermSetName == taxonomySettings.PracticeGroupTermSetName && taxonomyRepositoryVM.TermSets!=null) + { + ServiceUtility.SetDataIntoAzureRedisCache(key, taxonomyRepositoryVM.TermSets); + return matterCenterServiceFunctions.ServiceResponse(taxonomyRepositoryVM.TermSets, (int)HttpStatusCode.OK); + } + if (termStoreViewModel.TermStoreDetails.TermSetName == taxonomySettings.ClientTermSetName && taxonomyRepositoryVM.ClientTermSets != null) + { + ServiceUtility.SetDataIntoAzureRedisCache(key, taxonomyRepositoryVM.ClientTermSets); + return matterCenterServiceFunctions.ServiceResponse(taxonomyRepositoryVM.ClientTermSets, (int)HttpStatusCode.OK); + } + } + else + { + if (termStoreViewModel.TermStoreDetails.TermSetName == taxonomySettings.PracticeGroupTermSetName) + { + var pgTermSets = JsonConvert.DeserializeObject(cacheValue); + if (pgTermSets == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoResult, + ErrorCode = "404", + Description = "No data is present for the given passed input" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + return matterCenterServiceFunctions.ServiceResponse(pgTermSets, (int)HttpStatusCode.OK); + } + if (termStoreViewModel.TermStoreDetails.TermSetName == taxonomySettings.ClientTermSetName) + { + var clientTermSets = JsonConvert.DeserializeObject(cacheValue); + if (clientTermSets == null) + { + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoResult, + ErrorCode = "404", + Description = "No data is present for the given passed input" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + return matterCenterServiceFunctions.ServiceResponse(clientTermSets, (int)HttpStatusCode.OK); + } + } + //If all the above condition fails, return validation error object + errorResponse = new ErrorResponse() + { + Message = errorSettings.MessageNoResult, + ErrorCode = "404", + Description = "No data is present for the given passed input" + }; + return matterCenterServiceFunctions.ServiceResponse(errorResponse, (int)HttpStatusCode.NotFound); + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + + } + /// + /// This is test method for testing the contrroller + /// + /// + + [HttpGet("getcurrentsitetitle")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + public IActionResult GetCurrentSiteTitle() + { + var termStoreViewModel1 = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Disney", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "Site Collection - microsoft.sharepoint.com-teams-mcuisite", + TermSetName = "Clients", + CustomPropertyName = "ClientURL" + } + }; + + string siteName = string.Empty; + spoAuthorization.AccessToken = HttpContext.Request.Headers["Authorization"]; + + siteName = taxonomyRepository.GetCurrentSiteName(termStoreViewModel1.Client); + var success = new + { + Title = siteName + }; + return matterCenterServiceFunctions.ServiceResponse(success, (int)HttpStatusCode.OK); + } + + + /// + /// This is test method for testing the contrroller + /// + /// + [HttpGet("getcurrentsitetitlev1")] + [SwaggerResponse(HttpStatusCode.OK)] + [SwaggerResponse(HttpStatusCode.Unauthorized)] + public IActionResult TestWebApi() + { + + var success = new + { + Title = "New Title" + }; + return matterCenterServiceFunctions.ServiceResponse(success, (int)HttpStatusCode.OK); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Filters/MatterCenterExceptionFilter.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Filters/MatterCenterExceptionFilter.cs new file mode 100644 index 00000000..d12aae79 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Filters/MatterCenterExceptionFilter.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Filters; +using Microsoft.Extensions.Logging; +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Diagnostics; +using System.Net; + +namespace Microsoft.Legal.MatterCenter.Service.Filters +{ + public class MatterCenterExceptionFilter : IExceptionFilter + { + private readonly ILogger _logger; + public MatterCenterExceptionFilter(ILoggerFactory logger) + { + if (logger == null) + { + throw new ArgumentNullException(nameof(logger)); + } + this._logger = logger.CreateLogger("Matter Center Exception Filter"); + } + + public void OnException(ExceptionContext context) + { + this._logger.LogError("MatterCenterExceptionFilter", context.Exception); + var stackTrace = new StackTrace(context.Exception, true); + StackFrame stackFrameInstance = null; + + if(stackTrace.GetFrames().Length>0) + { + for(int i=0; i< stackTrace.GetFrames().Length; i++) + { + if(stackTrace.GetFrames()[i].ToString().Contains("Microsoft.Legal.Matter")) + { + stackFrameInstance = stackTrace.GetFrames()[i]; + break; + } + } + } + + var response = new ErrorResponse() + { + Message = context.Exception.Message, + StackTrace = context.Exception.ToString(), + Description = "Error occured in the system. Please contact the administrator", + //Exception = context.Exception.ToString(), + LineNumber = stackFrameInstance?.GetFileLineNumber(), + MethodName = stackFrameInstance?.GetMethod().Name, + ClassName = stackFrameInstance?.GetMethod().DeclaringType.Name, + ErrorCode = ((int)HttpStatusCode.InternalServerError).ToString() + }; + context.Result = new ObjectResult(response) + { + StatusCode = (int)HttpStatusCode.InternalServerError, + DeclaredType = typeof(ErrorResponse) + }; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/HelperClasses/ValidationHelperFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/HelperClasses/ValidationHelperFunctions.cs new file mode 100644 index 00000000..00a22aee --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/HelperClasses/ValidationHelperFunctions.cs @@ -0,0 +1,73 @@ +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.Legal.MatterCenter.Utility; + + +namespace Microsoft.Legal.MatterCenter.Service.HelperClasses +{ + /// + /// This class will be used to validate the client input values + /// + internal static class ValidationHelperFunctions + { + internal static ErrorSettings ErrorSettings + { + get; + set; + } + + /// + /// This method will validate the client object and if there are any errors in the client inout object, the method will + /// return ErrorResponse object or it will return null + /// + /// Contains the information such as ClientId, ClientUrl etc + /// ErrorResponse + internal static ErrorResponse TaxonomyValidation(Client client) + { + if(client!=null) + { + return ValidateClientInformation(client, 0); + } + else + { + ErrorResponse errorResponse = new ErrorResponse(); + errorResponse.ErrorCode = ""; + errorResponse.Message = ErrorSettings.MessageNoInputs; + return errorResponse; + } + return null; + } + + /// + /// Function to validate client information + /// + /// Client object + /// Number indicating which method needs to be validated + /// ErrorResponse that contains error message with error code + internal static ErrorResponse ValidateClientInformation(Client client, int methodNumber) + { + ErrorResponse errorResponse = new ErrorResponse(); + if (string.IsNullOrWhiteSpace(client.Url)) + { + errorResponse.ErrorCode = ErrorSettings.IncorrectInputClientUrlCode; + errorResponse.Message = ErrorSettings.IncorrectInputClientUrlMessage; + } + //else if (int.Parse(ConstantStrings.ProvisionMatterCreateMatter, CultureInfo.InvariantCulture) == methodNumber || + // int.Parse(ConstantStrings.ProvisionMatterAssignContentType, CultureInfo.InvariantCulture) == methodNumber || + // int.Parse(ConstantStrings.ProvisionMatterUpdateMetadataForList, CultureInfo.InvariantCulture) == methodNumber) + //{ + // if (string.IsNullOrWhiteSpace(client.Id)) + // { + // result = string.Format(CultureInfo.InvariantCulture, ConstantStrings.ServiceResponse, + // TextConstants.IncorrectInputClientIdCode, TextConstants.IncorrectInputClientIdMessage); + // } + // else if (string.IsNullOrWhiteSpace(client.Name)) + // { + // result = string.Format(CultureInfo.InvariantCulture, + // ConstantStrings.ServiceResponse, TextConstants.IncorrectInputClientNameCode, + // TextConstants.IncorrectInputClientNameMessage); + // } + //} + return errorResponse; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xml new file mode 100644 index 00000000..cac7d1b3 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xml @@ -0,0 +1,145 @@ + + + + Microsoft.Legal.MatterCenter.Service + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + + + + + + + + Document Controller class deals with finding document, pinning document, unpinning the document etc. + + + + + Constructor where all the required dependencies are injected + + + + + + + + + + Gets the matters based on search criteria. + + + searchResponseVM + + + + Returns document and list GUID + + Request object containing SharePoint App Token + Client object containing list data + Document and list GUID + + + + Matter Controller class deals with matter provisioning, finding matter, pinning matter, unpinning the matterm, updating the matter + + + + + Constructor where all the required dependencies are injected + + + + + + + + + Gets the matters based on search criteria. + + + searchResponseVM + + + + Constructor where all the required dependencies are injected + + + + + + + + + Returns true or false based on the existence of the matter landing page and OneNote file at the URLs provided. + + Request object containing SharePoint App Token + Client object containing Client data + String object containing the OneNote file path + String object containing the Matter Landing Page file path + $|$ Separated string indicating that the OneNote and the Matter Landing Page exist or not + + + + Taxonomy Controller will read the term store information related to matter center + + + + + Constructor where all the required dependencies are injected + + + + + + + + + + + This is test method for testing the contrroller + + + + + + This class will be used to validate the client input values + + + + + This method will validate the client object and if there are any errors in the client inout object, the method will + return ErrorResponse object or it will return null + + Contains the information such as ClientId, ClientUrl etc + ErrorResponse + + + + Function to validate client information + + Client object + Number indicating which method needs to be validated + ErrorResponse that contains error message with error code + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xproj new file mode 100644 index 00000000..81083d33 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service.xproj @@ -0,0 +1,24 @@ + + + + C:\Temp\Publish + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + adc8b0e8-de2b-46b2-9168-7e240dfd7e55 + Microsoft.Legal.MatterCenter.Service + ..\artifacts\obj\$(MSBuildProjectName) + ..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + True + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/AuthorizationMiddleware.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/AuthorizationMiddleware.cs new file mode 100644 index 00000000..20d897ab --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/AuthorizationMiddleware.cs @@ -0,0 +1,68 @@ +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Http; +using Microsoft.Legal.MatterCenter.Models; +using Newtonsoft.Json; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Cryptography; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public class AuthorizationMiddleware + { + private readonly RequestDelegate _next; + + public AuthorizationMiddleware(RequestDelegate next) + { + _next = next; + } + + public async Task Invoke(HttpContext context) + { + if(!context.Request.Headers.Keys.Contains("Authorization")) + { + var response = new ErrorResponse() + { + Message = "UnAuthorized", + Description = "The request object doesnot contain any authorization header", + ErrorCode = "401", + IsTokenValid = false + }; + string message = JsonConvert.SerializeObject(response); + context.Response.StatusCode = 401; + await context.Response.WriteAsync(message); + return; + } + string authorization = context.Request.Headers["Authorization"]; + if(!ValidateToken(authorization)) + { + var response = new ErrorResponse() + { + Message = "UnAuthorized", + Description = "The authorization header contains invalid token", + ErrorCode = "401", + IsTokenValid = false + }; + string message = JsonConvert.SerializeObject(response); + context.Response.StatusCode = 401; + await context.Response.WriteAsync(message); + return; + } + await _next.Invoke(context); + } + + private bool ValidateToken(string accessToken) + { + var authBits = accessToken.Split(' '); + if (authBits.Length != 2) + { + return false; + } + if (!authBits[0].ToLowerInvariant().Equals("bearer")) + { + return false; + } + return true; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/MiddlewareExtensions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/MiddlewareExtensions.cs new file mode 100644 index 00000000..46ec4d95 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Middleware/MiddlewareExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNet.Builder; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Service +{ + public static class MiddlewareExtensions + { + public static IApplicationBuilder UseAuthorizationMiddleware(this IApplicationBuilder builder) + { + return builder.UseMiddleware(); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2)-publish.ps1 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2)-publish.ps1 new file mode 100644 index 00000000..f0ce7211 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2)-publish.ps1 @@ -0,0 +1,101 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties, $packOutput, $nugetUrl) + +# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 +$publishModuleVersion = '1.0.1' +function Get-VisualStudio2015InstallPath{ + [cmdletbinding()] + param() + process{ + $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', + 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' + ) + [string]$vsInstallPath=$null + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) + } + + if($vsInstallPath){ + break; + } + } + + $vsInstallPath + } +} + +$vsInstallPath = Get-VisualStudio2015InstallPath +$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion + +if(!(Test-Path $publishModulePath)){ + $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion +} + +$defaultPublishSettings = New-Object psobject -Property @{ + LocalInstallDir = $publishModulePath +} + +function Enable-PackageDownloader{ + [cmdletbinding()] + param( + $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", + $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 + process{ + if(get-module package-downloader){ + remove-module package-downloader | Out-Null + } + + if(!(get-module package-downloader)){ + if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } + + $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') + if(!(Test-Path $expectedPath)){ + 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose + (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) + } + + if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} + + 'importing module [{0}]' -f $expectedPath | Write-Output + Import-Module $expectedPath -DisableNameChecking -Force + } + } +} + +function Enable-PublishModule{ + [cmdletbinding()] + param() + process{ + if(get-module publish-module){ + remove-module publish-module | Out-Null + } + + if(!(get-module publish-module)){ + $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' + if(Test-Path $localpublishmodulepath){ + 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose + Import-Module $localpublishmodulepath -DisableNameChecking -Force + $true + } + } + } +} + +try{ + + if (!(Enable-PublishModule)){ + Enable-PackageDownloader + Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl + } + + 'Calling Publish-AspNet' | Write-Verbose + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2).pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2).pubxml new file mode 100644 index 00000000..683f557c --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy (2).pubxml @@ -0,0 +1,34 @@ + + + + + MSDeploy + AzureWebSite + Release + Any CPU + https://mattercenterservicenew.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + mattercenterservicenew.scm.azurewebsites.net:443 + mattercenterservicenew + + True + WMSVC + True + $mattercenterservicenew + <_SavePWD>True + <_DestinationType>AzureWebSite + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy-publish.ps1 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy-publish.ps1 new file mode 100644 index 00000000..f0ce7211 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy-publish.ps1 @@ -0,0 +1,101 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties, $packOutput, $nugetUrl) + +# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 +$publishModuleVersion = '1.0.1' +function Get-VisualStudio2015InstallPath{ + [cmdletbinding()] + param() + process{ + $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', + 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' + ) + [string]$vsInstallPath=$null + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) + } + + if($vsInstallPath){ + break; + } + } + + $vsInstallPath + } +} + +$vsInstallPath = Get-VisualStudio2015InstallPath +$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion + +if(!(Test-Path $publishModulePath)){ + $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion +} + +$defaultPublishSettings = New-Object psobject -Property @{ + LocalInstallDir = $publishModulePath +} + +function Enable-PackageDownloader{ + [cmdletbinding()] + param( + $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", + $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 + process{ + if(get-module package-downloader){ + remove-module package-downloader | Out-Null + } + + if(!(get-module package-downloader)){ + if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } + + $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') + if(!(Test-Path $expectedPath)){ + 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose + (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) + } + + if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} + + 'importing module [{0}]' -f $expectedPath | Write-Output + Import-Module $expectedPath -DisableNameChecking -Force + } + } +} + +function Enable-PublishModule{ + [cmdletbinding()] + param() + process{ + if(get-module publish-module){ + remove-module publish-module | Out-Null + } + + if(!(get-module publish-module)){ + $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' + if(Test-Path $localpublishmodulepath){ + 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose + Import-Module $localpublishmodulepath -DisableNameChecking -Force + $true + } + } + } +} + +try{ + + if (!(Enable-PublishModule)){ + Enable-PackageDownloader + Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl + } + + 'Calling Publish-AspNet' | Write-Verbose + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy.pubxml new file mode 100644 index 00000000..bfedf5a5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicenew - Web Deploy.pubxml @@ -0,0 +1,35 @@ + + + + + MSDeploy + AzureWebSite + Debug + Any CPU + https://mattercenterservicenew.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + mattercenterservicenew.scm.azurewebsites.net:443 + mattercenterservicenew + + True + WMSVC + True + $mattercenterservicenew + <_SavePWD>True + <_DestinationType>AzureWebSite + False + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP (2).pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP (2).pubxml new file mode 100644 index 00000000..ca5eb9c6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP (2).pubxml @@ -0,0 +1,31 @@ + + + + + FTP + AzureWebSite + Release + Any CPU + http://mattercenterservicewebapi.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + ftp://waws-prod-bay-019.ftp.azurewebsites.windows.net + False + True + site/wwwroot + mattercenterservicewebapi\$mattercenterservicewebapi + <_SavePWD>True + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP.pubxml new file mode 100644 index 00000000..ca5eb9c6 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - FTP.pubxml @@ -0,0 +1,31 @@ + + + + + FTP + AzureWebSite + Release + Any CPU + http://mattercenterservicewebapi.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + ftp://waws-prod-bay-019.ftp.azurewebsites.windows.net + False + True + site/wwwroot + mattercenterservicewebapi\$mattercenterservicewebapi + <_SavePWD>True + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2)-publish.ps1 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2)-publish.ps1 new file mode 100644 index 00000000..f0ce7211 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2)-publish.ps1 @@ -0,0 +1,101 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties, $packOutput, $nugetUrl) + +# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 +$publishModuleVersion = '1.0.1' +function Get-VisualStudio2015InstallPath{ + [cmdletbinding()] + param() + process{ + $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', + 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' + ) + [string]$vsInstallPath=$null + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) + } + + if($vsInstallPath){ + break; + } + } + + $vsInstallPath + } +} + +$vsInstallPath = Get-VisualStudio2015InstallPath +$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion + +if(!(Test-Path $publishModulePath)){ + $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion +} + +$defaultPublishSettings = New-Object psobject -Property @{ + LocalInstallDir = $publishModulePath +} + +function Enable-PackageDownloader{ + [cmdletbinding()] + param( + $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", + $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 + process{ + if(get-module package-downloader){ + remove-module package-downloader | Out-Null + } + + if(!(get-module package-downloader)){ + if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } + + $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') + if(!(Test-Path $expectedPath)){ + 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose + (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) + } + + if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} + + 'importing module [{0}]' -f $expectedPath | Write-Output + Import-Module $expectedPath -DisableNameChecking -Force + } + } +} + +function Enable-PublishModule{ + [cmdletbinding()] + param() + process{ + if(get-module publish-module){ + remove-module publish-module | Out-Null + } + + if(!(get-module publish-module)){ + $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' + if(Test-Path $localpublishmodulepath){ + 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose + Import-Module $localpublishmodulepath -DisableNameChecking -Force + $true + } + } + } +} + +try{ + + if (!(Enable-PublishModule)){ + Enable-PackageDownloader + Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl + } + + 'Calling Publish-AspNet' | Write-Verbose + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2).pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2).pubxml new file mode 100644 index 00000000..aaf0814a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy (2).pubxml @@ -0,0 +1,35 @@ + + + + + MSDeploy + False + AzureWebSite + Debug + Any CPU + https://mattercenterservicewebapi.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + mattercenterservicewebapi.scm.azurewebsites.net:443 + mattercenterservicewebapi + + True + WMSVC + True + $mattercenterservicewebapi + <_SavePWD>True + <_DestinationType>AzureWebSite + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy-publish.ps1 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy-publish.ps1 new file mode 100644 index 00000000..f0ce7211 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy-publish.ps1 @@ -0,0 +1,101 @@ +[cmdletbinding(SupportsShouldProcess=$true)] +param($publishProperties, $packOutput, $nugetUrl) + +# to learn more about this file visit http://go.microsoft.com/fwlink/?LinkId=524327 +$publishModuleVersion = '1.0.1' +function Get-VisualStudio2015InstallPath{ + [cmdletbinding()] + param() + process{ + $keysToCheck = @('hklm:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Microsoft\VisualStudio\14.0', + 'hklm:\SOFTWARE\Wow6432Node\Microsoft\VWDExpress\14.0', + 'hklm:\SOFTWARE\Microsoft\VWDExpress\14.0' + ) + [string]$vsInstallPath=$null + + foreach($keyToCheck in $keysToCheck){ + if(Test-Path $keyToCheck){ + $vsInstallPath = (Get-itemproperty $keyToCheck -Name InstallDir -ErrorAction SilentlyContinue | select -ExpandProperty InstallDir -ErrorAction SilentlyContinue) + } + + if($vsInstallPath){ + break; + } + } + + $vsInstallPath + } +} + +$vsInstallPath = Get-VisualStudio2015InstallPath +$publishModulePath = "{0}Extensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion + +if(!(Test-Path $publishModulePath)){ + $publishModulePath = "{0}VWDExpressExtensions\Microsoft\Web Tools\Publish\Scripts\{1}\" -f $vsInstallPath, $publishModuleVersion +} + +$defaultPublishSettings = New-Object psobject -Property @{ + LocalInstallDir = $publishModulePath +} + +function Enable-PackageDownloader{ + [cmdletbinding()] + param( + $toolsDir = "$env:LOCALAPPDATA\Microsoft\Web Tools\Publish\package-downloader-$publishModuleVersion\", + $pkgDownloaderDownloadUrl = 'http://go.microsoft.com/fwlink/?LinkId=524325') # package-downloader.psm1 + process{ + if(get-module package-downloader){ + remove-module package-downloader | Out-Null + } + + if(!(get-module package-downloader)){ + if(!(Test-Path $toolsDir)){ New-Item -Path $toolsDir -ItemType Directory -WhatIf:$false } + + $expectedPath = (Join-Path ($toolsDir) 'package-downloader.psm1') + if(!(Test-Path $expectedPath)){ + 'Downloading [{0}] to [{1}]' -f $pkgDownloaderDownloadUrl,$expectedPath | Write-Verbose + (New-Object System.Net.WebClient).DownloadFile($pkgDownloaderDownloadUrl, $expectedPath) + } + + if(!$expectedPath){throw ('Unable to download package-downloader.psm1')} + + 'importing module [{0}]' -f $expectedPath | Write-Output + Import-Module $expectedPath -DisableNameChecking -Force + } + } +} + +function Enable-PublishModule{ + [cmdletbinding()] + param() + process{ + if(get-module publish-module){ + remove-module publish-module | Out-Null + } + + if(!(get-module publish-module)){ + $localpublishmodulepath = Join-Path $defaultPublishSettings.LocalInstallDir 'publish-module.psm1' + if(Test-Path $localpublishmodulepath){ + 'importing module [publish-module="{0}"] from local install dir' -f $localpublishmodulepath | Write-Verbose + Import-Module $localpublishmodulepath -DisableNameChecking -Force + $true + } + } + } +} + +try{ + + if (!(Enable-PublishModule)){ + Enable-PackageDownloader + Enable-NuGetModule -name 'publish-module' -version $publishModuleVersion -nugetUrl $nugetUrl + } + + 'Calling Publish-AspNet' | Write-Verbose + # call Publish-AspNet to perform the publish operation + Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput +} +catch{ + "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy.pubxml new file mode 100644 index 00000000..cb224594 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/PublishProfiles/mattercenterservicewebapi - Web Deploy.pubxml @@ -0,0 +1,35 @@ + + + + + MSDeploy + False + AzureWebSite + Debug + Any CPU + https://mattercenterservicewebapi.azurewebsites.net + True + False + False + <_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-update1 + True + web + wwwroot + wwwroot + False + False + False + mattercenterservicewebapi.scm.azurewebsites.net:443 + mattercenterservicewebapi + + False + WMSVC + True + $mattercenterservicewebapi + <_SavePWD>True + <_DestinationType>AzureWebSite + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/launchSettings.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/launchSettings.json new file mode 100644 index 00000000..0caa1918 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:58775/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchUrl": "api/values", + "environmentVariables": { + "Hosting:Environment": "Development" + } + }, + "web": { + "commandName": "web", + "environmentVariables": { + "Hosting:Environment": "Development" + } + } + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.Designer.cs new file mode 100644 index 00000000..be4af73f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Legal.MatterCenter.Service { + using System; + using System.Reflection; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Service { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + internal Service() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.Service.Service", typeof(Service).GetTypeInfo().Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.resx new file mode 100644 index 00000000..4fdb1b6a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Service.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Startup.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Startup.cs new file mode 100644 index 00000000..f3508baa --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/Startup.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Swashbuckle.SwaggerGen; +using Microsoft.Extensions.PlatformAbstractions; +using Newtonsoft.Json.Serialization; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json; +using System.Net; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.Authentication.JwtBearer; + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Service; +using Microsoft.Legal.MatterCenter.Service.Filters; +using System.Globalization; +#endregion + +namespace Microsoft.Legal.MatterCenter.Service +{ + public class Startup + { + + #region Properties + public IHostingEnvironment HostingEnvironment { get; } + public ILoggerFactory LoggerFactory { get; } + public IConfigurationRoot Configuration { get; set; } + public IApplicationEnvironment ApplicationEnvironment { get; } + #endregion + + + public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv, ILoggerFactory logger) + { + this.HostingEnvironment = env; + this.ApplicationEnvironment = appEnv; + this.LoggerFactory = logger; + } + + public void ConfigureServices(IServiceCollection services) + { + // Set up configuration sources. + var builder = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .AddEnvironmentVariables(); + Configuration = builder.Build(); + ConfigureSettings(services); + services.AddCors(); + services.AddLogging(); + ConfigureMvc(services, LoggerFactory); + // Add framework services. + services.AddMvc(); + ConfigureMatterPackages(services); + ConfigureSwagger(services); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + /// + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + var log = loggerFactory.CreateLogger(); + try + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + app.UseDeveloperExceptionPage(); + app.UseIISPlatformHandler(); + CheckAuthorization(app); + app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); + app.UseMvc(); + app.UseSwaggerGen(); + app.UseSwaggerUi(); + } + catch (Exception ex) + { + app.Run( + async context => { + log.LogError($"{ex.Message}"); + context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; + context.Response.ContentType = "text/plain"; + await context.Response.WriteAsync(ex.Message).ConfigureAwait(false); + await context.Response.WriteAsync(ex.StackTrace).ConfigureAwait(false); + }); + + } + } + + // Entry point for the application. + public static void Main(string[] args) => WebApplication.Run(args); + + #region Private Methods + + #region Swagger + private string pathToDoc = "Microsoft.Legal.MatterCenter.Service.xml"; + + private void ConfigureSwagger(IServiceCollection services) + { + services.AddSwaggerGen(); + services.ConfigureSwaggerDocument(options => { + options.SingleApiVersion(new Info + { + Version = "v1", + Title = "Matter Center API Version V1", + Description = "This matter center api is for V1 release" + }); + options.IgnoreObsoleteActions = true; + options.OperationFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlActionComments(pathToDoc)); + + }); + + services.ConfigureSwaggerSchema(options => + { + options.DescribeAllEnumsAsStrings = true; + options.IgnoreObsoleteProperties = true; + options.ModelFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlTypeComments(pathToDoc)); + + }); + } + + + #endregion + + private void ConfigureMvc(IServiceCollection services, ILoggerFactory logger) + { + var builder = services.AddMvc().AddDataAnnotationsLocalization(); + builder.AddJsonOptions(o => { + o.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + o.SerializerSettings.Converters.Add(new StringEnumConverter()); + o.SerializerSettings.Formatting = Formatting.Indented; + }); + + //builder.AddMvcOptions(o => { o.Filters.Add(new MatterCenterFilter(logger)); }); + builder.AddMvcOptions(o => { o.Filters.Add(new MatterCenterExceptionFilter(logger)); }); + } + + + private void ConfigureSettings(IServiceCollection services) + { + services.Configure(this.Configuration.GetSection("General")); + services.Configure(this.Configuration.GetSection("Taxonomy")); + services.Configure(this.Configuration.GetSection("Matter")); + services.Configure(this.Configuration.GetSection("Document")); + services.Configure(this.Configuration.GetSection("Shared")); + services.Configure(this.Configuration.GetSection("Mail")); + services.Configure(this.Configuration.GetSection("ErrorMessages")); + services.Configure(this.Configuration.GetSection("ListNames")); + services.Configure(this.Configuration.GetSection("LogTables")); + services.Configure(this.Configuration.GetSection("Search")); + services.Configure(this.Configuration.GetSection("CamlQueries")); + services.Configure(this.Configuration.GetSection("Mail")); + } + + private void ConfigureMatterPackages(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + + private void CheckAuthorization(IApplicationBuilder app) + { + app.UseJwtBearerAuthentication(options => + { + options.AutomaticAuthenticate = true; + options.Authority = String.Format(CultureInfo.InvariantCulture, + this.Configuration.GetSection("General").GetSection("AADInstance").Value.ToString(), + this.Configuration.GetSection("General").GetSection("Tenant").Value.ToString()); + options.Audience = this.Configuration.GetSection("General").GetSection("ClientId").Value.ToString(); + options.Events = new JwtBearerEvents + { + OnAuthenticationFailed = context => { + return Task.FromResult(0); + }, + OnValidatedToken = context => { + return Task.FromResult(0); + } + }; + }); + } + #endregion + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/appsettings.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/appsettings.json new file mode 100644 index 00000000..06689b6b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/appsettings.json @@ -0,0 +1,259 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Verbose", + "System": "Information", + "Microsoft": "Information" + } + }, + "Matter": { + "ProvisionMatterAppURL": "https://svalli.sharepoint.com/sites/Catalog/MatterCenter", + "CentralRepositoryUrl": "https://svalli.sharepoint.com/sites/Catalog", + "EditMatterAllowedPermissionLevel": "Full Control", + "ColumnNameGuid": "GUID", + "RoleListColumnRoleName": "RoleName", + "RoleListColumnIsRoleMandatory": "Mandatory", + "OneNoteLibrarySuffix": "_OneNote", + "CalendarNameSuffix": "_Calendar", + "TaskNameSuffix": "_Task", + "SendMailListName": "SendMail", + "SpecialCharacterExpressionMatterTitle": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*", + "SpecialCharacterExpressionMatterId": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*", + "SpecialCharacterExpressionMatterDescription": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*,", + "SpecialCharacterExpressionContentType": "[@\\/:*?#%<>{}|~&\"]", + "MatterIdLength": "75", + "MatterNameLength": "75", + "ContentTypeLength": "128", + "MatterDescriptionLength": "255", + "UserPermissions": "Contribute,Full Control,Read", + "MatterLandingPageRepositoryName": "Site Pages", + "StampedPropertyMatterGUID": "MatterGUID", + "StampedPropertyMatterCenterUsers": "MatterCenterUsers", + "StampedPropertyMatterCenterPermissions": "MatterCenterPermissions", + "StampedPropertyMatterCenterRoles": "MatterCenterRoles", + "StampedPropertyResponsibleAttorney": "ResponsibleAttorney", + "StampedPropertyTeamMembers": "TeamMembers", + "StampedPropertyBlockedUploadUsers": "", + "StampedPropertyPracticeGroup": "PracticeGroup", + "StampedPropertyAreaOfLaw": "AreaOfLaw", + "StampedPropertySubAreaOfLaw": "SubAreaOfLaw", + "StampedPropertyMatterName": "MatterName", + "StampedPropertyMatterID": "MatterID", + "StampedPropertyClientName": "ClientName", + "StampedPropertyClientID": "ClientID", + "StampedPropertyIsMatter": "IsMatter", + "StampedPropertyOpenDate": "OpenDate", + "StampedPropertySecureMatter": "SecureMatter", + "StampedPropertyMatterDescription": "MatterDescription", + "StampedPropertyConflictCheckDate": "MatterConflictCheckDate", + "StampedPropertyConflictCheckBy": "MatterConflictCheckBy", + "StampedPropertyDefaultContentType": "MatterCenterDefaultContentType", + "StampedPropertyIsConflictIdentified": "IsConflictIdentified", + "StampedPropertyDocumentTemplateCount": "DocumentTemplateCount", + "StampedPropertyBlockedUsers": "BlockedUsers", + "StampedPropertySuccess": "Success", + "PropertyNameVtiIndexedPropertyKeys": "vti_indexedpropertykeys", + "ValidDateFormat": "yyyy-MM-ddTHH:mm:ssZ", + "MatterCenterDateFormat": "MMM dd, yyyy", + "ShareListColumnMatterPath": "MatterPath", + "ShareListColumnMailList": "MailList", + "DeleteMatterCode": "0", + "MatterDeletedSuccessfully": "Matter is deleted successfully", + "MatterNotPresent": "Matter library not found while deleting" + }, + "Taxonomy": { + "PracticeGroupTermSetName": "Practice Groups", + "ClientTermSetName": "Clients", + "PracticeGroupCustomPropertyFolderNames": "FolderNames", + "AreaCustomPropertyFolderNames": "FolderNames", + "SubAreaCustomPropertyFolderNames": "FolderNames", + "SubAreaCustomPropertyisNoFolderStructurePresent": "isNoFolderStructurePresent", + "SubAreaOfLawDocumentTemplates": "DocumentTemplates", + "ClientCustomPropertiesId": "ClientID", + "IsReadOnlyUser": "" + }, + "Document": { + + }, + "Shared": { + "MatterCenterPages": "AppLandingPage;SearchMatter;SearchDocument;WebDashboard;ProvisionMatter", + + "ContextualHelpLinksColumnLinkOrder": "LinkOrder", + "ContextualHelpLinksColumnLinkTitle": "LinkTitle0", + "ContextualHelpLinksColumnLinkURL": "LinkURL", + "ContextualHelpLinksColumnSectionID": "SectionID", + + "ContextualHelpSectionColumnSectionID": "SectionID", + "ContextualHelpSectionColumnPageName": "PageName", + "ContextualHelpSectionColumnNumberOfColumns": "NumberOfColumns", + "ContextualHelpSectionColumnSectionOrder": "SectionOrder", + "ContextualHelpSectionColumnSectionTitle": "SectionTitle" + }, + "General": { + "ClientId": "f9fdee20-9341-410e-9522-f168381a943b", + "AppKey": "JiBcoUWdJs+QL2ikV6wR15azco3TuW/DmW3vYaEQbjM=", + "Tenant": "microsoft.onmicrosoft.com", + "AADInstance": "https://login.windows.net/{0}", + "Resource": "https://microsoft.sharepoint.com", + "RedisCacheHostName": "svalliMatterCenterCache.redis.cache.windows.net:6380,password=pmRjdS/6DAZJvhp80xgLtGZEKh0ap0cgm97VR9AubXY=,ssl=True,abortConnect=False", + "IsTenantDeployment": false + }, + "ClientCredentials": { + "ClientId": "844ffb77-5bfd-403e-9285-678e2eddc90c", + "ClientSecret": "IAKt/4uoQFM0UJ1Ocj//WHOg1RzLspACzPAKkkPP0kw=", + "ClientResource": "https://microsoft.onmicrosoft.com/mcuiadal", + "Authority": "https://login.windows.net/microsoft.onmicrosoft.com" + }, + "CamlQueries": { + "UserPinnedDetailsQuery": "{1}", + "AllFoldersQuery": "{0}1", + "RetrieveContextualHelpSectionsQuery": "{0}", + "ContextualHelpQueryIncludeOrCondition": "{1};{0}", + "RetrieveContextualHelpLinksQuery": "{0}", + "DMSRoleQuery": "", + "MatterConfigurationsListQuery": "" + }, + + "Search": { + "SearchResultSourceID": "da4d1945-11da-4c11-9282-b9f3c27b61ae", + "ManagedPropertyTitle": "MCAreaofLaw", + "ManagedPropertyName": "Name", + "ManagedPropertyDescription": "Description", + "ManagedPropertySiteName": "SiteName", + "ManagedPropertyLastModifiedTime": "LastModifiedTime", + "ManagedPropertyPracticeGroup": "MCPracticeGroup", + "ManagedPropertyAreaOfLaw": "MCAreaofLaw", + "ManagedPropertySubAreaOfLaw": "MCSubAreaofLaw", + "ManagedPropertyMatterId": "MCMatterID", + "ManagedPropertyCustomTitle": "RefinableString10", + "ManagedPropertyPath": "Path", + "ManagedPropertyMatterName": "MCMatterName", + "ManagedPropertyOpenDate": "MCOpenDate", + "ManagedPropertyClientName": "MCClientName", + "ManagedPropertyBlockedUploadUsers": "MCBlockedUploadUser", + "ManagedPropertyResponsibleAttorney": "MCResponsibleAttorney", + "ManagedPropertyClientID": "MCClientID", + "ManagedPropertyMatterGuidLogging": "", + "ManagedPropertyTeamMembers": "MCTeamMembers", + "ManagedPropertyFileName": "FileName", + "ManagedPropertyDocumentCheckOutUser": "", + "ManagedPropertyCreated": "MCCheckoutUser", + "ManagedPropertyMatterGuid": "", + "ManagedPropertyIsMatter": "", + "ManagedPropertyDocumentLastModifiedTime": "", + "FindDocumentInvalidExtensions": "", + "ManagedPropertyAuthor": "", + "ManagedPropertyDocumentClientId": "", + "ManagedPropertyDocumentMatterId": "", + "ManagedPropertyDocumentClientName": "", + "ManagedPropertyUIVersionStringOWSTEXT": "", + "ManagedPropertyServerRelativeUrl": "", + "ManagedPropertyFileExtension": "", + "ManagedPropertySiteTitle": "", + "ManagedPropertyDocumentMatterName": "", + "ManagedPropertyDocumentId": "", + "ManagedPropertyCheckOutByUser": "", + "ManagedPropertySPWebUrl": "", + "ManagedPropertyDocumentVersion": "", + "PinnedListColumnUserAlias": "UserAlias", + "PinnedListColumnMatterDetails": "UserPinDetails", + "PinnedListColumnDocumentDetails": "UserPinDocumentDetails", + "ColumnNameFileLeafRef": "FileLeafRef", + "ColumnNameFileRef": "FileRef", + "ColumnNameFileDirRef": "FileDirRef", + "UserPermissions": "Contribute,Full Control,Read", + "PeoplePickerAllowMultipleEntities": false, + "PeoplePickerMaximumEntitySuggestions": 500, + "PeoplePickerMaxRecords": 30, + "MatterConfigurationTitleValue": "Matter Configurations", + "ColumnNameModifiedDate": "Modified", + "MatterConfigurationColumn": "ConfigurationValue" + + }, + "Mail": { + "MatterMailBodyMatterInformation": "
Matter Information:
Client Name: {0}
Client ID: {1}
Matter Name: {2}
Matter ID: {3}
Matter Description: {4}
Matter Type: {5}
", + "MatterMailDefaultContentTypeHtmlChunk": "<span style='font-weight: 600;'>{0}</span>", + "MatterMailSubject": "New Matter: {0} | {1} is provisioned by {2}", + "ShareListColumnMailBody": "MailBody", + "ShareListColumnMailSubject": "MailSubject", + "MatterMailBodyConflictCheck": "", + "MatterMailBodyTeamMembers": "" + }, + "ErrorMessages": { + + "AuthorizationLengthError": "Authorization token array length must be 2", + "NoBearerStringPresent": "Authorization token doesnot contain text of type 'Bearer", + "MessageNoInputs": "No Inputs", + "MessageNoResult": "No data found for the given input criteria", + "PeoplePickerNoResults": "No results found", + "UserNotSiteOwnerCode": 128, + "UserNotSiteOwnerMessage": "You do not have permission to create matter for this client", + "IncorrectInputClientUrlCode": "101", + "IncorrectInputClientUrlMessage": "Incorrect Inputs", + "IncorrectInputClientIdCode": "102", + "IncorrectInputClientIdMessage": "Incorrect Inputs", + "IncorrectInputClientNameCode": "103", + "IncorrectInputClientNameMessage": "Incorrect Inputs", + "IncorrectInputUserAccessCode": "127", + "IncorrectInputUserAccessMessage": "Incorrect Inputs", + "IncorrectInputMatterNameCode": "108", + "IncorrectInputMatterNameMessage": "Incorrect Inputs", + "IncorrectInputMatterIdCode": "109", + "IncorrectInputMatterIdMessage": "Incorrect Inputs", + "IncorrectInputMatterDescriptionCode": "113", + "IncorrectInputMatterDescriptionMessage": "Incorrect Inputs", + "IncorrectInputConflictDateCode": "114", + "IncorrectInputConflictDateMessage": "Incorrect Inputs", + "IncorrectInputConflictIdentifiedCode": "115", + "IncorrectInputConflictIdentifiedMessage": "Incorrect Inputs", + "IncorrectInputBlockUserNamesCode": "118", + "IncorrectInputBlockUserNamesMessage": "Incorrect Inputs", + "IncorrectInputConflictCheckByCode": "117", + "IncorrectInputConflictCheckByMessage": "Incorrect Inputs", + "IncorrectInputUserRolesCode": "116", + "IncorrectInputUserRolesMessage": "Incorrect Inputs", + "IncorrectInputUserNamesCode": "110", + "IncorrectInputUserNamesMessage": "Incorrect Inputs", + "IncorrectInputUserPermissionsCode": "111", + "IncorrectInputUserPermissionsMessage": "Incorrect Inputs", + "IncorrectInputContentTypeCode": "112", + "IncorrectInputContentTypeMessage": "Incorrect Inputs", + "ErrorEditMatterMandatoryPermission": "Please provide at least one user who has Full Control permission on this matter.", + "IncorrectInputPracticeGroupCode": "104", + "IncorrectInputPracticeGroupMessage": "Incorrect Inputs", + "IncorrectInputAreaOfLawCode": "105", + "IncorrectInputAreaOfLawMessage": "Incorrect Inputs", + "IncorrectInputSubareaOfLawCode": "106", + "IncorrectInputSubareaOfLawMessage": "Incorrect Inputs", + "IncorrectInputResponsibleAttorneyCode": "107", + "IncorrectInputResponsibleAttorneyMessage": "Incorrect Inputs", + "ErrorCodeSecurityGroupExists": "125", + "ErrorMessageSecurityGroupExists": "Security Groups are not allowed for matters where conflicts are identified. Remove all Security Groups to proceed.", + "IncorrectTeamMembersCode": "126", + "IncorrectTeamMembersMessage": "Please enter valid team members.", + "IncorrectInputSelfPermissionRemoval": "124", + "MatterLibraryExistsCode": "201", + "ErrorDuplicateMatter": "Please enter a different Matter name. A matter with same name already exists." + + }, + "ListNames": { + "SendMailListName": "SendMail", + "UserPinnedDocumentListName": "UserPinnedDetails", + "UserPinnedMatterListName": "UserPinnedMatter", + "MatterCenterHelpSectionListName": "MatterCenterHelpSection", + "MatterCenterHelpLinksListName": "MatterCenterHelpLinks", + "DMSRoleListName": "MatterCenterRoles", + "MatterConfigurationsList": "Matter Configurations" + }, + "LogTables": { + "ServiceLogTable": "MatterCenterLogStorage", + "SPOLogTable": "SPOLogTable", + "EventViewerSource": "LCADMS", + "EventViewerEventID": "1001", + "EventViewerLogName": "LCADMS", + "CloudStorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=mattercenterpoc;AccountKey=1/kddThixWPz8GcTilf5uM1bzKrYPqwoCikAFkMCu7BnUCRj1+Itnt8e89hCveUdDtDytQ7gXHxkiuXuZj5sVg==", + "AzureRowKeyDateFormat": "MM-dd-yyyy HH:mm:ss:fffffff", + "IsLoggingOnAzure": true + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/project.json new file mode 100644 index 00000000..425ed44f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/project.json @@ -0,0 +1,45 @@ +{ + "version": "1.0.0-*", + "compilationOptions": { + "emitEntryPoint": true + }, + + "dependencies": { + "Microsoft.AspNet.Authentication.JwtBearer": "1.0.0-rc1-final", + "Microsoft.AspNet.Cors": "6.0.0-rc1-final", + "Microsoft.AspNet.Hosting": "1.0.0-rc1-final", + "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final", + "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", + "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", + "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final", + "Swashbuckle.SwaggerGen": "6.0.0-rc1-final", + "Swashbuckle.SwaggerUi": "6.0.0-rc1-final", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", + "Microsoft.AspNet.Authentication": "1.0.0-rc1-final", + "Microsoft.Legal.MatterCenter.Utility": "1.0.0-*", + "Microsoft.Legal.MatterCenter.Models": "1.0.0-*", + "Microsoft.Legal.MatterCenter.Repository": "1.0.0-*", + "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final" + }, + + "commands": { + "web": "Microsoft.AspNet.Server.Kestrel" + }, + + "frameworks": { + "dnx451": { } + }, + + "exclude": [ + "wwwroot", + "node_modules" + ], + "publishExclude": [ + "**.user", + "**.vspscc" + ] +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/Microsoft.Legal.MatterCenter.Service.xml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/Microsoft.Legal.MatterCenter.Service.xml new file mode 100644 index 00000000..a1d0c33d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/Microsoft.Legal.MatterCenter.Service.xml @@ -0,0 +1,75 @@ + + + + Microsoft.Legal.MatterCenter.Service + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Taxonomy Controller will read the term store information related to matter center + + + + + Constructor where all the required dependencies are injected + + + + + + + + + + + This is test method for testing the contrroller + + + + + + This class will be used to validate the client input values + + + + + This method will validate the client object and if there are any errors in the client inout object, the method will + return ErrorResponse object or it will return null + + Contains the information such as ClientId, ClientUrl etc + ErrorResponse + + + + Function to validate client information + + Client object + Number indicating which method needs to be validated + ErrorResponse that contains error message with error code + + + + This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + + + + + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/web.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/web.config new file mode 100644 index 00000000..c669d707 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Service/wwwroot/web.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/CompositionRootFixture.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/CompositionRootFixture.cs new file mode 100644 index 00000000..0ffd4c01 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/CompositionRootFixture.cs @@ -0,0 +1,36 @@ + +using System; +using Microsoft.Extensions.Configuration; +using Microsoft.Legal.MatterCenter.ServiceTest.IntegrationTests; + + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + + public class CompositionRootFixture + { + + public IConfigurationRoot Configuratuion { get; } + + + public CompositionRootFixture() + { + string path = Environment.CurrentDirectory.Remove(Environment.CurrentDirectory.IndexOf("\\bin\\Debug\\net46\\win7-x64", 0), 25); + + var builder = new ConfigurationBuilder() + .SetBasePath(path) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddInMemoryCollection() + .AddEnvironmentVariables(); + ; + Configuratuion = builder.Build(); + + KeyVaultHelper keyVaultHelper = new KeyVaultHelper(Configuratuion); + KeyVaultHelper.GetCert(Configuratuion); + keyVaultHelper.GetKeyVaultSecretsCerticate(); + + } + + } + +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/KeyVaultHelper.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/KeyVaultHelper.cs new file mode 100644 index 00000000..02a9639e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Helpers/KeyVaultHelper.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Azure.KeyVault; +using Microsoft.IdentityModel.Clients.ActiveDirectory; +using Microsoft.Extensions.Configuration; +using System.Security.Cryptography.X509Certificates; + +namespace Microsoft.Legal.MatterCenter.ServiceTest.IntegrationTests +{ + public class KeyVaultHelper + { + + IConfigurationRoot Configuration; + public static ClientAssertionCertificate AssertionCert { get; set; } + + + /// + /// + /// + /// + public KeyVaultHelper(IConfigurationRoot configuration) + { + this.Configuration = configuration; + } + + /// + /// + /// + public void GetKeyVaultSecretsCerticate() + { + Dictionary keyValues = new Dictionary(); + keyValues = retrieveSecrets(true); + + + foreach (var ky in keyValues) + { + Configuration[ky.Key] = ky.Value; + } + } + + + /// + /// + /// + public void GetKeyVaultSecretsSecret() + { + Dictionary keyValues = new Dictionary(); + keyValues = retrieveSecrets(false); + + foreach (var ky in keyValues) + { + Configuration[ky.Key] = ky.Value; + } + } + + + + /// + /// + /// + /// + private Dictionary retrieveSecrets(bool cert) + { + Dictionary keyValues = new Dictionary(); + + KeyVaultClient kv; + + if (cert) + { + kv = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(GetAccessToken)); + + } + else + { + kv = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(GetToken)); + } + + + List secrets = new List(); + + var values = kv.GetSecretsAsync(this.Configuration.GetSection("General").GetSection("KeyVaultURI").Value.ToString()).GetAwaiter().GetResult(); + + + if (values != null && values.Value != null) + { + + foreach (var m in values.Value) + secrets.Add(m.Identifier.Name); + } + + while (values != null && !string.IsNullOrWhiteSpace(values.NextLink)) + { + values = kv.GetSecretsNextAsync(values.NextLink).GetAwaiter().GetResult(); + if (values != null && values.Value != null) + { + + foreach (var m in values.Value) + secrets.Add(m.Identifier.Name); + } + } + foreach (var value in secrets) + { + var secret = kv.GetSecretAsync(this.Configuration.GetSection("General").GetSection("KeyVaultURI").Value.ToString(), value).GetAwaiter().GetResult(); + keyValues.Add(value.Replace("-",":"), secret.Value); + } + + + return keyValues; + } + + + + + /// + /// + /// + /// Uses the Client Secret and ClientID to get a token to the AD + /// + /// + /// + /// + public async Task GetToken(string authority, string resource, string scope) + { + + var authContext = new AuthenticationContext(authority); + ClientCredential clientCred = new ClientCredential(Configuration.GetSection("General").GetSection("ClientId").Value.ToString(), + Configuration.GetSection("General").GetSection("AppKey").Value.ToString()); + AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred); + + if (result == null) + throw new InvalidOperationException("Failed to obtain the JWT token"); + + return result.AccessToken; + } + + + + /// + /// + /// + /// + public static void GetCert(IConfiguration configurtaion) + { + var clientAssertionCertPfx = CertificateHelper.FindCertificateByThumbprint(configurtaion["General:KeyVaultCertThumbPrint"].ToString()); + AssertionCert = new ClientAssertionCertificate(configurtaion["General:KeyVaultClientID"], clientAssertionCertPfx); + } + + /// + /// Uses the ClientId and Screet to get an AD tokenok + /// + /// + /// + /// + /// + /// + public static async Task GetAccessToken(string authority, string resource, string scope) + { + var context = new AuthenticationContext(authority, TokenCache.DefaultShared); + var result = await context.AcquireTokenAsync(resource, AssertionCert); + return result.AccessToken; + } + + public static class CertificateHelper + { + public static X509Certificate2 FindCertificateByThumbprint(string findValue) + { + // Deal with any extra special chars in thumbprint + string thumbprint = findValue.Replace("\u200e", string.Empty).Replace("\u200f", string.Empty).Replace(" ", string.Empty); + + X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); + try + { + store.Open(OpenFlags.ReadOnly); + X509Certificate2Collection col = store.Certificates.Find(X509FindType.FindByThumbprint, + thumbprint, false); // Don't validate certs, since the test root isn't installed. + if (col == null || col.Count == 0) + return null; + return col[0]; + } + finally + { + store.Close(); + } + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/HttpClientExtensions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/HttpClientExtensions.cs new file mode 100644 index 00000000..78edeb1d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/HttpClientExtensions.cs @@ -0,0 +1,36 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Formatting; +using System.Collections.Generic; +using System.Threading.Tasks; + + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public static class HttpClientExtensions + { + public static HttpClient AcceptJson(this HttpClient client) + { + client.DefaultRequestHeaders.Clear(); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + client.DefaultRequestHeaders.Add("Authorization", + "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJiOTRmMDdkZi1jODI1LTQzMWYtYjljNS1iOTQ5OWU4ZTlhYzEiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8zYzQ1NjJjYS0zOWE0LTRkOGItOTFmZi02ZDNlZWZhYjVjMWQvIiwiaWF0IjoxNDY3NzY3NDUxLCJuYmYiOjE0Njc3Njc0NTEsImV4cCI6MTQ2Nzc3MTM1MSwiYW1yIjpbInB3ZCJdLCJmYW1pbHlfbmFtZSI6IkdhamFybGEiLCJnaXZlbl9uYW1lIjoiV2lsc29uIiwiaXBhZGRyIjoiOTguMjQ3LjIxLjE2MiIsIm5hbWUiOiJXaWxzb24gR2FqYXJsYSIsIm5vbmNlIjoiMzk2NDUzYTUtZWQyNi00N2Q3LThiMGYtMGFmNTY5Njc4ZGM2Iiwib2lkIjoiOTMzY2UxZmQtMjY5My00YWFlLWI3YmEtMmEwYjY4ZTQxMDI5Iiwic3ViIjoia3FneXRMQ1JRUlVjUU1vaFBYQkVCSkhPZ052azRFV0tBTTBhM1VZaEdwUSIsInRpZCI6IjNjNDU2MmNhLTM5YTQtNGQ4Yi05MWZmLTZkM2VlZmFiNWMxZCIsInVuaXF1ZV9uYW1lIjoibWF0dGVyYWRtaW5ATVNtYXR0ZXIub25taWNyb3NvZnQuY29tIiwidXBuIjoibWF0dGVyYWRtaW5ATVNtYXR0ZXIub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIn0.d1BT4sBtxE1BOBtiI5zqH4_ZuVja5neCVrBXwxvERTQB4V022ns-o65r-d6NXyJGbhlwKszRHaz7fnIAKvRiEr4TcL9NoX9DoGHlFlBhBX0X28TqZNYt4DY11qmwRmf6bYL2VF3MLBUUxsU4RG-ovrXTURQNaOL7-lH59rWbrMd2mMCw3RQQg_60B2TJN1aFtCZp6g_jlhAk2s3te6b-xEFhBk_4evF8BjdAi84hPV-LG7q5VcoGEVGc6QjMRWkRyOcNEa3LJftRzyhS_LPPhq3lEtydeKY-MV6JnZ7WBr_97q5czQbwdAB9gICG9whdMTeEFBjNfQRZKgpXICiHZA"); + return client; + } + + + } + + public static class HttpContentExtensions + { + public static async Task ReadAsJsonAsync(this HttpContent content) + { + return await content.ReadAsAsync(GetJsonFormatters()); + } + + private static IEnumerable GetJsonFormatters() + { + yield return new JsonMediaTypeFormatter(); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/AttachmentUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/AttachmentUnitTest.cs new file mode 100644 index 00000000..1e334055 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/AttachmentUnitTest.cs @@ -0,0 +1,177 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; +using Microsoft.AspNetCore.Hosting; + +using System.Collections.Generic; + +namespace Microsoft.Legal.MatterCenter.ServiceTest.IntegrationTests +{ + public class AttachmentUnitTest + { + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + + public AttachmentUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); //.UseStartup()); + } + + [Fact] + public async void Test_Doc_Attachment() + { + var attachments = new List(); + AttachmentDetails attachmentDetails = new AttachmentDetails() { + attachmentType = "0", + name = "program to modify MARCH2016.docx", + originalName = "program to modify MARCH2016.docx", + isInline = false, + contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + id = "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAE+eM8AAABEgAQAGDuo5aZZdBAnm7TVKY1EoE=", + size = 335497 + }; + + + attachments.Add(attachmentDetails); + + var foldePath = new List(); + foldePath.Add("/sites/microsoft/1C0B1194EBF746DE829B8432A130EED3/Documents"); + + var serviceRequestVM = new ServiceRequest() + { + AllowContentCheck = true, + AttachmentToken = "eyJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBAM2M0NTYyY2EtMzlhNC00ZDhiLTkxZmYtNmQzZWVmYWI1YzFkIiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL291dGxvb2sub2ZmaWNlMzY1LmNvbUAzYzQ1NjJjYS0zOWE0LTRkOGItOTFmZi02ZDNlZWZhYjVjMWQiLCJuYmYiOjE0NjM0MjMwODcsImV4cCI6MTQ2MzQyMzM4NywibmFtZWlkIjoiMTA3OGNjMjQtZTg5Yy00OGY4LWFmYTEtY2IzMzIxNjM2OTY2QDNjNDU2MmNhLTM5YTQtNGQ4Yi05MWZmLTZkM2VlZmFiNWMxZCIsInZlciI6IkV4Y2hhbmdlLkNhbGxiYWNrLlYxIiwiYXBwY3R4c2VuZGVyIjoiaHR0cHM6Ly9tYXR0ZXJ3ZWJhcHAuYXp1cmV3ZWJzaXRlcy5uZXRAM2M0NTYyY2EtMzlhNC00ZDhiLTkxZmYtNmQzZWVmYWI1YzFkIiwiYXBwY3R4Ijoie1wib2lkXCI6XCI5MzNjZTFmZC0yNjkzLTRhYWUtYjdiYS0yYTBiNjhlNDEwMjlcIixcInB1aWRcIjpcIjEwMDNCRkZEOTc3QTM4REJcIixcInNtdHBcIjpcIm1hdHRlcmFkbWluQE1TbWF0dGVyLm9ubWljcm9zb2Z0LmNvbVwiLFwidXBuXCI6XCJtYXR0ZXJhZG1pbkBNU21hdHRlci5vbm1pY3Jvc29mdC5jb21cIixcInNjb3BlXCI6XCJQYXJlbnRJdGVtSWQ6QUFNa0FERm1NemhoTm1RMkxXRm1ZVFF0TkdFM1lTMWhPRGRpTFdRMk5HTXlOVGcwT0dZNVpnQkdBQUFBQUFBZlRVcEdlVzlZUTR1YzUzcVJjV3VvQndDdGc3ZFJGcGFZVHI3bm91RXBXK2M2QUFBQUFBRU1BQUN0ZzdkUkZwYVlUcjdub3VFcFcrYzZBQUFKZ1JvS0FBQT1cIn0ifQ.b1emwSawJwObcPJ5i8t4Y2GpYgmYyjxMtX-CkTmO72S6nhroYI1fqe_VlCjzkkGBvmRQ6BZslYaukem3mh_GPQAJAhOCcmFx5lVxJ3Ttivol-PHLMoQWUf9DloDo0_nIENLm9LFwqvYK2Yhp5zNTF9TMu7PDcuw2dKbTZqTQUm99y-ajqNx1tj1Zu23iXJj--DEjXdzSDtPzoAOhWyvq9c4WuvSbE07bXtXpIe0hf_A3MO7L4W2ERuJuiDmA_E1YanxzD9iSrN1vlSbLHdRI_hoqON0i3vUUjDYyeW5qNvpOLJfy48Uz5p1Tx_arIL5HXkHv6mI31jXwY8B3okzGJg", + Attachments = attachments, + EwsUrl = new System.Uri("https://outlook.office365.com/EWS/Exchange.asmx"), + DocumentLibraryName = "Matter For Debugging Unit", + FolderPath= foldePath, + MailId= "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAE+eM8AAA=", + PerformContentCheck=false, + Overwrite=false, + Subject= "Test email" + }; + + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }; + + + var attachmentRequestVM = new AttachmentRequestVM() + { + ServiceRequest = serviceRequestVM, + Client = matterClient + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/document/uploadattachments", attachmentRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Test_Mail_Attachment() + { + #region New Code Data + //var attachments = new List(); + //AttachmentDetails attachmentDetails = new AttachmentDetails() + //{ + // attachmentType = "0", + // name= "program to modify MARCH2016.docx", + // originalName= "program to modify MARCH2016.docx", + // isInline= false, + // contentType= "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + // id= "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAJgRoKAAABEgAQAJ0HuxfoKzZCt0IGCqWvGxE=", + // size= 335497 + //}; + + + //attachments.Add(attachmentDetails); + + //var foldePath = new List(); + //foldePath.Add("/sites/microsoft/12e53e87cbc16d97763d4e87f1fbb8f9/Emails"); + + //var serviceRequestVM = new ServiceRequest() + //{ + // AllowContentCheck = true, + // AttachmentToken = "", + // Attachments = attachments, + // EwsUrl = new System.Uri("https://outlook.office365.com/EWS/Exchange.asmx"), + // DocumentLibraryName = "testerV123", + // FolderPath = foldePath, + // MailId = "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAJgRoKAAA=", + // PerformContentCheck = false, + // Overwrite = false, + // Subject = "Test attachments.eml" + //}; + + //var matterClient = new Client() + //{ + // Url = "https://msmatter.sharepoint.com/sites/microsoft" + //}; + + + //var attachmentRequestVM = new AttachmentRequestVM() + //{ + // ServiceRequest = serviceRequestVM, + // Client = matterClient + //}; + + #endregion + + #region Old Code Data + var attachments = new List(); + AttachmentDetails attachmentDetails = new AttachmentDetails() + { + attachmentType = "0", + name = "program to modify MARCH2016.docx", + isInline = false, + contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + id = "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAJgRoKAAABEgAQAJ0HuxfoKzZCt0IGCqWvGxE=", + size = 335497 + }; + + + attachments.Add(attachmentDetails); + + var foldePath = new List(); + foldePath.Add("/sites/microsoft/12e53e87cbc16d97763d4e87f1fbb8f9/Emails"); + + var serviceRequestVM = new ServiceRequest() + { + AllowContentCheck = true, + AttachmentToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkkzTDVfM3pTRVZPT3RmQmZFTGpXRmMwaFNwWSJ9.eyJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBAM2M0NTYyY2EtMzlhNC00ZDhiLTkxZmYtNmQzZWVmYWI1YzFkIiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL291dGxvb2sub2ZmaWNlMzY1LmNvbUAzYzQ1NjJjYS0zOWE0LTRkOGItOTFmZi02ZDNlZWZhYjVjMWQiLCJuYmYiOjE0NjM0NDEwMjIsImV4cCI6MTQ2MzQ0MTMyMiwibmFtZWlkIjoiMTA3OGNjMjQtZTg5Yy00OGY4LWFmYTEtY2IzMzIxNjM2OTY2QDNjNDU2MmNhLTM5YTQtNGQ4Yi05MWZmLTZkM2VlZmFiNWMxZCIsInZlciI6IkV4Y2hhbmdlLkNhbGxiYWNrLlYxIiwiYXBwY3R4c2VuZGVyIjoiaHR0cHM6Ly9tYXR0ZXJ3ZWJhcHAuYXp1cmV3ZWJzaXRlcy5uZXRAM2M0NTYyY2EtMzlhNC00ZDhiLTkxZmYtNmQzZWVmYWI1YzFkIiwiYXBwY3R4Ijoie1wib2lkXCI6XCI5MzNjZTFmZC0yNjkzLTRhYWUtYjdiYS0yYTBiNjhlNDEwMjlcIixcInB1aWRcIjpcIjEwMDNCRkZEOTc3QTM4REJcIixcInNtdHBcIjpcIm1hdHRlcmFkbWluQE1TbWF0dGVyLm9ubWljcm9zb2Z0LmNvbVwiLFwidXBuXCI6XCJtYXR0ZXJhZG1pbkBNU21hdHRlci5vbm1pY3Jvc29mdC5jb21cIixcInNjb3BlXCI6XCJQYXJlbnRJdGVtSWQ6QUFNa0FERm1NemhoTm1RMkxXRm1ZVFF0TkdFM1lTMWhPRGRpTFdRMk5HTXlOVGcwT0dZNVpnQkdBQUFBQUFBZlRVcEdlVzlZUTR1YzUzcVJjV3VvQndDdGc3ZFJGcGFZVHI3bm91RXBXK2M2QUFBQUFBRU1BQUN0ZzdkUkZwYVlUcjdub3VFcFcrYzZBQUFKZ1JvS0FBQT1cIn0ifQ.JHVTqrNjDmwaJ2mZyiZ17GkAqILQywSH6Ac2wfH8DcEvIpwAZ_SztjlGlRQ9dysIxEqQxeO5Enb2Lin_jl1490EDGpZ4pN_go9ank5NcIZzxJP8WegjUzhtIcEilGIJuAwXTPXPoA0MUzhQN9JF9fUo5E63GncDzOKKrlvDT1dZmtrBqikvM1llmeOfNWLkGA_2qxjLzWam8gv9PZDTCAF_0TPoy8RaEJ5mwwHFos0KlA5R6__GW5fayS_tt8Y4Wd62Oo1JF-fePErrYa8g_n9fB3J_NsR1pDPtPVXvVYtK4A42iPvkvYwIZjcCDx5f-OPn_QXkY_wTaTpIUOlTPug", + Attachments = attachments, + EwsUrl = new System.Uri("https://outlook.office365.com/EWS/Exchange.asmx"), + DocumentLibraryName = "testerV123", + FolderPath = foldePath, + MailId = "AAMkADFmMzhhNmQ2LWFmYTQtNGE3YS1hODdiLWQ2NGMyNTg0OGY5ZgBGAAAAAAAfTUpGeW9YQ4uc53qRcWuoBwCtg7dRFpaYTr7nouEpW+c6AAAAAAEMAACtg7dRFpaYTr7nouEpW+c6AAAJgRoKAAA=", + PerformContentCheck = false, + Overwrite = false, + Subject = "Test attachments.eml" + }; + + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }; + + + var attachmentRequestVM = new AttachmentRequestVM() + { + ServiceRequest = serviceRequestVM, + Client = matterClient + }; + + #endregion + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/document/uploadmail", attachmentRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ConfigUnitTests.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ConfigUnitTests.cs new file mode 100644 index 00000000..f1be32d1 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ConfigUnitTests.cs @@ -0,0 +1,260 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; + +using Microsoft.AspNetCore.Hosting; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Extensions.Options; + +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Web; + +using Moq; +using Microsoft.Legal.MatterCenter.Web.Controllers; +using Microsoft.WindowsAzure.Storage.Table; +using System; +using Microsoft.Legal.MatterCenter.Web.Common; +using Microsoft.Extensions.Configuration; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class ConfigUnitTest:IClassFixture + { + + + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + private readonly CompositionRootFixture _fixture; + + private IConfigRepository configRepository; //{ get; set; } + private IMatterCenterServiceFunctions matterCenterServiceFunctions; + + + private readonly TestServer _server; + private readonly HttpClient _client; + + public ILoggerFactory LoggerFactory { get; } + + + public ConfigUnitTest(CompositionRootFixture fixture) + { + + testServer = new TestServer(new WebHostBuilder().UseStartup()); + _fixture = fixture; + + } + + + + [Fact] + public void GetAllUIConfigs() + { + + GeneralSettings genS = new GeneralSettings(); + genS.CloudStorageConnectionString = _fixture.Configuratuion.GetSection("General").GetSection("CloudStorageConnectionString").Value.ToString(); + + //Need to Mock the injected services and setup any properties on these that the test requires + var errorSettingsMoq = new Moq.Mock>(); + + var generalSettingsMoq = new Moq.Mock>(); + generalSettingsMoq.SetupGet(p => p.Value.CloudStorageConnectionString).Returns(genS.CloudStorageConnectionString); + + var environmentMoq = new Moq.Mock(); + environmentMoq.SetupGet(p => p.WebRootPath).Returns(@"C:\Repos\mcfork\tree\master\cloud\\src\solution\Microsoft.Legal.MatterCenter.Web\wwwroot"); + + var matterCenterServiceFunctionsMoq = new Moq.Mock(); + + var uiConfigsMoq = new Moq.Mock>(); + uiConfigsMoq.SetupGet(t => t.Value.MatterCenterConfiguration).Returns("MatterCenterConfiguration"); + uiConfigsMoq.SetupGet(p => p.Value.Partitionkey).Returns("MatterCenterConfig"); + uiConfigsMoq.SetupGet(c => c.Value.ConfigGroup).Returns("ConfigGroup"); + uiConfigsMoq.SetupGet(k => k.Value.Key).Returns("Key"); + uiConfigsMoq.SetupGet(v => v.Value.Value).Returns("Value"); + + + var logTableMoq = new Moq.Mock>(); + + ConfigRepository configRepository = new ConfigRepository(generalSettingsMoq.Object, uiConfigsMoq.Object); + + generalSettingsMoq.SetupGet(g => g.Value).Returns(genS); + errorSettingsMoq.SetupAllProperties(); + + + ConfigController controller = new ConfigController(errorSettingsMoq.Object, generalSettingsMoq.Object, uiConfigsMoq.Object, logTableMoq.Object, matterCenterServiceFunctionsMoq.Object, configRepository, environmentMoq.Object); + + var result = controller.Get(""); + + Assert.True(result.Status > 0); + } + + + [Fact] + public void GetAllUIConfigsForSPO() + { + + GeneralSettings genS = new GeneralSettings(); + genS.CloudStorageConnectionString = _fixture.Configuratuion.GetSection("General").GetSection("CloudStorageConnectionString").Value.ToString(); + + //Need to Mock the injected services and setup any properties on these that the test requires + var errorSettingsMoq = new Moq.Mock>(); + + var generalSettingsMoq = new Moq.Mock>(); + generalSettingsMoq.SetupGet(p => p.Value.CloudStorageConnectionString).Returns(genS.CloudStorageConnectionString); + generalSettingsMoq.SetupGet(p => p.Value.AdminUserName).Returns(_fixture.Configuratuion.GetSection("General").GetSection("AdminUserName").Value.ToString()); + generalSettingsMoq.SetupGet(p => p.Value.AdminPassword).Returns(_fixture.Configuratuion.GetSection("General").GetSection("AdminPassword").Value.ToString()); + generalSettingsMoq.SetupGet(p => p.Value.CentralRepositoryUrl).Returns("https://msmatter.sharepoint.com/sites/catalog"); + + var environmentMoq = new Moq.Mock(); + environmentMoq.SetupGet(p => p.WebRootPath).Returns(@"C:\projects\mc2\tree\master\cloud\src\solution\Microsoft.Legal.MatterCenter.Web\wwwroot"); + + var matterCenterServiceFunctionsMoq = new Moq.Mock(); + + var uiConfigsMoq = new Moq.Mock>(); + uiConfigsMoq.SetupGet(t => t.Value.MatterCenterConfiguration).Returns("MatterCenterConfiguration"); + uiConfigsMoq.SetupGet(p => p.Value.Partitionkey).Returns("MatterCenterConfig"); + uiConfigsMoq.SetupGet(c => c.Value.ConfigGroup).Returns("ConfigGroup"); + uiConfigsMoq.SetupGet(k => k.Value.Key).Returns("Key"); + uiConfigsMoq.SetupGet(v => v.Value.Value).Returns("Value"); + + + var logTableMoq = new Moq.Mock>(); + + ConfigRepository configRepository = new ConfigRepository(generalSettingsMoq.Object, uiConfigsMoq.Object); + + generalSettingsMoq.SetupGet(g => g.Value).Returns(genS); + errorSettingsMoq.SetupAllProperties(); + + + ConfigController controller = new ConfigController(errorSettingsMoq.Object, generalSettingsMoq.Object, uiConfigsMoq.Object, + logTableMoq.Object, matterCenterServiceFunctionsMoq.Object, configRepository, environmentMoq.Object); + + var result = controller.GetConfigsForSPO(""); + + Assert.True(result.Status > 0); + } + + [Fact] + public void GetSubsetUIConfigs() + { + + GeneralSettings genS = new GeneralSettings(); + genS.CloudStorageConnectionString = _fixture.Configuratuion.GetSection("General").GetSection("CloudStorageConnectionString").Value.ToString(); + + //Need to Mock the injected services and setup any properties on these that the test requires + var errorSettingsMoq = new Moq.Mock>(); + + var generalSettingsMoq = new Moq.Mock>(); + generalSettingsMoq.SetupGet(p => p.Value.CloudStorageConnectionString).Returns(genS.CloudStorageConnectionString); + + var environmentMoq = new Moq.Mock(); + environmentMoq.SetupGet(p => p.WebRootPath).Returns(@"C:\Repos\mcfork\tree\master\cloud\\src\solution\Microsoft.Legal.MatterCenter.Web\wwwroot"); + + var matterCenterServiceFunctionsMoq = new Moq.Mock(); + + var uiConfigsMoq = new Moq.Mock>(); + uiConfigsMoq.SetupGet(t => t.Value.MatterCenterConfiguration).Returns("MatterCenterConfiguration"); + uiConfigsMoq.SetupGet(p => p.Value.Partitionkey).Returns("MatterCenterConfig"); + uiConfigsMoq.SetupGet(c => c.Value.ConfigGroup).Returns("ConfigGroup"); + uiConfigsMoq.SetupGet(k => k.Value.Key).Returns("Key"); + uiConfigsMoq.SetupGet(v => v.Value.Value).Returns("Value"); + + var logTableMoq = new Moq.Mock>(); + + ConfigRepository configRepository = new ConfigRepository(generalSettingsMoq.Object, uiConfigsMoq.Object); + + generalSettingsMoq.SetupGet(g => g.Value).Returns(genS); + errorSettingsMoq.SetupAllProperties(); + + ConfigController controller = new ConfigController(errorSettingsMoq.Object, generalSettingsMoq.Object, uiConfigsMoq.Object, logTableMoq.Object, matterCenterServiceFunctionsMoq.Object, configRepository, environmentMoq.Object); + + var result = controller.Get("Home"); + + Assert.True(result.Status > 0); + } + + [Fact] + public void InsertUpdateUIConfigs() + { + + GeneralSettings genS = new GeneralSettings(); + genS.CloudStorageConnectionString = _fixture.Configuratuion.GetSection("General").GetSection("CloudStorageConnectionString").Value.ToString(); + + //Need to Mock the injected services and setup any properties on these that the test requires + var errorSettingsMoq = new Moq.Mock>(); + + var generalSettingsMoq = new Moq.Mock>(); + generalSettingsMoq.SetupGet(p => p.Value.CloudStorageConnectionString).Returns(genS.CloudStorageConnectionString); + + var environmentMoq = new Moq.Mock(); + environmentMoq.SetupGet(p => p.WebRootPath).Returns(@"C:\Repos\mcfork\tree\master\cloud\\src\solution\Microsoft.Legal.MatterCenter.Web\wwwroot"); + + var matterCenterServiceFunctionsMoq = new Moq.Mock(); + + var uiConfigsMoq = new Moq.Mock>(); + uiConfigsMoq.SetupGet(t => t.Value.MatterCenterConfiguration).Returns("MatterCenterConfiguration"); + uiConfigsMoq.SetupGet(p => p.Value.Partitionkey).Returns("MatterCenterConfig"); + uiConfigsMoq.SetupGet(c => c.Value.ConfigGroup).Returns("ConfigGroup"); + uiConfigsMoq.SetupGet(k => k.Value.Key).Returns("Key"); + uiConfigsMoq.SetupGet(v => v.Value.Value).Returns("Value"); + + var logTableMoq = new Moq.Mock>(); + + ConfigRepository configRepository = new ConfigRepository(generalSettingsMoq.Object, uiConfigsMoq.Object); + + generalSettingsMoq.SetupGet(g => g.Value).Returns(genS); + errorSettingsMoq.SetupAllProperties(); + + ConfigController controller = new ConfigController(errorSettingsMoq.Object, generalSettingsMoq.Object, uiConfigsMoq.Object, logTableMoq.Object, matterCenterServiceFunctionsMoq.Object, configRepository, environmentMoq.Object); + + + var configsStr = (@"{""Home"": { + ""ContextualHelpHeader"": ""Matter Center For Outlook"", + ""ContextualHelpBottomText"": ""Questions? Contact "", + ""HelpRequesURL"": ""https://msmatter.sharepoint.com/sites/catalog"", + ""MatterCenterSupportLinkText"": ""Matter Center Aisling Support"", + ""MatterCenterSupportLink"": ""mailto:support@supportsite.com"", + ""Change"": ""mailto:aisling@supportsite.com"", + }, + ""MatterUsers"": { + ""SearchUsersURL"": ""https://msmatter.sharepoint.com/sites/client"", + ""StampedPropertiesURL"": ""https://msmatter.sharepoint.com/sites/microsoft"", + ""Add"": ""test"", + }}"); + + + + var result = controller.InsertUpdate(configsStr); + + Assert.True(result.Status > 0); + } + + + + + /// This unit test will try to get all the users who can see a particular item + /// + [Fact] + public void GetConfigsFromTableRep() + { + + + GeneralSettings genS = new GeneralSettings(); + genS.CloudStorageConnectionString = _fixture.Configuratuion.GetSection("General").GetSection("CloudStorageConnectionString").Value.ToString(); + var m = new Moq.Mock>(); + var l = new Moq.Mock>(); + + m.SetupGet(g => g.Value).Returns(genS); + m.SetupAllProperties(); + + + ConfigRepository configRepository = new ConfigRepository(m.Object, l.Object); + var response = configRepository.GetConfigEntities(""); + + } + + + } +} + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/DocumentUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/DocumentUnitTest.cs new file mode 100644 index 00000000..ba9da28d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/DocumentUnitTest.cs @@ -0,0 +1,192 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; +using Microsoft.Legal.MatterCenter.Service; +using Newtonsoft.Json; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class DocumentUnitTest + { + private readonly TestServer testServer; + public DocumentUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + } + + + /// + /// This unit test will get all the user pinned documents. This is a positive test case + /// + [Fact] + public async void Get_User_Pinned_Document() + { + var client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/document/getpinneddocuments", client); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotNull(result.MatterDataList); + Assert.NotEmpty(result.MatterDataList); + } + } + + /// + /// This unit test is for negative test case and this test case wont get any results back + /// This test case will get 404 + /// + [Fact] + public async void NoPin_User_Document() + { + var client = new Client() + { + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/document/unpinmatterdocument", client); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.Equal("404", result.ErrorCode); + } + } + + + /// + /// This unit test is for unpinng the user matter + /// + [Fact] + public async void UnPin_User_Matter() + { + var pinRequestVM = new PinRequestMatterVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + MatterData = new MatterData() + { + MatterName = "https://svalli.sharepoint.com/sites/mc/e0421c5e7fbf704023871b2acf64370m/Forms/AllItems.aspx" + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/unpinmatter", pinRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test is for creating a new pinned matter + /// + [Fact] + public async void Pin_User_Document() + { + var pinRequestVM = new PinRequestDocumentVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + DocumentData = new DocumentData() + { + DocumentName= "Document", + DocumentVersion= "2.0", + DocumentClient= "Microsoft", + DocumentClientId= "100002", + DocumentClientUrl= "https://svalli.sharepoint.com/sites/mc", + DocumentMatter= "For Matter Center", + DocumentMatterId= "123456", + DocumentOwner= "Lakshmanaswamy Premchand Peddakotla", + DocumentUrl= "https://svalli.sharepoint.com/sites/mc/9c069bd7e681628e5107a87bfc49e648/emails/document2.docx", + DocumentOWAUrl= "https://svalli.sharepoint.com/sites/mc/_layouts/WopiFrame.aspx?sourcedoc=https%3A%2F%2Fsvalli.sharepoint.com%2Fsites%2Fmc%2F9c069bd7e681628e5107a87bfc49e648%2FEmails%2FDocument.docx&action=default&DefaultItemOpen=1", + DocumentExtension= "docx", + DocumentCreatedDate= "2016-02-19T21:37:36Z", + DocumentModifiedDate= "2/19/2016 9:37:53 PM", + DocumentCheckoutUser= "NA", + DocumentMatterUrl= "https://svalli.sharepoint.com/sites/mc/9c069bd7e681628e5107a87bfc49e648", + DocumentParentUrl= "https://svalli.sharepoint.com/sites/mc/9c069bd7e681628e5107a87bfc49e648/Emails", + DocumentID= "MICROSOFT-1625733529-9" + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/document/pindocument", pinRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test is for unpinng the user matter + /// + [Fact] + public async void UnPin_User_Document() + { + var pinRequestVM = new PinRequestDocumentVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + DocumentData = new DocumentData() + { + DocumentUrl = "https://svalli.sharepoint.com/sites/mc/e0421c5e7fbf704023871b2acf64370m/Forms/AllItems.aspx" + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/document/unpindocument", pinRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Get_Document_Without_SearchTerm() + { + var searchRequest = new SearchRequestVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SearchObject = new SearchObject() + { + PageNumber = 1, + ItemsPerPage = 10, + SearchTerm = "", + Filters = new FilterObject() { }, + Sort = new SortObject() + { + ByProperty = "LastModifiedTime", + Direction = 1 + } + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/document/getdocuments", searchRequest); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotEmpty(result.DocumentDataList); + + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ExternalSharingUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ExternalSharingUnitTest.cs new file mode 100644 index 00000000..7af91937 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/ExternalSharingUnitTest.cs @@ -0,0 +1,102 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; + +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class ExternalSharingUnitTest + { + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + + public ExternalSharingUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + } + + /// + /// This unit test will try to get all the roles configured in matter center + /// + [Fact] + public async void Send_ExternalSharing_Notification() + { + + + var assignUserEmails = new List>(); + var userEmails = new List(); + userEmails.Add("matteradmin@MSmatter.onmicrosoft.com"); + assignUserEmails.Add(userEmails); + + userEmails = new List(); + userEmails.Add("premchand250@hotmail.com"); + assignUserEmails.Add(userEmails); + + var assignUserNames = new List>(); + var userNames = new List(); + userNames.Add("Wilson Gajarla"); + userNames.Add(""); + assignUserNames.Add(userNames); + + userNames = new List(); + userNames.Add("premchand250@hotmail.com"); + userNames.Add(""); + assignUserNames.Add(userNames); + + var permissions = new List(); + permissions.Add("Full Control"); + permissions.Add("Full Control"); + + var roles = new List(); + roles.Add("Responsible Attorney"); + roles.Add("Legal Admin"); + + var uploadBlockedUsers = new List(); + uploadBlockedUsers.Add("premp@MSmatter.onmicrosoft.com"); + var matterMetaInformation = new MatterInformationVM() + { + Client = new Client + { + Url = "https://msmatter.sharepoint.com/sites/microsoft", + Id = "100001", + Name = "Microsoft" + }, + Matter = new Matter + { + Id= "351085190a4ce42e2871e748b4e5d8ce", + Name = "vTest4", + BlockUserNames = new List() + { + "SaiG@MSmatter.onmicrosoft.com" + }, + AssignUserNames = assignUserNames, + AssignUserEmails = assignUserEmails, + Permissions = permissions, + Roles = roles, + Conflict = new Conflict() + { + Identified = "True" + } + }, + MatterDetails = new MatterDetails + { + ResponsibleAttorney = "Wilson Gajarla;", + ResponsibleAttorneyEmail = "Wilson Gajarla;", + UploadBlockedUsers = uploadBlockedUsers, + TeamMembers = "Wilson Gajarla;premchand250@hotmail.com", + RoleInformation = "{\"Responsible Attorney\":\"Wilson Gajarla\",\"Legal Admin\":\"premchand250@hotmail.com\"}" + }, + EditMode = true + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/matter/sharematter", matterMetaInformation); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/MatterUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/MatterUnitTest.cs new file mode 100644 index 00000000..bc97b186 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/MatterUnitTest.cs @@ -0,0 +1,583 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class MatterUnitTest + { + private readonly TestServer testServer; + public MatterUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + } + + /// + /// This unit test will get all the user pinned matters. This is a positive test case + /// + [Fact] + public async void Get_User_Pinned_Matter() + { + var client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/catalog" + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/getpinned", client); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotNull(result.MatterDataList); + Assert.NotEmpty(result.MatterDataList); + } + } + + + /// + /// This unit test is for negative test case and this test case wont get any results back + /// This test case will get 404 + /// + [Fact] + public async void No_User_Pinned_Matter_Found() + { + var client = new Client() + { + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/getpinnedmatters", client); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.Equal("404", result.ErrorCode); + } + } + + /// + /// This unit test is for unpinng the user matter + /// + [Fact] + public async void UnPin_User_Matter() + { + var pinRequestVM = new PinRequestMatterVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + MatterData = new MatterData() + { + MatterName = "https://svalli.sharepoint.com/sites/mc/e0421c5e7fbf704023871b2acf64370m/Forms/AllItems.aspx" + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/unpinmatter", pinRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test is for creating a new pinned matter + /// + [Fact] + public async void Pin_User_Matter() + { + var pinRequestVM = new PinRequestMatterVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + MatterData = new MatterData() + { + MatterUrl = "https://svalli.sharepoint.com/sites/mc/e0421c5e7fbf704023871b2acf64370m/Forms/AllItems.aspx", + HideUpload = "false", + MatterAreaOfLaw = "Intellectual Property;", + MatterClient = "Microsoft", + MatterClientId = "100002", + MatterCreatedDate = "2016-02-18T11:19:05.000Z", + MatterDescription = "For Matter Center", + MatterGuid = "9c069bd7e681628e5107a87bfc49e648", + MatterID = "123456", + MatterModifiedDate = "2016-03-07T23:23:49Z", + MatterPracticeGroup = "Litigation;", + MatterName = "For Matter Center", + MatterResponsibleAttorney = "Matter Center", + MatterSubAreaOfLaw = "Trademark;", + MatterClientUrl = "https://svalli.sharepoint.com/sites/mc" + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/pinmatter", pinRequestVM); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Get_Matter_Without_SearchTerm() + { + var searchRequest = new SearchRequestVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SearchObject = new SearchObject() + { + PageNumber = 1, + ItemsPerPage = 10, + SearchTerm = "", + Filters = new FilterObject() { }, + Sort = new SortObject() + { + ByProperty = "LastModifiedTime", + Direction = 1 + } + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/get", searchRequest); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotEmpty(result.SearchResults); + + } + } + + [Fact] + public async void Get_Matter_With_SearchTerm() + { + var searchRequest = new SearchRequestVM() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SearchObject = new SearchObject() + { + PageNumber = 1, + ItemsPerPage = 10, + SearchTerm = "M", + Filters = new FilterObject() { }, + Sort = new SortObject() + { + ByProperty = "LastModifiedTime", + Direction = 1 + } + } + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/get", searchRequest); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotEmpty(result.SearchResults); + + } + } + + + [Fact] + public async void Check_Matter_Exists() + { + var matterMetadataVM = new MatterMetdataVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + Matter = new Matter() + { + Name = "New Matter", + MatterGuid = "e224f0ba891492dc05bf97d73f8b2934" + }, + HasErrorOccurred = false + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/checkmatterexists", matterMetadataVM); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Get_Matter_Configurations() + { + var siteCollectionPath = "https://msmatter.sharepoint.com/sites/microsoft"; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/GetConfigurations", siteCollectionPath); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Check_Security_Group_Exists() + { + var blockedUserNames = new List(); + blockedUserNames.Add("matteradmin@MSmatter.onmicrosoft.com"); + IList> assignUserNames = new List>(); + + var userNames = new List(); + userNames.Add("Venkat M"); + userNames.Add(""); + assignUserNames.Add(userNames); + + + + IList> assignUserEmails = new List>(); + var emails = new List(); + emails.Add("venkatm@MSmatter.onmicrosoft.com"); + emails.Add(""); + assignUserEmails.Add(emails); + + var userIds = new List(); + userIds.Add("txtAssign1"); + + var matterInformationVM = new MatterInformationVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + Matter = new Matter() + { + Name = "New Matter", + AssignUserNames = assignUserNames, + AssignUserEmails = assignUserEmails, + Conflict = new Conflict() + { + Identified = "True" + }, + BlockUserNames = blockedUserNames, + }, + UserIds = userIds + }; + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/checksecuritygroupexists", matterInformationVM); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + + [Fact] + public async void Create_Matter() + { + #region Create Matter Data + string matterGuid = "1C0B1194EBF746DE829B8432A130EED3"; + + var userIds = new List(); + userIds.Add("txtAssign1"); + + var blockUserNames = new List(); + blockUserNames.Add("SaiG@MSmatter.onmicrosoft.com"); + + var assignUserNames = new List>(); + var userNames = new List(); + userNames.Add("Premchand peddakotla"); + userNames.Add(""); + assignUserNames.Add(userNames); + + + var assignUserEmails = new List>(); + var userEmails = new List(); + userEmails.Add("premp@MSmatter.onmicrosoft.com"); + userEmails.Add(""); + assignUserEmails.Add(userNames); + + var roles = new List(); + roles.Add("Responsible Attorney"); + + var folderNames = new List(); + folderNames.Add("Emails"); + folderNames.Add("Documents"); + + + var matterMetaDataVM = new MatterMetdataVM() + { + Matter = new Matter() + { + Name = "Matter For Debugging Unit", + Id = "Debug12341", + Description = "Matter for debugging Unit", + Conflict = new Conflict() + { + Identified = "True", + CheckBy = "matteradmin@MSmatter.onmicrosoft.com", + CheckOn = "05/03/2016", + SecureMatter = "True" + }, + BlockUserNames = blockUserNames, + AssignUserNames = assignUserNames, + AssignUserEmails = assignUserEmails, + Roles = roles, + MatterGuid = matterGuid, + FolderNames = folderNames + }, + Client = new Client() + { + Id = "100001", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + MatterConfigurations = new MatterConfigurations() + { + IsConflictCheck = true, + IsMatterDescriptionMandatory = true, + IsCalendarSelected = true, + IsTaskSelected = true + }, + UserIds = userIds + }; + #endregion + + #region Assign Content Type + var contentTypes = new List(); + contentTypes.Add("Copyright"); + contentTypes.Add("Patent"); + + + var assignContentTypeMetadata = new MatterMetadata() + { + Matter = new Matter() + { + Name = "Matter For Debugging Unit", + Id = "Debug12341", + ContentTypes = contentTypes, + DefaultContentType = "Copyright", + MatterGuid = matterGuid + }, + Client = new Client() + { + Url= "https://msmatter.sharepoint.com/sites/microsoft", + Name="Microsoft", + Id = "100001" + }, + PracticeGroupTerm = new PracticeGroupTerm() + { + TermName= "Litigation", + Id= "084887e6-3705-466c-823b-207563388464" + }, + AreaTerm = new AreaTerm() + { + TermName= "Intellectual Property", + Id= "162fb199-2f04-498d-a7ac-329a077bca9f" + }, + SubareaTerm = new SubareaTerm() + { + TermName = "Copyright", + Id = "15c5b16c-150b-4bf5-8470-59dfa951dcf8" + } + + }; + + #endregion + + #region Assign User Permission + var permissions = new List(); + permissions.Add("Full Control"); + + + var assignUserPermissionMetadataVM = new MatterMetdataVM() + { + Client = new Client() + { + Url= "https://msmatter.sharepoint.com/sites/microsoft" + }, + Matter = new Matter() + { + Name= "Matter For Debugging Unit", + Permissions= permissions, + AssignUserNames= assignUserNames, + AssignUserEmails= assignUserEmails, + MatterGuid = matterGuid + }, + MatterConfigurations = new MatterConfigurations() + { + IsCalendarSelected = true, + IsTaskSelected = true + } + }; + #endregion + + #region Create Matter Landing Page + var createMatterLandingPage = new MatterMetdataVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + MatterConfigurations = new MatterConfigurations() + { + IsConflictCheck = true, + IsMatterDescriptionMandatory = true, + IsCalendarSelected = true, + IsRSSSelected = true, + IsTaskSelected = true + }, + Matter = new Matter() + { + Name = "Matter For Debugging Unit", + Description = "Matter for debugging Unit", + AssignUserNames = assignUserNames, + AssignUserEmails = assignUserEmails, + BlockUserNames = blockUserNames, + Conflict = new Conflict() + { + Identified = "True", + CheckBy = "matteradmin@MSmatter.onmicrosoft.com", + CheckOn = "05/03/2016", + SecureMatter = "True" + }, + Permissions = permissions, + MatterGuid = matterGuid + } + }; + #endregion + + #region Update Matter Metadata + + var ct = new List(); + ct.Add("Copyright"); + ct.Add(""); + + var uploadBlockedUsers = new List(); + var docTemplateCount = new List(); + docTemplateCount.Add("1"); + + var matterMetadata = new MatterMetdataVM() + { + Client = new Client() + { + Id = "100001", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + Matter = new Matter() + { + Name = "Matter For Debugging Unit", + Id = "Debug12341", + Description = "Matter for debugging Unit", + Conflict = new Conflict() + { + Identified = "True", + CheckBy = "matteradmin@MSmatter.onmicrosoft.com", + CheckOn = "05/03/2016", + SecureMatter = "True" + }, + BlockUserNames = blockUserNames, + AssignUserNames = assignUserNames, + AssignUserEmails = assignUserEmails, + Roles = roles, + MatterGuid = matterGuid, + ContentTypes= ct, + DefaultContentType= "Copyright", + Permissions= permissions, + DocumentTemplateCount= docTemplateCount + }, + MatterConfigurations = new MatterConfigurations() + { + IsConflictCheck=true, + IsMatterDescriptionMandatory=true + }, + MatterDetails = new MatterDetails() + { + //PracticeGroup = "Litigation;", + //AreaOfLaw= "Intellectual Property;", + //SubareaOfLaw= "Copyright;", + ResponsibleAttorney= "SaiKiran Gudala;", + ResponsibleAttorneyEmail= "SaiG@MSmatter.onmicrosoft.com;", + UploadBlockedUsers= uploadBlockedUsers, + TeamMembers= "SaiKiran Gudala;", + RoleInformation= "{\"Responsible Attorney\":\"Venkat M(venkatm@MSmatter.onmicrosoft.com)\"}" + }, + MatterProvisionFlags = new MatterProvisionFlags() + { + SendEmailFlag = true, + MatterLandingFlag = "true" + } + }; + #endregion + + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/create", matterMetaDataVM); + var result = response.Content.ReadAsJsonAsync().Result; + if(result.IsError==false) + { + //Call Assign Content Type API + response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/assigncontenttype", assignContentTypeMetadata); + result = response.Content.ReadAsJsonAsync().Result; + } + + if (result.IsError == false) + { + //Call Assign Content Type API + response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/assignuserpermissions", assignUserPermissionMetadataVM); + result = response.Content.ReadAsJsonAsync().Result; + } + + if (result.IsError == false) + { + //Call Assign Content Type API + response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/createlandingpage", createMatterLandingPage); + result = response.Content.ReadAsJsonAsync().Result; + } + + if (result.IsError == false) + { + //Call Assign Content Type API + response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/UpdateMetadata", matterMetadata); + result = response.Content.ReadAsJsonAsync().Result; + } + Assert.NotNull(result); + } + } + + [Fact] + public async void Delete_Matter() + { + var matterVM = new MatterVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/microsoft" + }, + Matter = new Matter() + { + Name = "Matter For Debugging Unit", + MatterGuid = "1C0B1194EBF746DE829B8432A130EED3" + } + }; + + using (var testClient = testServer.CreateClient().AcceptJson()) + { + var response = await testClient.PostAsJsonAsync("http://localhost:58775/api/v1/matter/deletematter", matterVM); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Open Notebook.onetoc2 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/Open Notebook.onetoc2 similarity index 100% rename from tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.ProviderService/Open Notebook.onetoc2 rename to tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/Open Notebook.onetoc2 diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/SharedUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/SharedUnitTest.cs new file mode 100644 index 00000000..7a37592a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/SharedUnitTest.cs @@ -0,0 +1,87 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; + +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class SharedUnitTest + { + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + + public SharedUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + } + + /// + /// This unit test will try to get all the roles configured in matter center + /// + [Fact] + public async void Get_Help() + { + var helpRequestModel = new HelpRequestModel() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SelectedPage = "" + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/shared/help", helpRequestModel); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + + + /// + /// This unit test will try to get all the users who can see a particular item + /// + [Fact] + public async void Get_Users() + { + SearchRequestVM searchRequestVM = new SearchRequestVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SearchObject = new SearchObject() + { + SearchTerm = "Matter" + } + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getusers", searchRequestVM); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test will try to test all the permissions levels that are configured + /// + [Fact] + public async void Get_Permission_Levels() + { + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getpermissionlevels", matterClient); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/TaxonomyUniTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/TaxonomyUniTest.cs new file mode 100644 index 00000000..68b4857f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/TaxonomyUniTest.cs @@ -0,0 +1,211 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; +using Microsoft.IdentityModel.Clients.ActiveDirectory; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class TaxonomyUniTest + { + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + private AuthenticationContext authContext; + + public TaxonomyUniTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + ; + } + [Fact] + public async void Get_Current_Site_Title() + { + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.GetAsync("http://localhost:44324/api/v1/taxonomy/getcurrentsitetitle"); + var result = response.Content.ReadAsStringAsync().Result; + Assert.NotNull(result); + } + } + + private async Task GetAccessToken() + { + AuthenticationContext authContext = new AuthenticationContext(authority); + ClientCredential clientCred = new ClientCredential("844ffb77-5bfd-403e-9285-678e2eddc90c", "IAKt/4uoQFM0UJ1Ocj//WHOg1RzLspACzPAKkkPP0kw="); + //UserCredential userCredential = new UserCredential("v-lapedd@microsoft.com", "feb@2016"); //Before RTM + UserCredential userCredential = new UserCredential("v-lapedd@microsoft.com"); + AuthenticationResult authResult = await authContext.AcquireTokenAsync("https://microsoft.onmicrosoft.com/mcserviceadal", + clientCred); + return authResult.AccessToken; + //AuthenticationContext authContext = new AuthenticationContext(clientCredentials.Authority); + //ClientCredential clientCred = new ClientCredential(clientCredentials.ClientId, clientCredentials.ClientSecret); + //AuthenticationResult authResult = await authContext.AcquireTokenAsync(clientCredentials.ClientResource, clientCred); + //return authResult.AccessToken; + } + + /// + /// This integration test case is for getting the clients with correct inputs passed + /// + [Fact] + public async void Get_Taxonomy_Hierarchy_For_Clients() + { + + var termStoreViewModel = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "MatterCenterTerms", + TermSetName = "Clients", + CustomPropertyName = "ClientURL" + } + }; + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:58775/api/v1/taxonomy/gettaxonomy", termStoreViewModel); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotEmpty(result.ClientTerms); + } + } + + /// + /// This integration test case is for getting the parctice groups with correct inputs passed + /// + [Fact] + public async void Get_Taxonomy_Hierarchy_For_PracticeGroups() + { + + var termStoreViewModel = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "MatterCenterTerms", + TermSetName = "Practice Groups", + CustomPropertyName = "FolderNames" + } + }; + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:58775/api/v1/taxonomy/gettaxonomy", termStoreViewModel); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.NotEmpty(result.PGTerms); + } + } + + + /// + /// This integration test case is for not getting the clients with incorrect inputs passed + /// + [Fact] + public async void Get_Taxonomy_Hierarchy_For_Clients_NoResults() + { + + var termStoreViewModel = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "Site Collection - microsoft.sharepoint.com-teams-mcuisite", + TermSetName = "NoClients", + CustomPropertyName = "ClientURL" + } + }; + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:58775/api/v1/taxonomy/gettaxonomy", termStoreViewModel); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.Equal("404", result.ErrorCode); + } + } + + + /// + /// This integration test case is for not getting the parctice groups with in correct inputs passed + /// + [Fact] + public async void Get_Taxonomy_Hierarchy_For_PracticeGroups_NoResults() + { + + var termStoreViewModel = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "Site Collection - microsoft.sharepoint.com-teams-nosite", + TermSetName = "No Practice Groups", + CustomPropertyName = "FolderNames" + } + }; + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:58775/api/v1/taxonomy/gettaxonomy", termStoreViewModel); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.Equal("404", result.ErrorCode); + } + } + + /// + /// This integration test case is for not getting the clients with incorrect inputs passed + /// + [Fact] + public async void Internal_Server_Error() + { + + var termStoreViewModel = new TermStoreViewModel() + { + Client = new Client() + { + Id = "123456", + Name = "Microsoft", + Url = "https://microsoft.sharepoint.com/teams/mcuisite1234" + }, + TermStoreDetails = new TermStoreDetails() + { + TermGroup = "Site Collection - microsoft.sharepoint.com-teams-mcuisite", + TermSetName = "NoClients", + CustomPropertyName = "ClientURL" + } + }; + + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:58775/api/v1/taxonomy/gettaxonomy", termStoreViewModel); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + Assert.Equal("500", result.ErrorCode); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/UserUnitTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/UserUnitTest.cs new file mode 100644 index 00000000..66cf44b4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/IntegrationTests/UserUnitTest.cs @@ -0,0 +1,101 @@ +using Xunit; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Legal.MatterCenter.Models; +using System.Net.Http; + +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class UserUnitTest + { + private readonly TestServer testServer; + private const string authority = "https://login.windows.net/microsoft.onmicrosoft.com"; + + public UserUnitTest() + { + testServer = new TestServer(new WebHostBuilder().UseStartup()); + } + + /// + /// This unit test will try to get all the roles configured in matter center + /// + [Fact] + public async void Get_Roles() + { + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getroles", matterClient); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test will try to get all the roles configured in matter center + /// + [Fact] + public async void Get_UserProfile_Picture() + { + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com" + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getuserprofilepicture", matterClient); + var result = response.Content.ReadAsJsonAsync().Result; + Assert.NotNull(result); + } + } + + + /// + /// This unit test will try to get all the users who can see a particular item + /// + [Fact] + public async void Get_Users() + { + SearchRequestVM searchRequestVM = new SearchRequestVM() + { + Client = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }, + SearchObject = new SearchObject() + { + SearchTerm = "Matter" + } + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getusers", searchRequestVM); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + + /// + /// This unit test will try to test all the permissions levels that are configured + /// + [Fact] + public async void Get_Permission_Levels() + { + var matterClient = new Client() + { + Url = "https://msmatter.sharepoint.com/sites/catalog" + }; + using (var client = testServer.CreateClient().AcceptJson()) + { + var response = await client.PostAsJsonAsync("http://localhost:44323/api/v1/user/getpermissionlevels", matterClient); + var result = response.Content.ReadAsJsonAsync>().Result; + Assert.NotNull(result); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/MatterBaseTest.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/MatterBaseTest.cs new file mode 100644 index 00000000..0a6d8f7f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/MatterBaseTest.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class MatterBaseTest + { + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.Service.xml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.Service.xml new file mode 100644 index 00000000..cac7d1b3 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.Service.xml @@ -0,0 +1,145 @@ + + + + Microsoft.Legal.MatterCenter.Service + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + + + + + + + + Document Controller class deals with finding document, pinning document, unpinning the document etc. + + + + + Constructor where all the required dependencies are injected + + + + + + + + + + Gets the matters based on search criteria. + + + searchResponseVM + + + + Returns document and list GUID + + Request object containing SharePoint App Token + Client object containing list data + Document and list GUID + + + + Matter Controller class deals with matter provisioning, finding matter, pinning matter, unpinning the matterm, updating the matter + + + + + Constructor where all the required dependencies are injected + + + + + + + + + Gets the matters based on search criteria. + + + searchResponseVM + + + + Constructor where all the required dependencies are injected + + + + + + + + + Returns true or false based on the existence of the matter landing page and OneNote file at the URLs provided. + + Request object containing SharePoint App Token + Client object containing Client data + String object containing the OneNote file path + String object containing the Matter Landing Page file path + $|$ Separated string indicating that the OneNote and the Matter Landing Page exist or not + + + + Taxonomy Controller will read the term store information related to matter center + + + + + Constructor where all the required dependencies are injected + + + + + + + + + + + This is test method for testing the contrroller + + + + + + This class will be used to validate the client input values + + + + + This method will validate the client object and if there are any errors in the client inout object, the method will + return ErrorResponse object or it will return null + + Contains the information such as ClientId, ClientUrl etc + ErrorResponse + + + + Function to validate client information + + Client object + Number indicating which method needs to be validated + ErrorResponse that contains error message with error code + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.ServiceTest.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.ServiceTest.xproj new file mode 100644 index 00000000..ef3df694 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Microsoft.Legal.MatterCenter.ServiceTest.xproj @@ -0,0 +1,22 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 650a5a85-5956-491e-9312-5e25a27d1108 + Microsoft.Legal.MatterCenter.ServiceTest + .\obj + .\bin + v4.6 + + + 2.0 + + + + + + \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Open Notebook.onetoc2 b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Open Notebook.onetoc2 new file mode 100644 index 00000000..6be02811 Binary files /dev/null and b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Open Notebook.onetoc2 differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Program.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Program.cs new file mode 100644 index 00000000..ac31f6a3 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Program.cs @@ -0,0 +1,32 @@ +using System; +using System.IO; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Builder; + + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class Program + { + + public static void Main(string[] args) + { + try + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + host.Run(); + } + catch (Exception ex) + { + string msg = ex.Message; + throw; + } + } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Startup.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Startup.cs new file mode 100644 index 00000000..e7b3b975 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/Startup.cs @@ -0,0 +1,332 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using System; +using System.Threading.Tasks; +using Newtonsoft.Json.Serialization; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json; +using System.Net; +using Microsoft.AspNetCore.Http; +using Autofac; + +using Autofac.Core; +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Utility; +using Microsoft.Legal.MatterCenter.Repository; +using Microsoft.Legal.MatterCenter.Service.Filters; +using System.Globalization; +using Microsoft.Legal.MatterCenter.Web.Common; + +using System.IO; +#endregion + + +namespace Microsoft.Legal.MatterCenter.ServiceTest +{ + public class Startup + { + #region Properties + public IHostingEnvironment HostingEnvironment { get; } + public ILoggerFactory LoggerFactory { get; } + public IConfigurationRoot Configuration { get; set; } + + #endregion + + public Startup(IHostingEnvironment env, ILoggerFactory logger) + { + this.HostingEnvironment = env; + this.LoggerFactory = logger; + + + string projectName = env.ApplicationName; + int projLength = projectName.Length; + string path = env.ContentRootPath; + int index = path.IndexOf(projectName); + int last = index + projLength; + string basePath = path.Remove(last); + + var builder = new ConfigurationBuilder() + .SetBasePath(basePath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddEnvironmentVariables(); + + if (HostingEnvironment.IsDevelopment()) + { + // This will push telemetry data through Application Insights pipeline faster, allowing you to view results immediately. + builder.AddApplicationInsightsSettings(developerMode: true); + } + + Configuration = builder.Build(); + } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + KeyVaultHelper keyVaultHelper = new KeyVaultHelper(Configuration); + KeyVaultHelper.GetCert(Configuration); + keyVaultHelper.GetKeyVaultSecretsCerticate(); + services.AddSingleton(Configuration); + ConfigureSettings(services); + services.AddCors(); + services.AddLogging(); + ConfigureMvc(services, LoggerFactory); + // Add framework services. + services.AddApplicationInsightsTelemetry(Configuration); + services.AddMvcCore(); + ConfigureMatterPackages(services); + ConfigureSwagger(services); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory + //,IOptionsMonitor generalSettings, + //IOptionsMonitor taxonomySettings, + //IOptionsMonitor matterSettings, + //IOptionsMonitor documentSettings, + //IOptionsMonitor sharedSettings, + //IOptionsMonitor mailSettings, + //IOptionsMonitor listNames, + //IOptionsMonitor logTables, + //IOptionsMonitor searchSettings, + //IOptionsMonitor camlQueries, + //IOptionsMonitor contentTypesConfig, + //IOptionsMonitor matterCenterApplicationInsights + ) + { + //CreateConfig(env); + + var log = loggerFactory.CreateLogger(); + try + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + + //generalSettings.OnChange(genSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", genSettings)}"); + + //}); + //taxonomySettings.OnChange(taxSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", taxSettings)}"); + //}); + //matterSettings.OnChange(matSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", matSettings)}"); + //}); + //documentSettings.OnChange(docSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", docSettings)}"); + //}); + //sharedSettings.OnChange(shrdSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", shrdSettings)}"); + //}); + //mailSettings.OnChange(mlSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", mlSettings)}"); + //}); + //listNames.OnChange(lstNames => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", lstNames)}"); + //}); + //logTables.OnChange(logSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", logSettings)}"); + //}); + //searchSettings.OnChange(srchSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", srchSettings)}"); + //}); + //camlQueries.OnChange(camlSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", camlSettings)}"); + //}); + //contentTypesConfig.OnChange(ctpSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", ctpSettings)}"); + //}); + + + //matterCenterApplicationInsights.OnChange(appInsightSettings => { + // loggerFactory + // .CreateLogger>() + // .LogDebug($"Config changed: {string.Join(", ", appInsightSettings)}"); + //}); + app.UseApplicationInsightsRequestTelemetry(); + if (env.IsDevelopment()) + { + app.UseBrowserLink(); + app.UseDeveloperExceptionPage(); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseApplicationInsightsExceptionTelemetry(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + CheckAuthorization(app); + app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); + app.UseMvc(); + app.UseSwagger(); + app.UseSwaggerUi(); + } + catch (Exception ex) + { + app.Run( + async context => { + log.LogError($"{ex.Message}"); + context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; + context.Response.ContentType = "text/plain"; + await context.Response.WriteAsync(ex.Message).ConfigureAwait(false); + await context.Response.WriteAsync(ex.StackTrace).ConfigureAwait(false); + }); + + } + } + + // Entry point for the application. + + #region Private Methods + + #region Swagger + private string pathToDoc = "Microsoft.Legal.MatterCenter.Web.xml"; + + private void ConfigureSwagger(IServiceCollection services) + { + services.AddSwaggerGen(); + services.ConfigureSwaggerGen(options => { + options.SingleApiVersion(new Swashbuckle.Swagger.Model.Info + { + Version = "v1", + Title = "Matter Center API Version V1", + Description = "This matter center api is for V1 release" + }); + options.IgnoreObsoleteActions(); + + }); + services.ConfigureSwaggerGen(options => + { + options.DescribeAllEnumsAsStrings(); + options.IgnoreObsoleteProperties(); + + }); + } + + + #endregion + + private void ConfigureMvc(IServiceCollection services, ILoggerFactory logger) + { + var builder = services.AddMvc().AddDataAnnotationsLocalization(); + builder.AddJsonOptions(o => { + o.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + o.SerializerSettings.Converters.Add(new StringEnumConverter()); + o.SerializerSettings.Formatting = Formatting.Indented; + }); + var instrumentationKey = this.Configuration.GetSection("ApplicationInsights").GetSection("InstrumentationKey").Value.ToString(); + builder.AddMvcOptions(o => { o.Filters.Add(new MatterCenterExceptionFilter(logger, instrumentationKey)); }); + } + + + private void ConfigureSettings(IServiceCollection services) + { + services.Configure(this.Configuration.GetSection("General")); + services.Configure(this.Configuration.GetSection("UIConfig")); + services.Configure(this.Configuration.GetSection("Taxonomy")); + services.Configure(this.Configuration.GetSection("Matter")); + services.Configure(this.Configuration.GetSection("Document")); + services.Configure(this.Configuration.GetSection("Shared")); + services.Configure(this.Configuration.GetSection("Mail")); + services.Configure(this.Configuration.GetSection("ErrorMessages")); + services.Configure(this.Configuration.GetSection("ListNames")); + services.Configure(this.Configuration.GetSection("LogTables")); + services.Configure(this.Configuration.GetSection("Search")); + services.Configure(this.Configuration.GetSection("CamlQueries")); + services.Configure(this.Configuration.GetSection("ContentTypes")); + services.Configure(this.Configuration.GetSection("ApplicationInsights")); + + } + + private void ConfigureMatterPackages(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + + private void CheckAuthorization(IApplicationBuilder app) + { + app.UseJwtBearerAuthentication(new JwtBearerOptions() + { + AutomaticAuthenticate = true, + Authority = String.Format(CultureInfo.InvariantCulture, + this.Configuration.GetSection("General").GetSection("AADInstance").Value.ToString(), + this.Configuration.GetSection("General").GetSection("Tenant").Value.ToString()), + Audience = this.Configuration.GetSection("General").GetSection("ClientId").Value.ToString(), + Events = new AspNetCore.Authentication.JwtBearer.JwtBearerEvents + { + OnAuthenticationFailed = context => + { + return Task.FromResult(0); + } + } + }); + } + + private void CreateConfig(IHostingEnvironment env) + { + + string destPath = Path.Combine(env.WebRootPath, "app/config.js"); + System.IO.File.WriteAllText(destPath, string.Empty); + TextWriter tw = new StreamWriter(destPath); + tw.WriteLine("var configs = { \"uri\": {"); + tw.WriteLine(" \"SPOsiteURL\": \"" + Configuration["General:SiteURL"] + "\","); + tw.WriteLine(" \"tenant\": \"" + Configuration["General:Tenant"] + "\","); + tw.WriteLine("}, \"ADAL\" : { "); + tw.WriteLine(" \"clientId\": \"" + Configuration["General:ClientId"] + "\""); + tw.WriteLine("}};"); + + tw.Close(); + } + + #endregion + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/appsettings.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/appsettings.json new file mode 100644 index 00000000..a68f873f --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/appsettings.json @@ -0,0 +1,344 @@ +{ + "ApplicationInsights": { + "InstrumentationKey": "0f913235-fa70-4fa4-ae7c-c753d2e0c35d", + "InstrumentationAPIAccessKey": "jitaljj3y403hk2vq7156v7zxsiia34a1oz8doqk", + "ApplicationId": "197f9f0f-e733-4530-ac97-72e9410b3533" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + }, + "Matter": { + "ProvisionMatterAppURL": "https://msmatter.sharepoint.com/sites/catalog/MatterCenter", + "CentralRepositoryUrl": "https://msmatter.sharepoint.com/sites/catalog", + "EditMatterAllowedPermissionLevel": "Full Control", + "ColumnNameGuid": "GUID", + "RoleListColumnRoleName": "RoleName", + "RoleListColumnIsRoleMandatory": "Mandatory", + "OneNoteLibrarySuffix": "_OneNote", + "CalendarNameSuffix": "_Calendar", + "TaskNameSuffix": "_Task", + "SendMailListName": "SendMail", + "SpecialCharacterExpressionMatterTitle": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*", + "SpecialCharacterExpressionMatterId": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*", + "SpecialCharacterExpressionMatterDescription": "[A-Za-z0-9_]+[-A-Za-z0-9_, .]*", + "SpecialCharacterExpressionContentType": "[@\\/:*?#%<>{}|~&\"]", + "MatterIdLength": 75, + "MatterNameLength": 75, + "ContentTypeLength": 128, + "MatterDescriptionLength": 255, + "UserPermissions": "Contribute,Full Control,Read", + "MatterLandingPageRepositoryName": "Site Pages", + "StampedPropertyMatterGUID": "MatterGUID", + "StampedPropertyMatterCenterUsers": "MatterCenterUsers", + "StampedPropertyMatterCenterPermissions": "MatterCenterPermissions", + "StampedPropertyMatterCenterRoles": "MatterCenterRoles", + "StampedPropertyResponsibleAttorney": "ResponsibleAttorney", + "StampedPropertyTeamMembers": "TeamMembers", + "StampedPropertyBlockedUploadUsers": "BlockedUploadUsers", + "StampedPropertyMatterCenterUserEmails": "MatterCenterUserEmails", + "StampedPropertyPracticeGroup": "PracticeGroup", + "StampedPropertyAreaOfLaw": "AreaOfLaw", + "StampedPropertySubAreaOfLaw": "SubAreaOfLaw", + "StampedPropertyMatterName": "MatterName", + "StampedPropertyMatterID": "MatterID", + "StampedPropertyClientName": "ClientName", + "StampedPropertyClientID": "ClientID", + "StampedPropertyIsMatter": "IsMatter", + "StampedPropertyOpenDate": "OpenDate", + "StampedPropertySecureMatter": "SecureMatter", + "StampedPropertyMatterDescription": "MatterDescription", + "StampedPropertyConflictCheckDate": "MatterConflictCheckDate", + "StampedPropertyConflictCheckBy": "MatterConflictCheckBy", + "StampedPropertyDefaultContentType": "MatterCenterDefaultContentType", + "StampedPropertyIsConflictIdentified": "IsConflictIdentified", + "StampedPropertyDocumentTemplateCount": "DocumentTemplateCount", + "StampedPropertyBlockedUsers": "BlockedUsers", + "StampedPropertySuccess": "Success", + "PropertyNameVtiIndexedPropertyKeys": "vti_indexedpropertykeys", + "IsContentCheck": true, + "IsCreateCalendarEnabled": true, + "IsMajorVersionEnable": true, + "IsMinorVersionEnable": true, + "IsForceCheckOut": true, + "TitleListsPath": "Lists", + "MattersListColumnTitle": "Title", + "MattersListColumnClientName": "ClientName", + "MattersListColumnClientID": "ClientID", + "MattersListColumnMatterName": "MatterName", + "MattersListColumnMatterID": "MatterID", + "MattersListColumnConflictCheckBy": "ConflictCheckBy", + "MattersListColumnConflictCheckOn": "ConflictCheckOn", + "MattersListColumnConflictIdentified": "ConflictIdentified", + "MattersListColumnBlockUsers": "BlockUsers", + "MattersListColumnManagingAttorney": "ManagingAttorney", + "MattersListColumnSupport": "Support", + "MatterLandingPageSections": "taskPane,calendarPane,matterCenterFooter,matterInfo,matterCenterHeader,rssPane,oneNotePane", + "CommonCSSFileLink": "/sites/catalog/SiteAssets/{0}/Styles/spCommon.css", + "JQueryFileName": "/sites/catalog/SiteAssets/{0}/Scripts/jquery-1.11.1.min.js", + "CommonFolderName": "Matter Center Assets/Common Assets", + "MatterLandingFolderName": "Matter Center Assets/Matter Landing Assets", + "MatterLandingCSSFileName": "/sites/catalog/SiteAssets/{0}/Styles/MatterLanding.css", + "CommonJSFileLink": "/sites/catalog/SiteAssets/{0}/Scripts/spCommon.js", + "MatterLandingJSFileName": "/sites/catalog/SiteAssets/{0}/Scripts/MatterLanding.js", + "ShareListColumnMatterPath": "MatterPath", + "ShareListColumnMailList": "MailList" + }, + "Taxonomy": { + "PracticeGroupTermSetName": "Practice Groups", + "ClientTermSetName": "Clients", + "PracticeGroupCustomPropertyFolderNames": "FolderNames", + "AreaCustomPropertyFolderNames": "FolderNames", + "SubAreaCustomPropertyFolderNames": "FolderNames", + "SubAreaCustomPropertyisNoFolderStructurePresent": "isNoFolderStructurePresent", + "SubAreaOfLawDocumentTemplates": "DocumentTemplates", + "ClientCustomPropertiesId": "ClientID", + "Levels": 5, + "ClientTermPath": "/" + }, + "Document": { + "FolderStructureModified": "The folder <span class=\"overWriteContent\">{0}</span> no longer exists in the Matter Library. Reload the pop up to refresh the folder structure.", + "TempEmailName": "MatterCenter", + "MailCartMailSubject": "Matter Center Document(s)", + "MailCartMailBody": "Please find requested files attached to this email.", + "TimeStampFormat": "yyyy-MM-ddTHH:mm:ss_fffZ" + }, + "Shared": { + "MatterCenterPages": "AppLandingPage;SearchMatter;SearchDocument;WebDashboard;ProvisionMatter", + "ContextualHelpLinksColumnLinkOrder": "LinkOrder", + "ContextualHelpLinksColumnLinkTitle": "LinkTitle0", + "ContextualHelpLinksColumnLinkURL": "LinkURL", + "ContextualHelpLinksColumnSectionID": "SectionID", + "ContextualHelpSectionColumnSectionID": "SectionID", + "ContextualHelpSectionColumnPageName": "PageName", + "ContextualHelpSectionColumnNumberOfColumns": "NumberOfColumns", + "ContextualHelpSectionColumnSectionOrder": "SectionOrder", + "ContextualHelpSectionColumnSectionTitle": "SectionTitle" + }, + "General": { + "Tenant": "msmatter.onmicrosoft.com", + "AADInstance": "https://login.windows.net/{0}", + "Resource": "https://msmatter.sharepoint.com", + "RedisCacheHostName": "msmatterMatterCenterCache.redis.cache.windows.net:6380,password=wR5myDQD6wJqpnQ8E+ND/dM1njpDNB0YIRfy4jzLpMg=,ssl=True,abortConnect=False", + "IsTenantDeployment": true, + "IsReadOnlyUser": "IsReadOnlyUser", + "SiteURL": "https://msmatter.sharepoint.com", + "CentralRepositoryUrl": "https://msmatter.sharepoint.com/sites/catalog", + "ExchangeServiceURL": "https://outlook.office365.com/ews/Exchange.asmx", + "KeyVaultURI": "https://matterkeyvault.vault.azure.net:443", + "KeyVaultClientID": "7f8cbaa5-fd63-43c5-8016-0374efc7b035", + "KeyVaultCertThumbPrint": "829a88ad167228e5e73d041cf1bf576ad9a3fce9" + }, + "ClientCredentials": { + "ClientResource": "https://microsoft.onmicrosoft.com/mcuiadal", + "Authority": "https://login.windows.net/microsoft.onmicrosoft.com" + }, + "CamlQueries": { + "UserPinnedDetailsQuery": "{1}", + "AllFoldersQuery": "{0}1", + "RetrieveContextualHelpSectionsQuery": "{0}", + "ContextualHelpQueryIncludeOrCondition": "{1};{0}", + "RetrieveContextualHelpLinksQuery": "{0}", + "DMSRoleQuery": "", + "MatterConfigurationsListQuery": "{1}", + "ViewOrderByQuery": "", + "GetAllFilesInFolderQuery": "{0}" + }, + "Search": { + "SearchResultSourceID": "b1eaa66b-033f-426e-8020-9eb7e7e68133", + "ManagedPropertyTitle": "Title", + "ManagedPropertyName": "Name", + "ManagedPropertyDescription": "Description", + "ManagedPropertySiteName": "SiteName", + "ManagedPropertyLastModifiedTime": "LastModifiedTime", + "ManagedPropertyPracticeGroup": "MCPracticeGroup", + "ManagedPropertyAreaOfLaw": "MCAreaofLaw", + "ManagedPropertySubAreaOfLaw": "MCSubAreaofLaw", + "ManagedPropertyMatterId": "MCMatterID", + "ManagedPropertyCustomTitle": "RefinableString10", + "ManagedPropertyPath": "Path", + "ManagedPropertyMatterName": "MCMatterName", + "ManagedPropertyOpenDate": "MCOpenDate", + "ManagedPropertyClientName": "MCClientName", + "ManagedPropertyBlockedUploadUsers": "MCBlockedUploadUser", + "ManagedPropertyResponsibleAttorney": "MCResponsibleAttorney", + "ManagedPropertyClientID": "MCClientID", + "ManagedPropertyMatterGuidLogging": "", + "ManagedPropertyTeamMembers": "MCTeamMembers", + "ManagedPropertyFileName": "FileName", + "ManagedPropertyDocumentCheckOutUser": "MCCheckoutUser", + "ManagedPropertyCreated": "Created", + "ManagedPropertyMatterGuid": "MatterCenterMatterGUID", + "ManagedPropertyIsMatter": "MCIsMatter", + "ManagedPropertyDocumentLastModifiedTime": "MCModifiedDate", + "FindDocumentInvalidExtensions": "aspx,html,htm,css,js,mht,one,onetoc2,onepkg,onetoc,svc,asmx,exe,dll,config,cer,pfx,ps1,xml,xslt", + "ManagedPropertyAuthor": "MSITOfficeAuthor", + "ManagedPropertyDocumentClientId": "MCDocumentClientID", + "ManagedPropertyDocumentMatterId": "RefinableString12", + "ManagedPropertyDocumentClientName": "MCDocumentClientName", + "ManagedPropertyUIVersionStringOWSTEXT": "UIVersionStringOWSTEXT", + "ManagedPropertyServerRelativeUrl": "ServerRelativeURL", + "ManagedPropertyFileExtension": "FileExtension", + "ManagedPropertySiteTitle": "SiteTitle", + "ManagedPropertyDocumentMatterName": "RefinableString13", + "ManagedPropertyDocumentId": "dlcDocIdOWSText", + "ManagedPropertyCheckOutByUser": "CheckoutUserOWSUSER", + "ManagedPropertySPWebUrl": "SPWebUrl", + "ManagedPropertyDocumentVersion": "MCVersionNumber", + "ManagedPropertyIsDocument": "IsDocument", + "PinnedListColumnUserAlias": "UserAlias", + "PinnedListColumnMatterDetails": "UserPinDetails", + "PinnedListColumnDocumentDetails": "UserPinDocumentDetails", + "ColumnNameFileLeafRef": "FileLeafRef", + "ColumnNameFileRef": "FileRef", + "ColumnNameFileDirRef": "FileDirRef", + "UserPermissions": "Contribute,Full Control,Read", + "PeoplePickerAllowMultipleEntities": false, + "PeoplePickerMaximumEntitySuggestions": 500, + "PeoplePickerMaxRecords": 30, + "MatterConfigurationTitleValue": "Matter Configurations", + "ColumnNameModifiedDate": "Modified", + "MatterConfigurationColumn": "ConfigurationValue" + }, + "Mail": { + "SearchEmailTo": "DMS_To", + "SearchEmailSubject": "DMS_Subject", + "SearchEmailSentDate": "SentDate", + "SearchEmailSensitivity": "Sensitivity", + "SearchEmailReceivedDate": "ReceivedDate", + "SearchEmailImportance": "DMS_Mail_Importance", + "SearchEmailHasAttachments": "HasAttachments", + "SearchEmailFromMailbox": "DMS_From_MailBox", + "SearchEmailFrom": "DMS_From", + "SearchEmailConversationTopic": "ConversationTopic", + "SearchEmailCC": "DMS_Cc", + "SearchEmailCategories": "EmailCategories", + "SearchEmailAttachments": "DMS_Attachments", + "SearchEmailConversationId": "ConversationId", + "MatterMailBodyMatterInformation": "
Matter Information:
Client Name: {0}
Client ID: {1}
Matter Name: {2}
Matter ID: {3}
Matter Description: {4}
Matter Type: {5}
", + "MatterMailDefaultContentTypeHtmlChunk": "{0}", + "MatterMailSubject": "New Matter: {0} | {1} is provisioned by {2}", + "ShareListColumnMailBody": "MailBody", + "ShareListColumnMailSubject": "MailSubject", + "MatterMailBodyConflictCheck": "
Conflict Check:
Conducted: {0}
Conducted by: {1}
Date: {2}
Conflict Identified: {3}
", + "MatterMailBodyTeamMembers": "
Is Matter secured only to the assigned team: {0}
Team Members:
{1}{2}
You can now access OneNote {5} and Site {7} of this Matter.
", + "SearchEmailOriginalName": "OriginalName", + "NoMailSubject": "Untitled", + "SearchEmailFileSize": "File_x0020_Size", + "SentDateTolerance": 2 + }, + "ErrorMessages": { + "AuthorizationLengthError": "Authorization token array length must be 2", + "NoBearerStringPresent": "Authorization token doesnot contain text of type 'Bearer", + "MessageNoInputs": "No Inputs", + "MessageNoResult": "No data found for the given input criteria", + "PeoplePickerNoResults": "No results found", + "UserNotSiteOwnerCode": 128, + "UserNotSiteOwnerMessage": "You do not have permission to create matter for this client", + "IncorrectInputClientUrlCode": "101", + "IncorrectInputClientUrlMessage": "Incorrect Inputs", + "IncorrectInputClientIdCode": "102", + "IncorrectInputClientIdMessage": "Incorrect Inputs", + "IncorrectInputClientNameCode": "103", + "IncorrectInputClientNameMessage": "Incorrect Inputs", + "IncorrectInputUserAccessCode": "127", + "IncorrectInputUserAccessMessage": "Incorrect Inputs", + "IncorrectInputMatterNameCode": "108", + "IncorrectInputMatterNameMessage": "Incorrect Inputs", + "IncorrectInputMatterIdCode": "109", + "IncorrectInputMatterIdMessage": "Incorrect Inputs", + "IncorrectInputMatterDescriptionCode": "113", + "IncorrectInputMatterDescriptionMessage": "Incorrect Inputs", + "IncorrectInputConflictDateCode": "114", + "IncorrectInputConflictDateMessage": "Incorrect Inputs", + "IncorrectInputConflictIdentifiedCode": "115", + "IncorrectInputConflictIdentifiedMessage": "Incorrect Inputs", + "IncorrectInputBlockUserNamesCode": "118", + "IncorrectInputBlockUserNamesMessage": "Incorrect Inputs", + "IncorrectInputConflictCheckByCode": "117", + "IncorrectInputConflictCheckByMessage": "Incorrect Inputs", + "IncorrectInputUserRolesCode": "116", + "IncorrectInputUserRolesMessage": "Incorrect Inputs", + "IncorrectInputUserNamesCode": "110", + "IncorrectInputUserNamesMessage": "Incorrect Inputs", + "IncorrectInputUserPermissionsCode": "111", + "IncorrectInputUserPermissionsMessage": "Incorrect Inputs", + "IncorrectInputContentTypeCode": "112", + "IncorrectInputContentTypeMessage": "Incorrect Inputs", + "ErrorEditMatterMandatoryPermission": "Please provide at least one user who has Full Control permission on this matter.", + "IncorrectInputPracticeGroupCode": "104", + "IncorrectInputPracticeGroupMessage": "Incorrect Inputs", + "IncorrectInputAreaOfLawCode": "105", + "IncorrectInputAreaOfLawMessage": "Incorrect Inputs", + "IncorrectInputSubareaOfLawCode": "106", + "IncorrectInputSubareaOfLawMessage": "Incorrect Inputs", + "IncorrectInputResponsibleAttorneyCode": "107", + "IncorrectInputResponsibleAttorneyMessage": "Incorrect Inputs", + "ErrorCodeSecurityGroupExists": "125", + "ErrorMessageSecurityGroupExists": "Security Groups are not allowed for matters where conflicts are identified. Remove all Security Groups to proceed.", + "IncorrectTeamMembersCode": "126", + "IncorrectTeamMembersMessage": "Please enter valid team members.", + "IncorrectInputSelfPermissionRemoval": "124", + "ErrorCodeCalendarCreation": "-900000003", + "ErrorMessageCalendarCreation": "An error occurred while assigning permissions to calendar list", + "ErrorCodeAddTaskList": "-900000006", + "ErrorMessageTaskCreation": "An error occurred while assigning permission to task list", + "ErrorCodeContentType": "-900000001", + "ErrorMessageContentType": "The selected Content Type is not present in the collection", + "ErrorEmptyFile": "We can't upload folders or empty files", + "FoundIdenticalContent": "The document you are trying to upload has identical content and the same file name as an existing file.", + "FoundNonIdenticalContent": "The two documents do not have identical content.", + "ContentCheckFailed": "Unable to perform content check", + "FilePotentialDuplicateMessage": "The file {0} might be a duplicate of a similar existing document in the folder. You can run a content check for a full text comparison, save the file without a comparison, or cancel the upload.
Note: Depending on the file size, a content check may take some time and you can't navigate away from this screen until the check is complete.
", + "FileAlreadyExistMessage": "The file {0} already exists in the folder. Do you want to overwrite it?", + "MatterLibraryExistsCode": "201", + "ErrorDuplicateMatter": "Please enter a different Matter name. A matter with same name already exists.", + "MatterLandingExistsCode": "202", + "ErrorDuplicateMatterLandingPage": "Landing page of this Matter is already created. Kindly delete existing landing page or please enter a different Matter name.", + "ErrorCodeAddCalendarList": "-900000004", + "ErrorMessageAddCalendarList": "An error occurred while creating calendar list", + "ErrorMessageAddTaskList": "An error occurred while creating task list", + "ErrorCodeMatterLandingPageExists": "-900000005", + "ErrorInvalidCharacter": "Invalid characters in file name. Following characters are not allowed in file name: ~ # % &amp; * : &lt; &gt; ? / \"{ | }", + "FolderStructureModified": "The folder <span class=\"overWriteContent\">{0}</span> no longer exists in the Matter Library. Reload the pop up to refresh the folder structure." + }, + "ListNames": { + "SendMailListName": "SendMail", + "UserPinnedDocumentListName": "UserPinnedDetails", + "UserPinnedMatterListName": "UserPinnedMatter", + "MatterCenterHelpSectionListName": "MatterCenterHelpSection", + "MatterCenterHelpLinksListName": "MatterCenterHelpLinks", + "DMSRoleListName": "MatterCenterRoles", + "DMSMatterListName": "MatterCenterMatters", + "MatterConfigurationsList": "Matter Configurations", + "MatterCenterExternalRequests": "MatterCenterExternalRequests" + }, + "LogTables": { + "ServiceLogTable": "MatterCenterLogStorage", + "SPOLogTable": "SPOLogTable", + "EventViewerSource": "LCADMS", + "EventViewerEventID": "1001", + "EventViewerLogName": "LCADMS", + "AzureRowKeyDateFormat": "MM-dd-yyyy HH:mm:ss:fffffff", + "IsLoggingOnAzure": true, + "ExternalAccessRequests": "ExternalAccessRequests" + }, + "ContentTypes": { + "ContentTypeColumnClientId": "Client_Id", + "ContentTypeColumnClientName": "Client_Name", + "ContentTypeColumnMatterId": "Matter_Id", + "ContentTypeColumnMatterName": "Matter_Name", + "ContentTypeColumnPracticeGroup": "PracticeGroup", + "ContentTypeColumnAreaOfLaw": "AreaOfLaw", + "ContentTypeColumnSubareaOfLaw": "SubareaOfLaw", + "OneDriveContentTypeGroup": "_MatterCenter", + "HiddenContentType": "Folder", + "ViewColumnList": "Type;DMS_Mail_Importance;DMS_From;DMS_Subject;ReceivedDate;DMS_To;DMS_Cc;DMS_From_MailBox;Sensitivity;EmailCategories;ConversationId;ConversationTopic;HasAttachments;SentDate;LinkFilename;OriginalName", + "ViewOrderByColumn": "ReceivedDate", + "ViewName": "Outlook View" + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-512-transparent.png b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-512-transparent.png new file mode 100644 index 00000000..3e851277 Binary files /dev/null and b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-512-transparent.png differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-64-transparent.png b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-64-transparent.png new file mode 100644 index 00000000..dde2760a Binary files /dev/null and b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/logo-64-transparent.png differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/project.json new file mode 100644 index 00000000..702c5412 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.ServiceTest/project.json @@ -0,0 +1,25 @@ +{ + "version": "1.0.0-*", + "description": "", + "authors": [ "" ], + "tooling": { + "defaultNamespace": "<%= namespace %>" + }, + "dependencies": { + "Microsoft.Legal.MatterCenter.Web": "1.0.0-*", + "Microsoft.AspNetCore.TestHost": "1.0.0", + "xunit": "2.2.0-beta2-build3300", + "xunit.runners": "2.0.0-rc4-build2924", + "Moq": "4.6.36-alpha", + "Microsoft.AspNet.WebApi.Client": "5.2.3", + "dotnet-test-xunit": "2.2.0-preview2-build1029", + "Autofac": "4.0.0" + }, + "commands": { + "test": "xunit.runner.dnx" + }, + "testRunner": "xunit", + "frameworks": { + "net46": {} + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/ISPOAuthorization.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/ISPOAuthorization.cs new file mode 100644 index 00000000..dbbab87e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/ISPOAuthorization.cs @@ -0,0 +1,16 @@ +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Models; +using Microsoft.SharePoint.Client; +#endregion + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// An interface for SPOAuthorization which is mapped in the StartUp.cs + /// + public interface ISPOAuthorization + { + //ErrorResponse ValidateClientToken(string authToken); + ClientContext GetClientContext(string url); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/SPOAuthorization.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/SPOAuthorization.cs new file mode 100644 index 00000000..cc10aa26 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Authorization/SPOAuthorization.cs @@ -0,0 +1,149 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** + +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Options; +using Microsoft.SharePoint.Client; +using Microsoft.IdentityModel.Clients.ActiveDirectory; +using System.Globalization; +using Microsoft.AspNetCore.Http; + +#region Matter Namespaces +using Microsoft.Legal.MatterCenter.Models; +using System.Reflection; +#endregion + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This class is used for reading authorization token which has been sent by the client.This + /// class will validate the client token, get the token for the service from Azure Active Directory + /// and pass the service token to sharepoint + /// + public class SPOAuthorization: ISPOAuthorization + { + private GeneralSettings generalSettings; + private ErrorSettings errorSettings; + private ICustomLogger customLogger; + private LogTables logTables; + private string accessToken; + private string accountName; + private IHttpContextAccessor httpContextAccessor; + /// + /// Constructor where GeneralSettings and ErrorSettings are injected + /// + /// + /// + public SPOAuthorization(IOptions generalSettings, + IOptions errorSettings, + IOptions logTables, + ICustomLogger customLogger, + IHttpContextAccessor httpContextAccessor) + { + this.generalSettings = generalSettings.Value; + this.errorSettings = errorSettings.Value; + this.customLogger = customLogger; + this.logTables = logTables.Value; + this.httpContextAccessor = httpContextAccessor; + } + + /// + /// Get HttpContext object from IHttpContextAccessor to read Http Request Headers + /// + private HttpContext Context => httpContextAccessor.HttpContext; + + /// + /// This method will get the access token for the service and creats SharePoint ClientContext object and returns that object + /// + /// The SharePoint Url for which the client context needs to be creatwed + /// ClientContext - Return SharePoint Client Context Object + public ClientContext GetClientContext(string url) + { + try + { + string accessToken = GetAccessToken().Result; + return GetClientContextWithAccessToken(Convert.ToString(url, CultureInfo.InvariantCulture), accessToken); + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// This method will get access for the web api from the Azure Active Directory. + /// This method internally uses the Authorization token sent by the UI application + /// + /// Access Token for the web api service + private async Task GetAccessToken() + { + try + { + string clientId = generalSettings.ClientId; + string appKey = generalSettings.AppKey; + string aadInstance = generalSettings.AADInstance; + string tenant = generalSettings.Tenant; + string resource = generalSettings.Resource; + ClientCredential clientCred = new ClientCredential(clientId, appKey); + string accessToken = Context.Request.Headers["Authorization"].ToString().Split(' ')[1]; + UserAssertion userAssertion = new UserAssertion(accessToken); + string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant); + //ToDo: Set the TokenCache to null. Need to implement custom token cache to support multiple users + //If we dont have the custom cache, there will be some performance overhead. + AuthenticationContext authContext = new AuthenticationContext(authority, null); + AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred, userAssertion); + return result.AccessToken; + } + catch(AggregateException ex) + { + throw; + } + catch(Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + + /// + /// Uses the specified access token to create a client context. For each and every request to SPO + /// an authorization header will be sent. With out authorization header, SPO will reject the request + /// + /// URL of the target SharePoint site + /// Access token to be used when calling the specified targetUrl + /// A ClientContext ready to call targetUrl with the specified access token + private ClientContext GetClientContextWithAccessToken(string targetUrl, string accessToken) + { + try + { + ClientContext clientContext = new ClientContext(targetUrl); + clientContext.AuthenticationMode = ClientAuthenticationMode.Anonymous; + clientContext.FormDigestHandlingEnabled = false; + clientContext.ExecutingWebRequest += + delegate (object oSender, WebRequestEventArgs webRequestEventArgs) + { + //For each SPO request, need to set bearer token to the Authorization request header + webRequestEventArgs.WebRequestExecutor.RequestHeaders["Authorization"] = + "Bearer " + accessToken; + }; + return clientContext; + } + catch (Exception ex) + { + customLogger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, logTables.SPOLogTable); + throw; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/CamlQueries.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/CamlQueries.cs new file mode 100644 index 00000000..2eb87468 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/CamlQueries.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class CamlQueries + { + public string UserPinnedDetailsQuery { get; set; } + public string AllFoldersQuery { get; set; } + public string RetrieveContextualHelpSectionsQuery { get; set; } + public string ContextualHelpQueryIncludeOrCondition { get; set; } + public string RetrieveContextualHelpLinksQuery { get; set; } + public string DMSRoleQuery { get; set; } + public string MatterConfigurationsListQuery { get; set;} + public string ViewOrderByQuery { get; set; } + public string GetAllFilesInFolderQuery { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ContentTypesConfig.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ContentTypesConfig.cs new file mode 100644 index 00000000..f214e8be --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ContentTypesConfig.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class ContentTypesConfig + { + public string ContentTypeColumnClientId + { + get; set; + } + public string ContentTypeColumnClientName + { + get; set; + } + public string ContentTypeColumnMatterId + { + get; set; + } + public string ContentTypeColumnMatterName + { + get; set; + } + public string ContentTypeColumnPracticeGroup + { + get; set; + } + public string ContentTypeColumnAreaOfLaw + { + get; set; + } + public string ContentTypeColumnSubareaOfLaw + { + get; set; + } + public string OneDriveContentTypeGroup + { + get; set; + } + public string HiddenContentType { get; set; } + public string ViewColumnList { get; set; } + public string ViewOrderByColumn { get; set; } + public string ViewName { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/DocumentSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/DocumentSettings.cs new file mode 100644 index 00000000..8bc4d2e2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/DocumentSettings.cs @@ -0,0 +1,27 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the document configuration information from the appSettings.json file + /// These properties will subsequently used when getting the document information from SPO + /// + public class DocumentSettings + { + public string FolderStructureModified { get; set; } + public string TempEmailName { get; set; } + public string MailCartMailSubject { get; set; } + public string MailCartMailBody { get; set; } + public string SendAsEmailFormat { get; set; } + public string TimeStampFormat { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ErrorSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ErrorSettings.cs new file mode 100644 index 00000000..94bccb9b --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ErrorSettings.cs @@ -0,0 +1,117 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting all the error messages that are used in matter center from the appSettings.json file + /// These properties will subsequently used where ever exceptions messages needs to be set + /// + public class ErrorSettings + { + public string IncorrectInputClientUrlCode { get; set; } + public string IncorrectInputClientUrlMessage { get; set; } + public string AuthorizationLengthError { get; set; } + public string NoBearerStringPresent { get; set; } + public string MessageNoInputs { get; set; } + public string MessageNoResult { get; set; } + public string PeoplePickerNoResults { get; set; } + + + + #region Error Code + public string UserNotSiteOwnerCode { get; set; } + public string UserNotSiteOwnerMessage { get; set; } + public string IncorrectInputUserAccessCode { get; set; } + public string IncorrectInputUserAccessMessage { get; set; } + public string IncorrectInputClientIdCode { get; set; } + public string IncorrectInputClientIdMessage { get; set; } + + public string IncorrectInputClientNameCode { get; set; } + public string IncorrectInputClientNameMessage { get; set; } + + public string IncorrectInputMatterNameCode { get; set; } + public string IncorrectInputMatterNameMessage { get; set; } + + public string IncorrectInputMatterIdCode { get; set; } + public string IncorrectInputMatterIdMessage { get; set; } + + public string IncorrectInputMatterDescriptionCode { get; set; } + public string IncorrectInputMatterDescriptionMessage { get; set; } + + public string IncorrectInputConflictDateCode { get; set; } + public string IncorrectInputConflictDateMessage { get; set; } + public string IncorrectInputConflictIdentifiedCode { get; set; } + public string IncorrectInputConflictIdentifiedMessage { get; set; } + public string IncorrectInputBlockUserNamesCode { get; set; } + public string IncorrectInputBlockUserNamesMessage { get; set; } + public string IncorrectInputConflictCheckByCode { get; set; } + public string IncorrectInputConflictCheckByMessage { get; set; } + public string IncorrectInputUserRolesCode { get; set; } + public string IncorrectInputUserRolesMessage { get; set; } + + public string IncorrectInputUserNamesCode { get; set; } + public string IncorrectInputUserNamesMessage { get; set; } + public string IncorrectInputUserPermissionsCode { get; set; } + public string IncorrectInputUserPermissionsMessage { get; set; } + public string IncorrectInputContentTypeCode { get; set; } + public string IncorrectInputContentTypeMessage { get; set; } + public string ErrorEditMatterMandatoryPermission { get; set; } + + + public string IncorrectInputPracticeGroupCode { get; set; } + public string IncorrectInputPracticeGroupMessage { get; set; } + public string IncorrectInputAreaOfLawCode { get; set; } + public string IncorrectInputAreaOfLawMessage { get; set; } + public string IncorrectInputSubareaOfLawCode { get; set; } + public string IncorrectInputSubareaOfLawMessage { get; set; } + public string IncorrectInputResponsibleAttorneyCode { get; set; } + public string IncorrectInputResponsibleAttorneyMessage { get; set; } + + public string ErrorCodeSecurityGroupExists { get; set; } + public string ErrorMessageSecurityGroupExists { get; set; } + + public string IncorrectTeamMembersCode { get; set; } + public string IncorrectTeamMembersMessage { get; set; } + public string IncorrectInputSelfPermissionRemoval { get; set; } + + public string MatterLibraryExistsCode { get; set; } + public string ErrorDuplicateMatter { get; set; } + + public string ErrorCodeCalendarCreation { get; set; } + public string ErrorMessageCalendarCreation { get; set; } + + public string ErrorMessageTaskCreation { get; set; } + public string ErrorCodeAddTaskList { get; set; } + public string ErrorCodeContentTypes { get; set; } + public string ErrorMessageContentTypes { get; set; } + public string ErrorEmptyFile { get; set; } + + public string FoundIdenticalContent { get; set; } + public string FoundNonIdenticalContent { get; set; } + public string ContentCheckFailed { get; set; } + public string FilePotentialDuplicateMessage { get; set; } + public string FileAlreadyExistMessage { get; set; } + + public string MatterLandingExistsCode { get; set; } + public string ErrorDuplicateMatterLandingPage { get; set; } + public string ErrorCodeAddCalendarList { get; set; } + public string ErrorMessageAddCalendarList { get; set; } + public string ErrorMessageAddTaskList { get; set; } + + public string ErrorCodeMatterLandingPageExists { get; set; } + public string ErrorInvalidCharacter { get; set; } + public string FolderStructureModified { get; set; } + #endregion + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/GeneralSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/GeneralSettings.cs new file mode 100644 index 00000000..a16b5535 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/GeneralSettings.cs @@ -0,0 +1,39 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the general configuration information from the appSettings.json file + /// These properties will subsequently used for authorizing to spo and storing data into redis cache + /// + public class GeneralSettings + { + public string ClientId { get; set; } + public string AppKey { get; set; } + public string Tenant { get; set; } + public string AADInstance { get; set; } + public string Resource { get; set; } + public string RedisCacheHostName { get; set; } + public bool IsTenantDeployment { get; set; } + public string IsReadOnlyUser { get; set; } + public string SiteURL { get; set; } + public virtual string CentralRepositoryUrl { get; set; } + public virtual string AdminUserName { get; set; } + public virtual string AdminPassword { get; set; } + public string ExchangeServiceURL { get; set; } + public virtual string CloudStorageConnectionString { get; set; } + public string OrgDomainName { get; set; } + public string MatterCenterConfiguration { get; set; } + public string KeyVaultURI { get; set; } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ListNames.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ListNames.cs new file mode 100644 index 00000000..dc0345d8 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/ListNames.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class ListNames + { + public string SendMailListName { get; set; } + public string UserPinnedDocumentListName { get; set; } + public string UserPinnedMatterListName { get; set; } + public string MatterCenterHelpSectionListName { get; set; } + public string MatterCenterHelpLinksListName { get; set; } + public string DMSRoleListName { get; set; } + public string DMSMatterListName { get; set; } + public string MatterConfigurationsList { get; set; } + public string MatterCenterExternalRequests { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/LogTables.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/LogTables.cs new file mode 100644 index 00000000..e4442cf0 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/LogTables.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class LogTables + { + public string ServiceLogTable { get; set; } + public string SPOLogTable { get; set; } + public string EventViewerSource { get; set; } + public string EventViewerEventID { get; set; } + public string EventViewerLogName { get; set; } + + public string AzureRowKeyDateFormat { get; set; } + public bool IsLoggingOnAzure { get; set; } + public string ExternalAccessRequests { get; set; } + public string MatterCenterConfiguration { get; set; } + public string MatterRequests { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MailSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MailSettings.cs new file mode 100644 index 00000000..ce0d69f2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MailSettings.cs @@ -0,0 +1,71 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the mail configuration information from the appSettings.json file + /// These properties will subsequently used when uploading email and email attachments + /// + public class MailSettings + { + //public string ManagedPropertyTitle { get; set; } + //public string ManagedPropertyName { get; set; } + //public string ManagedPropertyDescription { get; set; } + //public string ManagedPropertySiteName { get; set; } + //public string ManagedPropertyLastModifiedTime { get; set; } + //public string ManagedPropertyPracticeGroup { get; set; } + //public string ManagedPropertyAreaOfLaw { get; set; } + //public string ManagedPropertySubAreaOfLaw { get; set; } + //public string ManagedPropertyMatterId { get; set; } + //public string ManagedPropertyCustomTitle { get; set; } + //public string ManagedPropertyPath { get; set; } + //public string ManagedPropertyMatterName { get; set; } + //public string ManagedPropertyOpenDate { get; set; } + //public string ManagedPropertyClientName { get; set; } + //public string ManagedPropertyBlockedUploadUsers { get; set; } + //public string ManagedPropertyResponsibleAttorney { get; set; } + //public string ManagedPropertyClientID { get; set; } + //public string ManagedPropertyMatterGuidLogging { get; set; } + //public string ManagedPropertyTeamMembers { get; set; } + //public string ManagedPropertyFileName { get; set; } + //public string ManagedPropertyDocumentCheckOutUser { get; set; } + //public string ManagedPropertyCreated { get; set; } + + public string MatterMailBodyMatterInformation { get; set; } + public string MatterMailDefaultContentTypeHtmlChunk { get; set; } + public string MatterMailSubject { get; set; } + public string ShareListColumnMailBody { get; set; } + public string ShareListColumnMailSubject { get; set; } + public string MatterMailBodyConflictCheck { get; set; } + public string MatterMailBodyTeamMembers { get; set; } + + public string SearchEmailTo { get; set; } + public string SearchEmailSubject { get; set; } + public string SearchEmailSentDate { get; set; } + public string SearchEmailSensitivity { get; set; } + public string SearchEmailReceivedDate { get; set; } + public string SearchEmailImportance { get; set; } + public string SearchEmailHasAttachments { get; set; } + public string SearchEmailFromMailbox { get; set; } + public string SearchEmailFrom { get; set; } + public string SearchEmailConversationTopic { get; set; } + public string SearchEmailCC { get; set; } + public string SearchEmailCategories { get; set; } + public string SearchEmailAttachments { get; set; } + public string SearchEmailConversationId { get; set; } + public string SearchEmailOriginalName { get; set; } + public string NoMailSubject { get; set; } + public string SearchEmailFileSize { get; set; } + public int SentDateTolerance { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterCenterApplicationInsights.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterCenterApplicationInsights.cs new file mode 100644 index 00000000..956f6da1 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterCenterApplicationInsights.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class MatterCenterApplicationInsights + { + public string InstrumentationKey { get; set; } + public string InstrumentationAPIAccessKey { get; set; } + public string ApplicationId { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterSettings.cs new file mode 100644 index 00000000..26da1658 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/MatterSettings.cs @@ -0,0 +1,115 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the matter configuration information from the appSettings.json file + /// These properties will subsequently used when getting the matter information from SPO + /// + public class MatterSettings + { + public string EditMatterAllowedPermissionLevel { get; set; } + public string ColumnNameGuid { get; set; } + public string RoleListColumnRoleName { get; set; } + public string RoleListColumnIsRoleMandatory { get; set; } + public string ColumnNameModifiedDate { get; set; } + public string MatterConfigurationColumn { get; set; } + public string MatterCenterDateFormat { get; set; } + + public string OneNoteLibrarySuffix { get; set; } + public string CalendarNameSuffix { get; set; } + public string TaskNameSuffix { get; set; } + + public string SendMailListName { get; set; } + public string SpecialCharacterExpressionMatterTitle { get; set; } + public string SpecialCharacterExpressionMatterId { get; set; } + public string SpecialCharacterExpressionMatterDescription { get; set; } + public string SpecialCharacterExpressionContentType { get; set; } + public int MatterIdLength { get; set; } + public int MatterNameLength { get; set; } + public bool IsCreateCalendarEnabled { get; set; } + + public int ContentTypeLength { get; set; } + public int MatterDescriptionLength { get; set; } + public string UserPermissions { get; set; } + + public string MatterLandingPageRepositoryName { get; set; } + + + public string StampedPropertyMatterGUID { get; set; } + public string StampedPropertyMatterCenterUsers { get; set; } + public string StampedPropertyMatterCenterPermissions { get; set; } + public string StampedPropertyMatterCenterRoles { get; set; } + public string StampedPropertyResponsibleAttorney { get; set; } + public string StampedPropertyTeamMembers { get; set; } + public string StampedPropertyBlockedUploadUsers { get; set; } + public string StampedPropertyMatterCenterUserEmails { get; set; } + + public string StampedPropertyPracticeGroup { get; set; } + public string StampedPropertyAreaOfLaw { get; set; } + public string StampedPropertySubAreaOfLaw { get; set; } + public string StampedPropertyMatterName { get; set; } + public string StampedPropertyMatterID { get; set; } + public string StampedPropertyClientName { get; set; } + public string StampedPropertyClientID { get; set; } + public string StampedPropertyIsMatter { get; set; } + public string StampedPropertyOpenDate { get; set; } + public string StampedPropertySecureMatter { get; set; } + public string StampedPropertyMatterDescription { get; set; } + public string StampedPropertyConflictCheckDate { get; set; } + public string StampedPropertyConflictCheckBy { get; set; } + public string StampedPropertyDefaultContentType { get; set; } + public string StampedPropertyIsConflictIdentified { get; set; } + public string StampedPropertyDocumentTemplateCount { get; set; } + public string StampedPropertyBlockedUsers { get; set; } + public string StampedPropertySuccess { get; set; } + public string StampedPropertyResponsibleAttorneyEmail { get; set; } + + public string PropertyNameVtiIndexedPropertyKeys { get; set; } + public string ValidDateFormat { get; set; } + public string ShareListColumnMatterPath { get; set; } + public string ShareListColumnMailList { get; set; } + public string DeleteMatterCode { get; set; } + public string MatterDeletedSuccessfully { get; set; } + public string MatterNotPresent { get; set; } + public bool IsContentCheck { get; set; } + + public bool IsMajorVersionEnable { get; set; } + public bool IsMinorVersionEnable { get; set; } + public bool IsForceCheckOut { get; set; } + public string TitleListsPath { get; set; } + + public string MattersListColumnTitle { get; set; } + public string MattersListColumnClientName { get; set; } + public string MattersListColumnClientID { get; set; } + public string MattersListColumnMatterName { get; set; } + public string MattersListColumnMatterID { get; set; } + + public string MattersListColumnConflictCheckBy { get; set; } + public string MattersListColumnConflictCheckOn { get; set; } + public string MattersListColumnConflictIdentified { get; set; } + public string MattersListColumnBlockUsers { get; set; } + + public string MattersListColumnManagingAttorney { get; set; } + public string MattersListColumnSupport { get; set; } + public string MatterLandingPageSections { get; set; } + + + public string CommonCSSFileLink { get; set; } + public string JQueryFileName { get; set; } + public string CommonFolderName { get; set; } + public string MatterLandingFolderName { get; set; } + public string MatterLandingCSSFileName { get; set; } + public string CommonJSFileLink { get; set; } + public string MatterLandingJSFileName { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SearchSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SearchSettings.cs new file mode 100644 index 00000000..bcb3a65a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SearchSettings.cs @@ -0,0 +1,96 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the search configuration information from the appSettings.json file + /// These properties will subsequently used when getting the matter information from SPO + /// + public class SearchSettings + { + public string SearchResultSourceID { get; set; } + + + #region Matter Search Related Properties + public string Schema { get; set; } + public string ManagedPropertyTitle { get; set; } + public string ManagedPropertyName { get; set; } + public string ManagedPropertyDescription { get; set; } + public string ManagedPropertySiteName { get; set; } + public string ManagedPropertyLastModifiedTime { get; set; } + public string ManagedPropertyPracticeGroup { get; set; } + public string ManagedPropertyAreaOfLaw { get; set; } + public string ManagedPropertySubAreaOfLaw { get; set; } + public string ManagedPropertyMatterId { get; set; } + public string ManagedPropertyCustomTitle { get; set; } + public string ManagedPropertyPath { get; set; } + public string ManagedPropertyMatterName { get; set; } + public string ManagedPropertyOpenDate { get; set; } + public string ManagedPropertyClientName { get; set; } + public string ManagedPropertyBlockedUploadUsers { get; set; } + public string ManagedPropertyResponsibleAttorney { get; set; } + public string ManagedPropertyClientID { get; set; } + public string ManagedPropertyMatterGuidLogging { get; set; } + public string ManagedPropertyTeamMembers { get; set; } + public string ManagedPropertyFileName { get; set; } + public string ManagedPropertyDocumentCheckOutUser { get; set; } + public string ManagedPropertyCreated { get; set; } + public string ManagedPropertyMatterGuid { get; set; } + public string ManagedPropertyIsMatter { get; set; } + public string UserPermissions { get; set; } + public string MatterConfigurationTitleValue { get; set; } + public string ColumnNameModifiedDate { get; set; } + public string MatterConfigurationColumn { get; set; } + #endregion + + #region Document Search Related Properties + public string ManagedPropertyDocumentLastModifiedTime { get; set; } + public string FindDocumentInvalidExtensions { get; set; } + public string ManagedPropertyAuthor { get; set; } + public string ManagedPropertyDocumentClientId { get; set; } + public string ManagedPropertyDocumentMatterId { get; set; } + public string ManagedPropertyDocumentClientName { get; set; } + public string ManagedPropertyUIVersionStringOWSTEXT { get; set; } + public string ManagedPropertyServerRelativeUrl { get; set; } + + public string ManagedPropertyFileExtension { get; set; } + public string ManagedPropertySiteTitle { get; set; } + public string ManagedPropertyDocumentMatterName { get; set; } + public string ManagedPropertyDocumentId { get; set; } + public string ManagedPropertyCheckOutByUser { get; set; } + public string ManagedPropertySPWebUrl { get; set; } + public string ManagedPropertyDocumentVersion { get; set; } + public string ManagedPropertyIsDocument { get; set; } + #endregion + + #region Pin + public string PinnedListColumnUserAlias { get; set; } + public string PinnedListColumnMatterDetails { get; set; } + public string PinnedListColumnDocumentDetails { get; set; } + + #endregion + + #region Column Names + public string ColumnNameFileLeafRef { get; set; } + public string ColumnNameFileRef { get; set; } + public string ColumnNameFileDirRef { get; set; } + #endregion + + #region PeoplePicker + public bool PeoplePickerAllowMultipleEntities { get; set; } + public int PeoplePickerMaximumEntitySuggestions { get; set; } + public int PeoplePickerMaxRecords { get; set; } + + #endregion + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SharedSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SharedSettings.cs new file mode 100644 index 00000000..088104c5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/SharedSettings.cs @@ -0,0 +1,32 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the shared settings information from the appSettings.json file + /// These properties will subsequently at multiple places + /// + public class SharedSettings + { + public string MatterCenterPages { get; set; } + public string ContextualHelpSectionColumnSectionID { get; set; } + public string ContextualHelpLinksColumnLinkOrder { get; set; } + public string ContextualHelpLinksColumnLinkTitle { get; set; } + public string ContextualHelpLinksColumnLinkURL { get; set; } + public string ContextualHelpSectionColumnPageName { get; set; } + public string ContextualHelpSectionColumnNumberOfColumns { get; set; } + public string ContextualHelpSectionColumnSectionOrder { get; set; } + public string ContextualHelpSectionColumnSectionTitle { get; set; } + public string ContextualHelpLinksColumnSectionID { get; set; } + + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/TaxonomySettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/TaxonomySettings.cs new file mode 100644 index 00000000..ff7c645d --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/TaxonomySettings.cs @@ -0,0 +1,49 @@ + +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This file is used for getting the taxonomy configuration information from the appSettings.json file + /// These properties will subsequently used when getting the taxonomy information from SPO + /// + public class TaxonomySettings + { + /// + /// Practice Group Term Set name that is configured + /// + public string PracticeGroupTermSetName { get; set; } + /// + /// Client Term Set Name that is configured + /// + public string ClientTermSetName { get; set; } + public string PracticeGroupCustomPropertyFolderNames { get; set; } + public string AreaCustomPropertyFolderNames { get; set; } + public string SubAreaCustomPropertyFolderNames { get; set; } + public string SubAreaCustomPropertyisNoFolderStructurePresent { get; set; } + public string SubAreaOfLawDocumentTemplates { get; set; } + public string ClientCustomPropertiesId { get; set; } + /// + /// Number of level that are configured - Taxonomy Hierarchy + /// + public int Levels { get; set; } + /// + /// Client term location in the taxonomy hierarchy + /// + public string ClientTermPath { get; set; } + public string Level1Name { get; set; } + public string Level2Name { get; set; } + public string Level3Name { get; set; } + public string Level4Name { get; set; } + public string Level5Name { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/UIConfigSettings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/UIConfigSettings.cs new file mode 100644 index 00000000..00c73bfe --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/ConfigSettings/UIConfigSettings.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class UIConfigSettings + { + public virtual string Partitionkey { get; set; } + public virtual string Rowkey { get; set; } + public virtual string ConfigGroup { get; set; } + public virtual string Key { get; set; } + public virtual string Value { get; set; } + public virtual string MatterCenterConfiguration { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterLandingSection.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterLandingSection.cs new file mode 100644 index 00000000..fb61ada2 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterLandingSection.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// Matter Landing page section mapping + /// + public enum MatterLandingSection + { + /// + /// Task panel mapping + /// + TaskPanel, + + /// + /// Calendar panel mapping + /// + CalendarPanel, + + /// + /// Footer panel mapping + /// + FooterPanel, + + /// + /// Information panel mapping + /// + InformationPanel, + + /// + /// Header panel mapping + /// + HeaderPanel, + + /// + /// RSS Title panel mapping + /// + RSSTitlePanel, + + /// + /// OneNote panel mapping + /// + OneNotePanel + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterPrerequisiteCheck.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterPrerequisiteCheck.cs new file mode 100644 index 00000000..403a4795 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/MatterPrerequisiteCheck.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// Represents existence of matter library, OneNote library, Calendar library, Task library and Matter landing page + /// + public enum MatterPrerequisiteCheck + { + /// + /// Represents matter library, OneNote library, calendar library or task library existence + /// + LibraryExists, + + /// + /// Represents matter landing page existence + /// + MatterLandingPageExists + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/ServiceConstants.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/ServiceConstants.cs new file mode 100644 index 00000000..4328a2ee --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/ServiceConstants.cs @@ -0,0 +1,1308 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-lapedd +// Created : 04-07-2016 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// + +// *********************************************************************** + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// All the constants that are used in matter center will be defined here + /// + public class ServiceConstants + { + /// + /// Base64 string format for the image + /// + public const string BASE64_IMAGE_FORMAT = "data:image/png;base64, "; //ends with a space + public const int Matter_ONE_NOTE_LENGTH = 120; + public const string CLIENT_TERM_PATH = "/"; + public const string CACHE_PERMISSIONS = "Permissions"; + + public const string SUCCESS = "200"; + /// + /// The underscore constant + /// + public const string UNDER_SCORE = "_"; + + /// + /// The invalid char regex + /// + public const string INVALID_CHARREGEX = @"[\*\?\|\\\t/:""'<>#{}%~&]"; + + /// + /// The start end regex + /// + public const string START_END_REGEX = @"^[\. ]|[\. ]$"; + + /// + /// The invalid rule regex + /// + public const string INVALID_RULE_REGEX = @"\.{2,}"; + + /// + /// The extra space regex + /// + public const string EXTRA_SPACE_REGEX = " {2,}"; + + /// + /// The mail address field regular expression + /// + public const string MAIL_ADDRESS_FIELD_REGEX = @"""[^""]*"""; + + /// + /// The invalid file name regex + /// + public const string INVALID_FILENAME_REGEX = "_fajlovi|.files|-Dateien|_fichiers|_bestanden|_file|_archivos|-filer|_tiedostot|_pliki|_soubory|_elemei|_ficheiros|_arquivos|_dosyalar|_datoteke|_fitxers|_failid|_fails|_bylos|_fajlovi|_fitxategiak$"; + + + + #region Azure Cache keys + /// + /// Clients cache key + /// + public const string CACHE_CLIENTS = "Clients"; + + /// + /// Matter type cache key + /// + public const string CACHE_MATTER_TYPE = "MatterType"; + + /// + /// Roles cache key + /// + public const string CACHE_ROLES = "Roles"; + + /// + /// The encoded double quotes + /// + public const string ENCODED_DOUBLE_QUOTES = """; + + /// + /// The Double quote constant + /// + public const string DOUBLE_QUOTE = "\""; + + /// + /// The (*) asterisk constant + /// + public const string ASTERISK = "*"; + + /// + /// The comma constant + /// + public const string COMMA = ","; + + /// + /// The semi colon constant + /// + public const string SEMICOLON = ";"; + + /// + /// The space constant + /// + public const string SPACE = " "; + + /// + /// The Period constant + /// + public const string PERIOD = "."; + + /// + /// Horizontal tab constant + /// + public const string HORIZONTAL_TAB = "\t"; + + /// + /// The opening bracket constant + /// + public const string OPENING_BRACKET = "("; + + /// + /// The backward slash constant + /// + public const string BACKWARD_SLASH = "\\"; + + /// + /// The forward slash constant + /// + public const string FORWARD_SLASH = "/"; + + /// + /// The lists constant + /// + public const string LISTS = "Lists"; + + /// + /// The pipe constant + /// + public const string PIPE = "|"; + + /// + /// Hash Symbol + /// + public const string SYMBOL_HASH = "#"; + + /// + /// The @ symbol constant + /// + public const string SYMBOL_AT = "@"; + + /// + /// The closing bracket constant + /// + public const string CLOSING_BRACKET = ")"; + + /// + /// The opening angular bracket + /// + public const string OPENING_ANGULAR_BRACKET = "<"; + + /// + /// The closing angular bracket + /// + public const string CLOSING_ANGULAR_BRACKET = ">"; + + /// + /// The dollar constant + /// + public const string DOLLAR = "$"; + + /// + /// The colon constant + /// + public const string COLON = ":"; + + /// + /// The operator ampersand constant + /// + public const string OPERATOR_AMPERSAND = "&"; + + /// + /// The ?(question) constant + /// + public const string QUESTION = "?"; + + /// + /// The OR operator + /// + public const string OPERATOR_OR = "OR"; + + /// + /// The AND operator + /// + public const string OPERATOR_AND = "AND"; + + /// + /// Constant required for range operator + /// + public const string OPERATOR_RANGE = "range"; + + + /// + /// Placeholder for minimum value of date for date filtering in range operator + /// + public const string MIN_DATE = "min"; + + /// + /// Placeholder for maximum value of date for date filtering in range operator + /// + public const string MAX_DATE = "max"; + + /// + /// Constant required for document library filter condition + /// + public const string DOCUMENT_LIBRARY_FILTER_CONDITION = "contentclass:STS_List_DocumentLibrary"; + + /// + /// Constant required for document item filter condition + /// + public const string DOCUMENT_ITEM_FILTER_CONDITION = "contentclass:STS_ListItem_DocumentLibrary"; + + /// + /// Open square brace + /// + public const string OPEN_SQUARE_BRACE = "["; + + /// + /// The (=)operator equal constant + /// + public const string OPERATOR_EQUAL = "="; + + /// + /// Close square brace + /// + public const string CLOSE_SQUARE_BRACE = "]"; + + /// + /// Opening curly brace + /// + public const string OPENING_CURLY_BRACE = "{"; + + /// + /// Closing curly brace + /// + public const string CLOSING_CURLY_BRACE = "}"; + + /// + /// Name of the path field in results returned from SharePoint search + /// + public const string PATH_FIELD_NAME = "Path"; + + /// + /// Event type information + /// + public const string EVENT_INFORMATION = "INFO"; + + /// + /// Event type error + /// + /// Event type warning + /// + public const string EVENT_WARNING = "WARNING"; + + /// + /// Exception Message + /// + public const string EXCEPTION_MESSAGE = "EXCEPTION MESSAGE:"; + + /// + /// Class Name + /// + public const string CLASS_NAME = "CLASS NAME:"; + + /// + /// Class Name + /// + public const string METHOD_NAME = "METHOD NAME:"; + + /// + /// Class Name + /// + public const string LINE_NUMBER = "LINE NUMBER:"; + + /// + /// Default Event ID + /// + public const int DEFAULT_EVENT_ID = 1000; + + /// + /// Default Failed to logging code + /// + public const int LOGGING_FAILED_CODE = 2000; + + /// + /// Default Failed to logging code + /// + public const string LOGGING_FAILED_MESSAGE = "Failed to Logging"; + + /// + /// The error code constant + /// + public const string ERROR_CODE = "{0}" + SYMBOL_HASH + PIPE + SYMBOL_HASH + "{1}"; + + /// + /// The Escape character pattern + /// + public const string ESCAPE_CHARACTER_PATTERN = @"[\a|\b|\f|\n|\r|\t|\v]"; + + /// + /// Constant required for no pinned matters message + /// + public const string NO_PINNED_MESSAGE = "You do not have any pinned matters/documents"; + + /// + /// The column name for document GUID + /// + public const string DOCUMENT_GUID_COLUMN_NAME = "UniqueId"; + + /// + /// Title column for list item + /// + public const string TITLE = "Title"; + + /// + /// Default layout + /// + public const string DefaultLayout = "ReportCenterLayout"; + + /// + /// Master Page Gallery + /// + public const string MasterPageGallery = "Master Page Gallery"; + + /// + /// Top Zone + /// + public const string TOP_ZONE = "TopLeftZone"; + + /// + /// Header Zone + /// + public const string HEADER_ZONE = "HeaderZone"; + + /// + /// Footer Zone + /// + public const string FOOTER_ZONE = "FooterZone"; + + /// + /// Middle left zone + /// + public const string MIDDLE_LEFT_ZONE = "MiddleLeftZone"; + + /// + /// Right Zone + /// + public const string RIGHT_ZONE = "RightZone"; + + /// + /// Bottom Left Zone + /// + public const string BOTTOM_ZONE = "BottomLeftZone"; + + /// + /// Middle Center Zone + /// + public const string MIDDLE_CENTER_ZONE = "MiddleMiddleZone"; + + /// + /// Links static string + /// + public const string LINKS_STATIC_STRING = "Links"; + + /// + /// Represents the entity type user in people picker control + /// + public const string PEOPLE_PICKER_ENTITY_TYPE_USER = "User"; + + /// + /// Calendar Id + /// + public const string CALENDARID = "106"; + + /// + /// Calendar Name + /// + public const string CALENDAR_NAME = "Calendar"; + + /// + /// Alternate name for Calendar list + /// + public const string CALENDAR_NAME_ALTERNATE = "Calendar List"; + + /// + /// Provision Matter CreateMatter validation value + /// + public const string PROVISION_MATTER_CREATEMATTER = "2"; + + /// + ///Provision Matter common validation value + /// + public const string PROVISION_MATTER_COMMON_VALIDATION = "0"; + + /// + /// Provision Matter CheckMatterExists validation value + /// + public const string PROVISION_MATTER_CHECK_MATTER_EXISTS = "1"; + + + + /// + /// Provision Matter AssignUserPermissions value + /// + public const string PROVISION_MATTER_ASSIGN_USER_PERMISSIONS = "3"; + + /// + /// Provision Matter MatterLandingPage validation value + /// + public const string PROVISIONMATTER_MATTER_LANDING_PAGE = "4"; + + /// + /// Provision Matter UpdateMetadataForList validation value + /// + public const string ProvisionMatterUpdateMetadataForList = "6"; + + /// + /// Provision Matter ShareMatter validation value + /// + public const string ProvisionMatterShareMatter = "7"; + + /// + /// Edit Matter permission validation value + /// + public const string EditMatterPermission = "8"; + + /// + /// Provision Matter AssignContentType validation value + /// + public const string ProvisionMatterAssignContentType = "5"; + + + + /// + /// The false constant + /// + public const string FALSE = "false"; + + /// + /// The false constant + /// + public const string TRUE = "true"; + + /// + /// The false constant + /// + public const string YES = "Yes"; + + /// + /// The false constant + /// + public const string NO = "No"; + + /// + /// Page extension + /// + public const string ASPX_EXTENSION = ".aspx"; + /// + /// The service response HTML chunk for role information + /// + public const string RoleInfoHtmlChunk = "
{0}: {1}
"; + + /// + /// The HTTPS header constant + /// + public const string HTTPS = "https"; + + /// + /// The HTTP header constant + /// + public const string HTTP = "http"; + + /// + /// The string for matter + /// + public const string MATTER = "Matter"; + + /// + /// Modified date column + /// + public const string MODIFIED_DATE_COLUMN = "Modified"; + + + /// + /// String to be used for creating default value for metadata. This string is in following format: WSSID;#VAL|GUID + /// + public const string MetadataDefaultValue = "{0};#{1}|{2}"; + #endregion + + #region Mail + + /// + /// The SOAP envelop URI + /// + public const string SOAP_ENVELOP_URI = "http://schemas.xmlsoap.org/soap/envelope/"; + + /// + /// The exchange service message + /// + public const string EXCHANGE_SERVICE_MESSAGE = "http://schemas.microsoft.com/exchange/services/2006/messages"; + + /// + /// Constant required for email file extension + /// + public const string EMAIL_FILE_EXTENSION = ".eml"; + + /// + /// The mail file extension key + /// + public const string MAIL_FILE_EXTENSION_KEY = "fileExtension"; + + /// + /// The mail sender key + /// + public const string MAIL_SENDER_KEY = "mailSender"; + + /// + /// The mail search email subject + /// + public const string MAIL_SEARCH_EMAIL_SUBJECT = "searchEmailSubject"; + + /// + /// The mail received date key + /// + public const string MAIL_RECEIVED_DATEKEY = "receivedDate"; + + /// + /// The mail search email from mailbox key + /// + public const string MAIL_SEARCH_EMAIL_FROM_MAIL_BOX_KEY = "searchEmailFromMailbox"; + + /// + /// The mail receiver key + /// + public const string MAIL_RECEIVER_KEY = "mailReceiver"; + + /// + /// The mail CC field identifier + /// + public const string MAIL_CC_ADDRESS_KEY = "ccMailAddress"; + + /// + /// The mail categories identifier + /// + public const string MAIL_CATEGORIES_KEY = "categories"; + + /// + /// The mail sensitivity identifier + /// + public const string MAIL_SENSITIVITY_KEY = "sensitivity"; + + /// + /// The mail sent date identifier + /// + public const string MAIL_SENT_DATE_KEY = "sentDate"; + + /// + /// Conversation Id identifier + /// + public const string MAIL_CONVERSATIONID_KEY = "conversationId"; + + /// + /// Conversation Topic identifier + /// + public const string MAIL_CONVERSATION_TOPIC_KEY = "conversationTopic"; + + /// + /// Has Attachments identifier + /// + public const string MAIL_HAS_ATTACHMENTS_KEY = "hasAttachments"; + + /// + /// The mail attachment key + /// + public const string MAIL_ATTACHMENT_KEY = "attachment"; + + /// + /// The mail importance key + /// + public const string MAIL_IMPORTANCE_KEY = "importance"; + + /// + /// The mail default importance + /// + public const string MAIL_DEFAULT_IMPORTANCE = "normal"; + + /// + /// The original name of uploaded mail + /// + public const string MAIL_ORIGINAL_NAME = "originalName"; + + /// + /// Categories text + /// + public const string CATEGORIES = "category"; + + + + /// + /// The upload succeeded + /// + public const bool UPLOAD_SUCCEEDED = true; + + /// + /// The upload failed + /// + public const bool UPLOAD_FAILED = false; + /// + /// Mail content type + /// + public const string MAIL_CONTENT_TYPE = "text/plain; charset=us-ascii"; + + /// + /// The mail media sub type + /// + public const string MAIL_MEDIA_SUBTYPE = "plain"; + + /// + /// The text media main type + /// + public const string TEXT_MEDIA_MAIN_TYPE = "text"; + + /// + /// The HTML media main type + /// + public const string HtmlMediaMainType = "html"; + + /// + /// The image media main type + /// + public const string IMAGE_MEDIA_MAIN_TYPE = "image"; + + /// + /// The application media main type + /// + public const string APPLICATION_MEDIA_MAIN_TYPE = "application"; + + /// + /// The message media main type + /// + public const string MESSAGE_MEDIA_MAIN_TYPE = "message"; + + /// + /// The multipart media type + /// + public const string MULTI_PART_MEDIA_TYPE = "MULTIPART/ALTERNATIVE"; + + /// + /// The string hyphen + /// + public const string HYPHEN = "-"; + + /// + /// The mail media type + /// + public const string MailMediaType = "text/plain"; + + /// + /// Constant required for extension for OneNote table of content + /// + public const string EXTENSION_ONENOTE_TABLE_OF_CONTENT = ".onetoc2"; + + /// + /// Constant required for extension for OneNote table of content + /// + public const string ONE_NOTE_RELATIVE_FILE_PATH = "Open Notebook.onetoc2"; + + /// + /// The managing attorney value constant + /// + public const string MANAGING_ATTORNEY_VALUE = "Responsible Attorney"; + + /// + /// Task list template type + /// + public const string TASK_LIST_TEMPLATE_TYPE = "Tasks"; + + /// + /// Web Query string + /// + public const string WEB_STRING = "?Web=1"; + + /// + /// Constant required for HTML file type constant + /// + public const string HtmlFileType = "HTML_x0020_File_x0020_Type"; + + /// + /// Constant required for impersonation claim type trust + /// + public const string TRUSTED_FOR_IMPERSONATION_CLAIMTYPE = "trustedfordelegation"; + + /// + /// The mail attachment media main type + /// + public const string MAIL_ATTACHMENT_MEDIA_MAINT_YPE = "message"; + + /// + /// The mail search email from mailbox key + /// + public const string MAIL_SEARCH_EMAIL_FROM_MAILBOX_KEY = "searchEmailFromMailbox"; + + /// + /// The exchange service types + /// + public const string EXCHANGE_SERVICE_TYPES = "http://schemas.microsoft.com/exchange/services/2006/types"; + + /// + /// The hexadecimal decoder regular expression + /// + public const string HEX_DECODER_REGEX = "(\\=([0-9A-F][0-9A-F]))"; + + + /// + /// The Document content type in user's OneDrive. + /// + public const string ONEDRIVE_DOCUMENT_CONTENTTYPE = "Document"; + + /// + /// The Folder content type in user's OneDrive. + /// + public const string ONEDRIVE_FOLDER_CONTENTTYPE = "Folder"; + + + /// + /// The property associated with content type + /// + public const string OneDrive_ContentType_Property = "ContentTypeId"; + + /// + /// The mail message receiver header + /// + public const string Mail_Message_Receiver_Header = "x-receiver"; + + /// + /// The mail message sender header + /// + public const string Mail_Message_Sender_Header = "x-sender"; + + /// + /// Event type information + /// + public const string Event_Information = "INFO"; + + /// + /// Event type error + /// + public const string Event_Error = "ERROR"; + + /// + /// Event type warning + /// + public const string EventWarning = "WARNING"; + + /// + /// Exception Message + /// + public const string ExceptionMessage = "EXCEPTION MESSAGE:"; + + /// + /// Class Name + /// + public const string ClassName = "CLASS NAME:"; + + /// + /// Class Name + /// + public const string MethodName = "METHOD NAME:"; + + /// + /// Class Name + /// + public const string LineNumber = "LINE NUMBER:"; + + /// + /// Default Event ID + /// + public const int DefaultEventId = 1000; + + /// + /// Default Failed to logging code + /// + public const int LoggingFailedCode = 2000; + + /// + /// Default Failed to logging code + /// + public const string LoggingFailedMessage = "Failed to Logging"; + + + /// + /// The mail SOAP request + /// + public const string MAIL_SOAP_REQUEST = + @" + + + + + + + + Default + true + + + + + + + + + + + "; + + /// + /// The attachment SOAP request + /// + public const string ATTACHMENT_SOAP_REQUEST = + @" + + + + + + + + true + + + + + + + + + + + "; + + + #endregion + + + /// + /// The Attachments tag in Exchange response + /// + public const string ATTACHMENTS_TAG = "Attachments"; + + /// + /// The FileAttachment tag in Exchange response + /// + public const string FILE_ATTACHMENT_TAG = "FileAttachment"; + + /// + /// The ItemAttachment tag in Exchange response + /// + public const string ITEM_ATTACHMENT_TAG = "ItemAttachment"; + + /// + /// The Name tag in Exchange response + /// + public const string FILE_NAME_TAG = "Name"; + + /// + /// The AttachmentID tag in Exchange response + /// + public const string ATTACHMENT_ID_TAG = "AttachmentId"; + + /// + /// The Id attribute in Exchange response + /// + public const string ID_ATTRIBUTE = "Id"; + + /// + /// The name of the HTTP header for web request + /// + public const string REQUEST_HEADER_NAME = "Authorization"; + + /// + /// The value of the HTTP header for web request + /// + public const string REQUEST_HEADER_VALUE = "Bearer {0}"; + + /// + /// The Method for web request + /// + public const string REQUEST_METHOD = "POST"; + + /// + /// The value of the Content-type HTTP header for web request + /// + public const string REQUEST_CONTENT_TYPE = "text/xml; charset=utf-8"; + /// + /// The mail attributes + /// + public static class MailAttributes + { + /// + /// The BCC mail attribute + /// + public const string BCC = "BCC"; + + /// + /// The cc mail attribute + /// + public const string CC = "CC"; + + /// + /// The attachment mail attribute + /// + public const string ATTACHMENT = "ATTACHMENT"; + + /// + /// The content description + /// + public const string CONTENT_DESCRIPTION = "CONTENT-DESCRIPTION"; + + /// + /// The content disposition + /// + public const string CONTENT_DISPOSITION = "CONTENT-DISPOSITION"; + + /// + /// The content identifier + /// + public const string CONTENT_ID = "CONTENT-ID"; + + /// + /// The content transfer encoding + /// + public const string CONTENT_TRANSFER_ENCODING = "CONTENT-TRANSFER-ENCODING"; + + /// + /// The content type mail attribute + /// + public const string CONTENT_TYPE = "CONTENT-TYPE"; + + /// + /// The date mail attribute + /// + public const string DATE = "DATE"; + + /// + /// From mail attribute + /// + public const string FROM = "FROM"; + + /// + /// The sender mail attribute + /// + public const string SENDER = "SENDER"; + + /// + /// The subject mail attribute + /// + public const string SUBJECT = "SUBJECT"; + + /// + /// To mail attribute + /// + public const string TO = "TO"; + + /// + /// The filename mail attribute + /// + public const string FILENAME = "FILENAME"; + + /// + /// The size mail attribute + /// + public const string SIZE = "SIZE"; + + /// + /// The creation date mail attribute + /// + public const string CREATION_DATE = "CREATION-DATE"; + + /// + /// The modification date mail attribute + /// + public const string MODIFICATION_DATE = "MODIFICATION-DATE"; + + /// + /// The read date mail attribute + /// + public const string READ_DATE = "READ-DATE"; + + /// + /// The 7biT encoding + /// + public const string BIT_7 = "7BIT"; + + /// + /// The 8biT encoding + /// + public const string BIT_8 = "8BIT"; + + /// + /// The quoted printable + /// + public const string QUOTED_PRINTABLE = "QUOTED-PRINTABLE"; + + /// + /// The base 64 encoding + /// + public const string BASE64 = "BASE64"; + + /// + /// The importance mail attribute + /// + public const string IMPORTANCE = "IMPORTANCE"; + + /// + /// The mail categories attribute + /// + public const string CATEGORIES = "KEYWORDS"; + + /// + /// The mail received attribute + /// + public const string RECEIVED = "RECEIVED"; + + + } + + /// + /// The original name of uploaded mail + /// + public const string MailOriginalName = "originalName"; + + #region Matter Landing Page Constants + + /// + /// Zone index to be used while creating matter page + /// + public const int ZONE_INDEX = 1; + + #region Web Part Constants + /// + /// XML definition of the left web part + /// + public const string CONTENT_EDITOR_WEB_PART = @" + + Content Editor + None + Allows authors to enter rich text content. + true + MiddleLeftZone + 0 + Normal + + + true + true + true + true + true + true + true + + + Modeless + Default + + Cannot import this Web Part. + /_layouts/15/images/mscontl.gif + + Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c + Microsoft.SharePoint.WebPartPages.ContentEditorWebPart + + + + + + "; + + /// + /// XML definition of the RSS feed web part + /// + public const string RSS_FEED_WEB_PART = @" + + + + Cannot import this web part. + + + + False + None + + + True + + <ParameterBinding Name=""RequestUrl"" Location=""WPProperty[FeedUrl]""/> + True + False + + + 5 + False + + + 0 + + 600 + 60 + True + http://www.bing.com/search?q={0}&format=rss + True + False + False + False + + + True + False + None + Normal + True + + + False + NotSet + RSS Viewer + 00000000-0000-0000-0000-000000000000 + Displays an RSS feed. + True + + + <%@ Register TagPrefix=""WebControls"" Namespace=""Microsoft.SharePoint.WebControls"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> + <%@ Register TagPrefix=""WebPartPages"" Namespace=""Microsoft.SharePoint.WebPartPages"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %> + <WebControls:XmlUrlDataSource runat=""server"" AuthType=""None"" HttpMethod=""GET""> + <DataFileParameters> + <WebPartPages:DataFormParameter Name=""RequestUrl"" ParameterKey=""RequestUrl"" PropertyName=""ParameterValues""/> + </DataFileParameters> + </WebControls:XmlUrlDataSource> + + PAGE_NORMALVIEW + + True + All + 120 + -1 + + + + True + + Cannot import this web part. + Modeless + + + + "; + /// + /// XML definition of the list view web part + /// + public const string LIST_VIEW_WEBPART = @" + + + + + Cannot import this Web Part. + + + + False + + + True + + + False + + {0} + {1} + False + NotSet + False + Html, TabularView, Hidden, Mobile + True + {2} + + True + Normal + False + + + All + False + True + True + + Modeless + + True + 86400 + None + + + /_layouts/15/images/itdl.png?rev=33 + + True + + -1 + True + 750px + + False + + PAGE_NORMALVIEW + + True + True + 00000000-0000-0000-0000-000000000000 + + main.xsl + False + + False + <View Name=""{3}"" MobileView=""TRUE"" Type=""HTML"" Hidden=""TRUE"" DisplayName="" "" Url=""{4}"" Level=""1"" BaseViewID=""1"" ContentTypeID=""0x"" ImageUrl=""/_layouts/15/images/dlicon.png?rev=37"" ><Query><OrderBy><FieldRef Name=""FileLeafRef""/></OrderBy></Query><ViewFields><FieldRef Name=""DocIcon""/><FieldRef Name=""LinkFilename""/><FieldRef Name=""Modified""/><FieldRef Name=""Editor""/></ViewFields><RowLimit Paged=""TRUE"">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=""TRUE"">main.xsl</XslLink><Toolbar Type=""Standard""/></View> + False + True + + <ParameterBinding Name=""dvt_sortdir"" Location=""Postback;Connection""/> + <ParameterBinding Name=""dvt_sortfield"" Location=""Postback;Connection""/> + <ParameterBinding Name=""dvt_startposition"" Location=""Postback"" DefaultValue="" ""/> + <ParameterBinding Name=""dvt_firstrow"" Location=""Postback;Connection""/> + <ParameterBinding Name=""OpenMenuKeyAccessible"" Location=""Resource(wss,OpenMenuKeyAccessible)"" /> + <ParameterBinding Name=""open_menu"" Location=""Resource(wss,open_menu)"" /> + <ParameterBinding Name=""select_deselect_all"" Location=""Resource(wss,select_deselect_all)"" /> + <ParameterBinding Name=""idPresEnabled"" Location=""Resource(wss,idPresEnabled)"" /><ParameterBinding Name=""NoAnnouncements"" Location=""Resource(wss,noitemsinview_doclibrary)"" /><ParameterBinding Name=""NoAnnouncementsHowTo"" Location=""Resource(wss,noitemsinview_doclibrary_howto2)"" /> + List + 60 + False + + Cannot import this Web Part. + + + False + + + + "; + + + + + /// + /// Section to be appended on the page + /// + public const string MATTER_LANDING_SECTION_CONTENT = "
"; + + /// + /// Style tag + /// + public const string STYLE_TAG = ""; + + /// + /// Script tag + /// + public const string SCRIPT_TAG = ""; + + /// + /// Script tag with contents + /// + public const string SCRIPT_TAG_WITH_CONTENTS = ""; + + /// + /// Matter landing stamp properties + /// + public const string MATTER_LANDING_STAMP_PROPERTIES = "var documentLibraryName = \"{0}\", isNewMatterLandingPage = true, documentLibraryGUID=\"{1}\";"; + #endregion + + + + #endregion + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/UploadEnums.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/UploadEnums.cs new file mode 100644 index 00000000..df3c97d9 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Constants/UploadEnums.cs @@ -0,0 +1,18 @@ + +namespace Microsoft.Legal.MatterCenter.Utility +{ + /// + /// This enums will have constants which will be used during file upload scenarios + /// + public enum UploadEnums + { + UploadSuccess=1, + DuplicateDocument=2, + IdenticalContent=3, + NonIdenticalContent=4, + ContentCheckFailed=5, + UploadFailure=6, + FileAlreadyExists=7, + UploadToFolder =8 + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/AzureLogger.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/AzureLogger.cs new file mode 100644 index 00000000..d2df8af5 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/AzureLogger.cs @@ -0,0 +1,90 @@ +using Microsoft.WindowsAzure.Storage; +using Microsoft.WindowsAzure.Storage.Table; +using System; +using System.Globalization; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class AzureLogger + { + /// + /// Logs message to Azure table storage. + /// + /// Exception Object + /// Class Name where exception occur + /// Method Name where exception occur + /// Name of the log table. + /// Line Number of the log table. + /// Returns date of logging + internal static string LogInAzure(Exception exception, string className, string methodName, + string logTableName, int lineNumber, LogTables logTables, GeneralSettings generalSettings) + { + string connStr = generalSettings.CloudStorageConnectionString; + CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connStr); + CloudTableClient client = storageAccount.CreateCloudTableClient(); + CloudTable table = client.GetTableReference(logTableName); + table.CreateIfNotExists(); + AzureLogEntity tableEntityObj = new AzureLogEntity(); + tableEntityObj.PartitionKey = className; + tableEntityObj.MethodName = methodName; + string date = DateTime.Now.ToUniversalTime().ToString(logTables.AzureRowKeyDateFormat, CultureInfo.InvariantCulture); + tableEntityObj.RowKey = string.Format(CultureInfo.InvariantCulture, "{0} - {1}", date, Guid.NewGuid().ToString()); + tableEntityObj.Stacktrace = exception.StackTrace; + tableEntityObj.LogMessage = exception.Message; + tableEntityObj.ErrorCode = exception.HResult; + tableEntityObj.LineNumber = lineNumber; + TableOperation insertOp = TableOperation.Insert(tableEntityObj); + table.Execute(insertOp); + return date; + } + } + + public class AzureLogEntity : TableEntity + { + + /// + /// Gets or sets the error code. + /// + /// + /// The error code. + /// + public int ErrorCode { get; set; } + + /// + /// Gets or sets the log message. + /// + /// + /// The log message. + /// + public string LogMessage { get; set; } + + /// + /// Gets or sets the name of the method. + /// + /// + /// The name of the method. + /// + public string MethodName { get; set; } + + /// + /// Gets the date format. + /// + /// The date format. + public string DateFormat { get; set; } + + /// + /// Gets or sets the line number. + /// + /// + /// The line number. + /// + public int LineNumber { get; set; } + /// + /// Gets or sets the line number. + /// + /// + /// The line number. + /// + public string Stacktrace { get; set; } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/CustomLogger.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/CustomLogger.cs new file mode 100644 index 00000000..a74d880a --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/CustomLogger.cs @@ -0,0 +1,170 @@ +// *********************************************************************** +// Assembly : Microsoft.Legal.MatterCenter.Utility +// Author : v-akvira +// Created : 04-01-2014 +// +// *********************************************************************** +// +// Copyright (c) . All rights reserved. +// +// This file defines logging errors in event viewer or Azure table storage. +// *********************************************************************** + +using System; +using Microsoft.Legal.MatterCenter.Models; +using System.Diagnostics; +using System.Globalization; +using Microsoft.Extensions.Options; +using System.Net; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + + public class CustomLogger :ICustomLogger + { + private LogTables logTables; + private GeneralSettings generalSettings; + ErrorResponse errorResponse; + public CustomLogger(IOptions logTables, IOptions generalSettings) + { + this.logTables = logTables.Value; + this.generalSettings = generalSettings.Value; + + } + + + /// + /// This method will generate error response that will be sent to the client + /// + /// Exception object that occured + /// + public ErrorResponse GenerateErrorResponse(Exception ex) + { + var stackTrace = new StackTrace(ex, true); + StackFrame stackFrameInstance = null; + + if (stackTrace.GetFrames().Length > 0) + { + for (int i = 0; i < stackTrace.GetFrames().Length; i++) + { + if (stackTrace.GetFrames()[i].ToString().Contains("Microsoft.Legal.Matter")) + { + stackFrameInstance = stackTrace.GetFrames()[i]; + break; + } + } + } + //Create custom exception response that needs to be send to client + var response = new ErrorResponse() + { + Message = ex.Message, + StackTrace = ex.ToString(), + Description = "Error occured in the system. Please contact the administrator", + //Exception = context.Exception.ToString(), + LineNumber = stackFrameInstance?.GetFileLineNumber(), + MethodName = stackFrameInstance?.GetMethod().Name, + ClassName = stackFrameInstance?.GetMethod().DeclaringType.Name, + ErrorCode = ((int)HttpStatusCode.InternalServerError).ToString(), + IsErrror = true + }; + return response; + } + + + /// + /// Gets the line number where exception has occurred. + /// + /// Exception object + /// Class Name where exception occur + /// Name of the method. + /// Name of the log table. + /// ErrorResponse + public ErrorResponse LogError(Exception exception, string className, string methodName, string logTableName) + { + + try + { + StackTrace trace = new System.Diagnostics.StackTrace(exception, true); + int lineNumber = trace.GetFrame(trace.FrameCount - 1).GetFileLineNumber(); + errorResponse = MatterCenterExceptions(exception, className, methodName, logTableName, lineNumber); + + } + catch (Exception ex) + { + System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(ex, true); + int lineNumber = trace.GetFrame(trace.FrameCount - 1).GetFileLineNumber(); + errorResponse = MatterCenterExceptions(ex, className, methodName, logTableName, lineNumber); + + } + return errorResponse; + } + + /// + /// Logs error message in Azure table storage or Event Viewer. + /// + /// Exception object + /// Class Name where exception occur + /// Name of the method. + /// Name of the log table. + /// Line Number of the log table. + /// Error logged in event viewer + public ErrorResponse MatterCenterExceptions(Exception exception, string className, string methodName, string logTableName, int lineNumber) + { + string errorDate = DateTime.Now.ToString(logTables.AzureRowKeyDateFormat, CultureInfo.InvariantCulture); + string errorCode = string.Empty; + string result = string.Empty; + try + { + if (null != exception) + { + if (Convert.ToBoolean(logTables.IsLoggingOnAzure, CultureInfo.InvariantCulture)) + { + //// Log to Azure table storage + errorDate = AzureLogger.LogInAzure(exception, className, methodName, logTableName, lineNumber, logTables, generalSettings); + } + else + { + errorResponse = new ErrorResponse() + { + Message = exception.Message, + ClassName = className, + MethodName = methodName, + LineNumber = lineNumber + + }; + //// Log to event viewer + EventViewerLogger.LogInEventViewer(errorResponse.ToString(), ServiceConstants.EVENT_ERROR, logTables); + } + errorResponse = new ErrorResponse() + { + ErrorCode = exception.HResult.ToString(), + ErrorDate = errorDate, + Message = ServiceUtility.RemoveEscapeCharacter(exception.Message), + + }; + } + else + { + errorResponse = new ErrorResponse() + { + ErrorCode = ServiceConstants.LOGGING_FAILED_CODE.ToString(), + ErrorDate = errorDate, + Message = ServiceUtility.RemoveEscapeCharacter(exception.Message), + Description = ServiceConstants.LOGGING_FAILED_MESSAGE + }; + } + } + catch (Exception) + { + errorResponse = new ErrorResponse() + { + ErrorCode = ServiceConstants.LOGGING_FAILED_CODE.ToString(), + ErrorDate = errorDate, + Message = ServiceUtility.RemoveEscapeCharacter(exception.Message), + Description = ServiceConstants.LOGGING_FAILED_MESSAGE + }; + } + return errorResponse; + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/EventViewerLogger.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/EventViewerLogger.cs new file mode 100644 index 00000000..e8414e73 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/EventViewerLogger.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class EventViewerLogger + { + /// + /// Logs exception in Event Viewer. + /// + /// Event description + /// Type of log + internal static void LogInEventViewer(string eventLog, string type, LogTables logTables) + { + string sourceName = logTables.EventViewerSource; + int eventID; + if (!int.TryParse(logTables.EventViewerEventID, NumberStyles.Any, CultureInfo.InvariantCulture, out eventID)) + { + eventID = ServiceConstants.DEFAULT_EVENT_ID; + } + + // Create new event source if not exists + if (!EventLog.SourceExists(sourceName)) + { + EventLog.CreateEventSource(sourceName, logTables.EventViewerLogName); + } + + switch (type) + { + case ServiceConstants.EVENT_WARNING: + EventLog.WriteEntry(sourceName, eventLog, EventLogEntryType.Warning, eventID); + break; + case ServiceConstants.EVENT_ERROR: + EventLog.WriteEntry(sourceName, eventLog, EventLogEntryType.Error, eventID); + break; + default: + EventLog.WriteEntry(sourceName, eventLog, EventLogEntryType.Information, eventID); + break; + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/ICustomLogger.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/ICustomLogger.cs new file mode 100644 index 00000000..678fc90e --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/ICustomLogger.cs @@ -0,0 +1,13 @@ + + +using Microsoft.Legal.MatterCenter.Models; +using System; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public interface ICustomLogger + { + ErrorResponse LogError(Exception exceptio, string className, string methodName, string logTableName); + ErrorResponse GenerateErrorResponse(Exception ex); + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs similarity index 87% rename from tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs rename to tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs index 08ed4b50..809b0bc0 100644 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Logger/MatterCenterException.cs @@ -23,14 +23,13 @@ // Case 11: Error occurred in case of Token Request failure exception // // *********************************************************************** +#region using +using System; +using System.Globalization; +using System.Runtime.Serialization; +#endregion namespace Microsoft.Legal.MatterCenter.Utility { - #region using - using System; - using System.Globalization; - using System.Runtime.Serialization; - #endregion - /// /// Provides methods for handling custom exception /// @@ -41,14 +40,16 @@ public class MatterCenterException : Exception /// Empty Constructor /// public MatterCenterException() - : base() { } + : base() + { } /// /// Parameterized constructor for error message /// /// Custom error message public MatterCenterException(string customErrorMessage) - : base(customErrorMessage) { } + : base(customErrorMessage) + { } /// /// Parameterized constructor for error code and message @@ -56,7 +57,8 @@ public MatterCenterException(string customErrorMessage) /// Custom error code /// Custom error message public MatterCenterException(string customErrorCode, string customErrorMessage) - : base(customErrorMessage) { HResult = Convert.ToInt32(customErrorCode, CultureInfo.InvariantCulture); } + : base(customErrorMessage) + { HResult = Convert.ToInt32(customErrorCode, CultureInfo.InvariantCulture); } /// /// Parameterized constructor for error message and Exception object @@ -64,7 +66,8 @@ public MatterCenterException(string customErrorCode, string customErrorMessage) /// Custom error message /// Exception Object public MatterCenterException(string customErrorMessage, Exception exception) - : base(customErrorMessage, exception) { } + : base(customErrorMessage, exception) + { } /// /// Parameterized constructor for SerializationInfo and Streaming Context object @@ -72,6 +75,7 @@ public MatterCenterException(string customErrorMessage, Exception exception) /// SerializationInfo object /// Streaming Context object protected MatterCenterException(SerializationInfo serializationInfo, StreamingContext streamingContext) - : base(serializationInfo, streamingContext) { } + : base(serializationInfo, streamingContext) + { } } } diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MailMessageParser.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MailMessageParser.cs similarity index 84% rename from tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MailMessageParser.cs rename to tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MailMessageParser.cs index 4cba85a0..0e77c851 100644 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MailMessageParser.cs +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MailMessageParser.cs @@ -490,25 +490,25 @@ public static MailMessageParser CreateFromStream(MailMimeReader mimeDecoder, Str } /// - /// Gets the uploaded email file properties. + /// Gets the uploaded email file properties.... /// /// The file stream. /// The mail properties. /// Dictionary string key value pair for mail properties public static Dictionary GetMailFileProperties(System.IO.Stream fileStream, Dictionary mailProperties) { - if (null != mailProperties && mailProperties.ContainsKey(ConstantStrings.MailFileExtensionKey)) + if (null != mailProperties && mailProperties.ContainsKey(ServiceConstants.MAIL_FILE_EXTENSION_KEY)) { - if (string.Equals(mailProperties[ConstantStrings.MailFileExtensionKey], ConstantStrings.EmailFileExtension, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(mailProperties[ServiceConstants.MAIL_FILE_EXTENSION_KEY], ServiceConstants.EMAIL_FILE_EXTENSION, StringComparison.OrdinalIgnoreCase)) { MailMimeReader mime = new MailMimeReader(); MailMessageParser messageParser = mime.GetEmail(fileStream); string fromDisplayName = Convert.ToString(messageParser.From.DisplayName, CultureInfo.InvariantCulture); - mailProperties[ConstantStrings.MailSenderKey] = String.Concat(Convert.ToString(messageParser.From.Address, CultureInfo.InvariantCulture), ConstantStrings.Semicolon, fromDisplayName.Replace(Convert.ToString(messageParser.From.Address, CultureInfo.InvariantCulture), string.Empty).Replace(ConstantStrings.OpeningBracket + ConstantStrings.ClosingBracket, string.Empty)); - mailProperties[ConstantStrings.MailSearchEmailSubject] = messageParser.Subject; - mailProperties[ConstantStrings.MailSentDateKey] = Convert.ToString(messageParser.DeliveryDate, CultureInfo.InvariantCulture); - mailProperties[ConstantStrings.MailReceivedDateKey] = Convert.ToString(messageParser.ReceivedDate, CultureInfo.InvariantCulture); - mailProperties[ConstantStrings.MailOriginalName] = messageParser.Subject; + mailProperties[ServiceConstants.MAIL_SENDER_KEY] = String.Concat(Convert.ToString(messageParser.From.Address, CultureInfo.InvariantCulture), ServiceConstants.SEMICOLON, fromDisplayName.Replace(Convert.ToString(messageParser.From.Address, CultureInfo.InvariantCulture), string.Empty).Replace(ServiceConstants.OPENING_BRACKET + ServiceConstants.CLOSING_BRACKET, string.Empty)); + mailProperties[ServiceConstants.MAIL_SEARCH_EMAIL_SUBJECT] = messageParser.Subject; + mailProperties[ServiceConstants.MAIL_SENT_DATE_KEY] = Convert.ToString(messageParser.DeliveryDate, CultureInfo.InvariantCulture); + mailProperties[ServiceConstants.MAIL_RECEIVED_DATEKEY] = Convert.ToString(messageParser.ReceivedDate, CultureInfo.InvariantCulture); + mailProperties[ServiceConstants.MAIL_ORIGINAL_NAME] = messageParser.Subject; StringBuilder mailReceiver = new StringBuilder(); StringBuilder mailCCAddress = new StringBuilder(); StringBuilder attachmentName = new StringBuilder(); @@ -519,13 +519,13 @@ public static Dictionary GetMailFileProperties(System.IO.Stream string toMailName = Convert.ToString(toItem.DisplayName, CultureInfo.InvariantCulture); if (toMailName.Contains(toMailAlias)) { - toMailName = toMailName.Replace(toMailAlias, string.Empty).Replace(ConstantStrings.OpeningBracket + ConstantStrings.ClosingBracket, string.Empty); + toMailName = toMailName.Replace(toMailAlias, string.Empty).Replace(ServiceConstants.OPENING_BRACKET + ServiceConstants.CLOSING_BRACKET, string.Empty); } - mailReceiver.Append(toMailAlias + ConstantStrings.Semicolon + toMailName + ConstantStrings.Semicolon); + mailReceiver.Append(toMailAlias + ServiceConstants.SEMICOLON + toMailName + ServiceConstants.SEMICOLON); } - mailProperties[ConstantStrings.MailReceiverKey] = Convert.ToString(mailReceiver, CultureInfo.InvariantCulture); + mailProperties[ServiceConstants.MAIL_RECEIVER_KEY] = Convert.ToString(mailReceiver, CultureInfo.InvariantCulture); foreach (MailAddress itemCC in messageParser.CC) { @@ -533,37 +533,37 @@ public static Dictionary GetMailFileProperties(System.IO.Stream string mailCCName = Convert.ToString(itemCC.DisplayName, CultureInfo.InvariantCulture); if (mailCCName.Contains(mailCCAlias)) { - mailCCName = mailCCName.Replace(mailCCAlias, string.Empty).Replace(ConstantStrings.OpeningBracket + ConstantStrings.ClosingBracket, string.Empty); + mailCCName = mailCCName.Replace(mailCCAlias, string.Empty).Replace(ServiceConstants.OPENING_BRACKET + ServiceConstants.CLOSING_BRACKET, string.Empty); } - mailCCAddress.Append(mailCCAlias + ConstantStrings.Semicolon + mailCCName + ConstantStrings.Semicolon); + mailCCAddress.Append(mailCCAlias + ServiceConstants.SEMICOLON + mailCCName + ServiceConstants.SEMICOLON); } - mailProperties[ConstantStrings.MailCCAddressKey] = Convert.ToString(mailCCAddress, CultureInfo.InvariantCulture); + mailProperties[ServiceConstants.MAIL_CC_ADDRESS_KEY] = Convert.ToString(mailCCAddress, CultureInfo.InvariantCulture); foreach (System.Net.Mail.Attachment itemAttachment in messageParser.Attachments) { if (!string.IsNullOrWhiteSpace(itemAttachment.Name)) { - attachmentName.Append(itemAttachment.Name + ConstantStrings.Semicolon); + attachmentName.Append(itemAttachment.Name + ServiceConstants.SEMICOLON); } } for (int mailEntitiesCount = 0; mailEntitiesCount < messageParser.Entities.Count; mailEntitiesCount++) { - if (string.Equals(messageParser.Entities[mailEntitiesCount].MediaMainType, ConstantStrings.MailAttachmentMediaMainType, StringComparison.CurrentCultureIgnoreCase)) + if (string.Equals(messageParser.Entities[mailEntitiesCount].MediaMainType, ServiceConstants.MAIL_ATTACHMENT_MEDIA_MAINT_YPE, StringComparison.CurrentCultureIgnoreCase)) { - attachmentName.Append(messageParser.Entities[mailEntitiesCount].ContentDescription + ConstantStrings.Semicolon); + attachmentName.Append(messageParser.Entities[mailEntitiesCount].ContentDescription + ServiceConstants.SEMICOLON); } } - mailProperties[ConstantStrings.MailAttachmentKey] = Convert.ToString(attachmentName, CultureInfo.InvariantCulture); + mailProperties[ServiceConstants.MAIL_ATTACHMENT_KEY] = Convert.ToString(attachmentName, CultureInfo.InvariantCulture); // Setting email importance - mailProperties[ConstantStrings.MailImportanceKey] = (!string.IsNullOrWhiteSpace(messageParser.MailImportance) ? messageParser.MailImportance : ConstantStrings.MailDefaultImportance); + mailProperties[ServiceConstants.MAIL_IMPORTANCE_KEY] = (!string.IsNullOrWhiteSpace(messageParser.MailImportance) ? messageParser.MailImportance : ServiceConstants.MAIL_DEFAULT_IMPORTANCE); // Setting email categories - mailProperties[ConstantStrings.MailCategoriesKey] = (!string.IsNullOrWhiteSpace(messageParser.MailCategories) ? messageParser.MailCategories.Replace(ConstantStrings.Comma, ConstantStrings.Semicolon) : string.Empty); + mailProperties[ServiceConstants.MAIL_CATEGORIES_KEY] = (!string.IsNullOrWhiteSpace(messageParser.MailCategories) ? messageParser.MailCategories.Replace(ServiceConstants.COMMA, ServiceConstants.SEMICOLON) : string.Empty); } } @@ -578,7 +578,7 @@ public void SetContentDisposition(string headerLineContent) { if (!string.IsNullOrEmpty(headerLineContent)) { - string[] mailParameters = headerLineContent.Split(new string[] { ConstantStrings.Semicolon }, StringSplitOptions.RemoveEmptyEntries); + string[] mailParameters = headerLineContent.Split(new string[] { ServiceConstants.SEMICOLON }, StringSplitOptions.RemoveEmptyEntries); if (0 == mailParameters.Length) { this.ContentDisposition = new ContentDisposition("inline"); @@ -589,7 +589,7 @@ public void SetContentDisposition(string headerLineContent) for (int mailParametersCount = 1; mailParametersCount < mailParameters.Length; mailParametersCount++) { - string[] nameValue = mailParameters[mailParametersCount].Split(new string[] { ConstantStrings.OperatorEqual }, StringSplitOptions.None); + string[] nameValue = mailParameters[mailParametersCount].Split(new string[] { ServiceConstants.OPERATOR_EQUAL }, StringSplitOptions.None); if (2 != nameValue.Length) { continue; @@ -597,23 +597,23 @@ public void SetContentDisposition(string headerLineContent) string name = nameValue[0].Trim().ToUpperInvariant(); string value = nameValue[1].Trim(); - value = value.Replace(ConstantStrings.DoubleQuote, string.Empty); + value = value.Replace(ServiceConstants.DOUBLE_QUOTE, string.Empty); switch (name) { - case ConstantStrings.MailAttributes.FILENAME: + case ServiceConstants.MailAttributes.FILENAME: this.ContentDisposition.FileName = value; break; - case ConstantStrings.MailAttributes.SIZE: + case ServiceConstants.MailAttributes.SIZE: this.ContentDisposition.Size = long.Parse(value, CultureInfo.InvariantCulture); break; - case ConstantStrings.MailAttributes.CREATION_DATE: + case ServiceConstants.MailAttributes.CREATION_DATE: this.ContentDisposition.CreationDate = DateTime.Parse(value, CultureInfo.InvariantCulture); break; - case ConstantStrings.MailAttributes.MODIFICATION_DATE: + case ServiceConstants.MailAttributes.MODIFICATION_DATE: this.ContentDisposition.ModificationDate = DateTime.Parse(value, CultureInfo.InvariantCulture); break; - case ConstantStrings.MailAttributes.READ_DATE: + case ServiceConstants.MailAttributes.READ_DATE: this.ContentDisposition.ReadDate = DateTime.Parse(value, CultureInfo.InvariantCulture); break; } @@ -632,7 +632,7 @@ public void SetContentTypeFields(string mailContentType) mailContentType = mailContentType.Trim(); if (null == mailContentType || 1 > mailContentType.Length) { - this.ContentType = new ContentType(ConstantStrings.MailContentType); + this.ContentType = new ContentType(ServiceConstants.MAIL_CONTENT_TYPE); } else { @@ -661,18 +661,18 @@ public void SetContentTypeFields(string mailContentType) if (null == this.ContentType.MediaType || 1 > this.ContentType.MediaType.Length) { - this.ContentType.MediaType = ConstantStrings.MailMediaType; + this.ContentType.MediaType = ServiceConstants.MailMediaType; } else { string mediaTypeString = this.ContentType.MediaType.Trim(); - int slashPosition = this.ContentType.MediaType.IndexOf(ConstantStrings.ForwardSlash, StringComparison.Ordinal); + int slashPosition = this.ContentType.MediaType.IndexOf(ServiceConstants.FORWARD_SLASH, StringComparison.Ordinal); if (1 > slashPosition) { this.MediaMainType = mediaTypeString; - if (string.Equals(this.MediaMainType, ConstantStrings.TextMediaMainType, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(this.MediaMainType, ServiceConstants.TEXT_MEDIA_MAIN_TYPE, StringComparison.OrdinalIgnoreCase)) { - this.MediaSubType = ConstantStrings.MailMediaSubType; + this.MediaSubType = ServiceConstants.MAIL_MEDIA_SUBTYPE; } else { @@ -688,9 +688,9 @@ public void SetContentTypeFields(string mailContentType) } else { - if (string.Equals(this.MediaMainType, ConstantStrings.TextMediaMainType, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(this.MediaMainType, ServiceConstants.TEXT_MEDIA_MAIN_TYPE, StringComparison.OrdinalIgnoreCase)) { - this.MediaSubType = ConstantStrings.MailMediaSubType; + this.MediaSubType = ServiceConstants.MAIL_MEDIA_SUBTYPE; } else { @@ -700,7 +700,7 @@ public void SetContentTypeFields(string mailContentType) } } - this.IsBodyHtml = this.MediaSubType == ConstantStrings.HtmlMediaMainType; + this.IsBodyHtml = this.MediaSubType == ServiceConstants.HtmlMediaMainType; } } diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MimeReader.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MimeReader.cs similarity index 90% rename from tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MimeReader.cs rename to tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MimeReader.cs index 5d12aee6..5a29f510 100644 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/MimeReader.cs +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Mail/MimeReader.cs @@ -210,10 +210,10 @@ public static MailAddress ConvertToMailAddress(string address) MailAddress result = null; if (!string.IsNullOrEmpty(address)) { - address = address.Replace(ConstantStrings.DoubleQuote, string.Empty); + address = address.Replace(ServiceConstants.DOUBLE_QUOTE, string.Empty); address = address.Trim(); result = new MailAddress(address); - if (ConstantStrings.OpeningAngularBracket + ConstantStrings.ClosingAngularBracket == address) + if (ServiceConstants.OPENING_ANGULAR_BRACKET + ServiceConstants.CLOSING_ANGULAR_BRACKET == address) { result = null; } @@ -271,7 +271,7 @@ public MailMessageParser GetEmail(Stream emailStream) { if (0 == message.To.Count) { - string toField = message.Headers[ConstantStrings.MailMessageReceiverHeader]; + string toField = message.Headers[ServiceConstants.Mail_Message_Receiver_Header]; if (!string.IsNullOrEmpty(toField)) { message.To.Add(toField); @@ -280,7 +280,7 @@ public MailMessageParser GetEmail(Stream emailStream) if (null == message.From) { - string mailFrom = message.Headers[ConstantStrings.MailMessageSenderHeader]; + string mailFrom = message.Headers[ServiceConstants.Mail_Message_Sender_Header]; if (!string.IsNullOrEmpty(mailFrom)) { message.From = new MailAddress(mailFrom); @@ -330,7 +330,7 @@ public DateTime ConvertToDateTime(string date) out returnDateTime)) { ////try just to convert the date - int dateLength = cleanDateTime.IndexOf(ConstantStrings.COLON, StringComparison.CurrentCulture) - 3; + int dateLength = cleanDateTime.IndexOf(ServiceConstants.COLON, StringComparison.CurrentCulture) - 3; cleanDateTime = cleanDateTime.Substring(0, dateLength); if (DateTime.TryParse( @@ -374,7 +374,7 @@ public DateTime ProcessReceivedDate(string headerValue) DateTime result = DateTime.MinValue; if (!string.IsNullOrWhiteSpace(headerValue)) { - string datePortion = headerValue.Substring(headerValue.LastIndexOf(ConstantStrings.Semicolon, StringComparison.OrdinalIgnoreCase) + 1); + string datePortion = headerValue.Substring(headerValue.LastIndexOf(ServiceConstants.SEMICOLON, StringComparison.OrdinalIgnoreCase) + 1); result = this.ConvertToDateTime(datePortion); } return result; @@ -395,9 +395,9 @@ protected bool ReadMultipleLine(out string response) { result = false; } - else if (0 < response.Length && ConstantStrings.Period == Convert.ToString(response[0], CultureInfo.InvariantCulture)) + else if (0 < response.Length && ServiceConstants.PERIOD == Convert.ToString(response[0], CultureInfo.InvariantCulture)) { - if (ConstantStrings.Period == response) + if (ServiceConstants.PERIOD == response) { result = false; } @@ -467,19 +467,19 @@ private static void AddMailAddresses(string addresses, MailAddressCollection add { MailAddress mailAddressField; - Regex regexObj = new Regex(ConstantStrings.MaiAddressFieldregex); + Regex regexObj = new Regex(ServiceConstants.MAIL_ADDRESS_FIELD_REGEX); MatchCollection addressMatch = regexObj.Matches(addresses); foreach (Match match in addressMatch) { - string quotedString = match.Value.Replace(ConstantStrings.Comma[0], (char)3); + string quotedString = match.Value.Replace(ServiceConstants.COMMA[0], (char)3); addresses = addresses.Replace(match.Value, quotedString); } - string[] addressSplit = addresses.Split(ConstantStrings.Comma[0]); + string[] addressSplit = addresses.Split(ServiceConstants.COMMA[0]); foreach (string address in addressSplit) { // be sure to add the comma back if it was replaced - mailAddressField = ConvertToMailAddress(address.Replace((char)3, ConstantStrings.Comma[0])); + mailAddressField = ConvertToMailAddress(address.Replace((char)3, ServiceConstants.COMMA[0])); if (null != mailAddressField) { addressCollection.Add(mailAddressField); @@ -499,14 +499,14 @@ private static TransferEncoding ConvertToTransferEncoding(string transferEncodin TransferEncoding result = TransferEncoding.Unknown; switch (transferEncodingString.Trim().ToUpperInvariant()) { - case ConstantStrings.MailAttributes.BIT_7: - case ConstantStrings.MailAttributes.BIT_8: + case ServiceConstants.MailAttributes.BIT_7: + case ServiceConstants.MailAttributes.BIT_8: result = TransferEncoding.SevenBit; break; - case ConstantStrings.MailAttributes.QUOTED_PRINTABLE: + case ServiceConstants.MailAttributes.QUOTED_PRINTABLE: result = TransferEncoding.QuotedPrintable; break; - case ConstantStrings.MailAttributes.BASE64: + case ServiceConstants.MailAttributes.BASE64: result = TransferEncoding.Base64; break; default: @@ -626,7 +626,7 @@ private static void AddChildPartsToParent(MailMessageParser child, MailMessagePa ////add the body of the child as alternative view to parent ////this should be the last view attached here, because the POP 3 MIME client ////is supposed to display the last alternative view - if (child.MediaMainType == ConstantStrings.TextMediaMainType && null != child.ContentStream && null != child.Parent.ContentType && child.Parent.ContentType.MediaType.ToUpperInvariant() == ConstantStrings.MultipartMediaType) + if (child.MediaMainType == ServiceConstants.TEXT_MEDIA_MAIN_TYPE && null != child.ContentStream && null != child.Parent.ContentType && child.Parent.ContentType.MediaType.ToUpperInvariant() == ServiceConstants.MULTI_PART_MEDIA_TYPE) { AlternateView thisAlternateView = new AlternateView(child.ContentStream); thisAlternateView.ContentId = RemoveBrackets(child.ContentId); @@ -710,13 +710,13 @@ private MimeEntityReturnCode ProcessDelimitedBody(MailMessageParser message, str private MimeEntityReturnCode ProcessMimeEntity(MailMessageParser message, string parentBoundaryStart) { bool hasParentBoundary = parentBoundaryStart.Length > 0; - string parentBoundaryEnd = parentBoundaryStart + ConstantStrings.Hyphen + ConstantStrings.Hyphen; + string parentBoundaryEnd = parentBoundaryStart + ServiceConstants.HYPHEN + ServiceConstants.HYPHEN; MimeEntityReturnCode boundaryMimeReturnCode; ////some format fields are inherited from parent, only the default for ////ContentType needs to be set here, otherwise the boundary parameter would be ////inherited as well - message.SetContentTypeFields(ConstantStrings.MailContentType); + message.SetContentTypeFields(ServiceConstants.MAIL_CONTENT_TYPE); string completeHeaderField = null; ////consists of one start line and possibly several continuation lines string response; @@ -756,7 +756,7 @@ private MimeEntityReturnCode ProcessMimeEntity(MailMessageParser message, string ////read header field ////one header field can extend over one start line and multiple continuation lines ////a continuation line starts with at least 1 blank (' ') or tab - if (ConstantStrings.Space == Convert.ToString(response[0], CultureInfo.InvariantCulture) || ConstantStrings.HorizontalTab == Convert.ToString(response[0], CultureInfo.InvariantCulture)) + if (ServiceConstants.SPACE == Convert.ToString(response[0], CultureInfo.InvariantCulture) || ServiceConstants.HORIZONTAL_TAB == Convert.ToString(response[0], CultureInfo.InvariantCulture)) { if (completeHeaderField == null) { @@ -769,9 +769,9 @@ private MimeEntityReturnCode ProcessMimeEntity(MailMessageParser message, string } else { - if (ConstantStrings.Space != Convert.ToString(completeHeaderField[completeHeaderField.Length - 1], CultureInfo.InvariantCulture)) + if (ServiceConstants.SPACE != Convert.ToString(completeHeaderField[completeHeaderField.Length - 1], CultureInfo.InvariantCulture)) { - completeHeaderField += ConstantStrings.Space + response.TrimStart(whiteSpaceChars); + completeHeaderField += ServiceConstants.SPACE + response.TrimStart(whiteSpaceChars); } else { @@ -842,11 +842,11 @@ private MimeEntityReturnCode ProcessMimeEntity(MailMessageParser message, string byte[] bodyBytes = System.Convert.FromBase64String(transferEncodedMessage); message.ContentStream = new MemoryStream(bodyBytes, false); - if (message.MediaMainType == ConstantStrings.TextMediaMainType) + if (message.MediaMainType == ServiceConstants.TEXT_MEDIA_MAIN_TYPE) { message.Body = DecodeByteArrayToString(bodyBytes, message.BodyEncoding); } - else if (message.MediaMainType == ConstantStrings.ImageMediaMainType || message.MediaMainType == ConstantStrings.ApplicationMediaMainType || message.MediaMainType == ConstantStrings.MessageMediaMainType) + else if (message.MediaMainType == ServiceConstants.IMAGE_MEDIA_MAIN_TYPE || message.MediaMainType == ServiceConstants.APPLICATION_MEDIA_MAIN_TYPE || message.MediaMainType == ServiceConstants.MESSAGE_MEDIA_MAIN_TYPE) { SaveAttachment(message); isAttachmentSaved = true; @@ -863,7 +863,7 @@ private MimeEntityReturnCode ProcessMimeEntity(MailMessageParser message, string break; } - if (null != message.ContentDisposition && message.ContentDisposition.DispositionType.ToUpperInvariant() == ConstantStrings.MailAttributes.ATTACHMENT && !isAttachmentSaved) + if (null != message.ContentDisposition && message.ContentDisposition.DispositionType.ToUpperInvariant() == ServiceConstants.MailAttributes.ATTACHMENT && !isAttachmentSaved) { SaveAttachment(message); isAttachmentSaved = true; @@ -881,7 +881,7 @@ private void ProcessHeaderField(MailMessageParser message, string headerField) { string headerLineType; string headerLineContent; - int separatorPosition = headerField.IndexOf(ConstantStrings.COLON, StringComparison.CurrentCulture); + int separatorPosition = headerField.IndexOf(ServiceConstants.COLON, StringComparison.CurrentCulture); if (0 < separatorPosition) { ////process header field type @@ -897,53 +897,53 @@ private void ProcessHeaderField(MailMessageParser message, string headerField) switch (headerLineType) { - case ConstantStrings.MailAttributes.BCC: + case ServiceConstants.MailAttributes.BCC: AddMailAddresses(headerLineContent, message.Bcc); break; - case ConstantStrings.MailAttributes.CC: + case ServiceConstants.MailAttributes.CC: AddMailAddresses(headerLineContent, message.CC); break; - case ConstantStrings.MailAttributes.CONTENT_DESCRIPTION: + case ServiceConstants.MailAttributes.CONTENT_DESCRIPTION: message.ContentDescription = headerLineContent; break; - case ConstantStrings.MailAttributes.CONTENT_DISPOSITION: + case ServiceConstants.MailAttributes.CONTENT_DISPOSITION: message.SetContentDisposition(headerLineContent); break; - case ConstantStrings.MailAttributes.CONTENT_ID: + case ServiceConstants.MailAttributes.CONTENT_ID: message.ContentId = headerLineContent; break; - case ConstantStrings.MailAttributes.CONTENT_TRANSFER_ENCODING: + case ServiceConstants.MailAttributes.CONTENT_TRANSFER_ENCODING: message.ContentTransferEncoding = ConvertToTransferEncoding(headerLineContent); break; - case ConstantStrings.MailAttributes.CONTENT_TYPE: + case ServiceConstants.MailAttributes.CONTENT_TYPE: message.SetContentTypeFields(headerLineContent); break; - case ConstantStrings.MailAttributes.DATE: + case ServiceConstants.MailAttributes.DATE: message.DeliveryDate = this.ConvertToDateTime(headerLineContent); break; - case ConstantStrings.MailAttributes.FROM: + case ServiceConstants.MailAttributes.FROM: MailAddress address = ConvertToMailAddress(headerLineContent); if (null != address) { message.From = address; } break; - case ConstantStrings.MailAttributes.SENDER: + case ServiceConstants.MailAttributes.SENDER: message.Sender = ConvertToMailAddress(headerLineContent); break; - case ConstantStrings.MailAttributes.SUBJECT: + case ServiceConstants.MailAttributes.SUBJECT: message.Subject = headerLineContent; break; - case ConstantStrings.MailAttributes.TO: + case ServiceConstants.MailAttributes.TO: AddMailAddresses(headerLineContent, message.To); break; - case ConstantStrings.MailAttributes.IMPORTANCE: + case ServiceConstants.MailAttributes.IMPORTANCE: message.MailImportance = headerLineContent; break; - case ConstantStrings.MailAttributes.CATEGORIES: + case ServiceConstants.MailAttributes.CATEGORIES: message.MailCategories = headerLineContent; break; - case ConstantStrings.MailAttributes.RECEIVED: + case ServiceConstants.MailAttributes.RECEIVED: if (message.ReceivedDate.Year.Equals(1)) { message.ReceivedDate = this.ProcessReceivedDate(headerLineContent); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Microsoft.Legal.MatterCenter.Utility.xproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Microsoft.Legal.MatterCenter.Utility.xproj new file mode 100644 index 00000000..f6af1309 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Microsoft.Legal.MatterCenter.Utility.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + c72caa85-ca6a-4540-aa43-56a4fb2b3efe + Microsoft.Legal.MatterCenter.Utility + .\obj + .\bin + v4.6 + + + + 2.0 + + + diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..e1c68b45 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.Utility")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.Utility")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c72caa85-ca6a-4540-aa43-56a4fb2b3efe")] diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs similarity index 95% rename from tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs rename to tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs index 5f3118ca..9a101fb1 100644 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/QuotedPrintable.cs @@ -67,7 +67,7 @@ public static string HexDecoder(string line) string result = string.Empty; if (null != line) { - Regex re = new Regex(ConstantStrings.HexDecoderRegex, RegexOptions.IgnoreCase); + Regex re = new Regex(ServiceConstants.HEX_DECODER_REGEX, RegexOptions.IgnoreCase); result = re.Replace(line, new MatchEvaluator(HexDecoderEvaluator)); } else @@ -97,7 +97,7 @@ public static string Decode(string encoded) { while (null != (line = stringReader.ReadLine())) { - if (line.EndsWith(ConstantStrings.OperatorEqual, StringComparison.Ordinal)) + if (line.EndsWith(ServiceConstants.OPERATOR_EQUAL, StringComparison.Ordinal)) { stringWriter.Write(HexDecoder(line.Substring(0, line.Length - 1))); } diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/SearchUtility.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/SearchUtility.cs new file mode 100644 index 00000000..8d6214a4 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/SearchUtility.cs @@ -0,0 +1,93 @@ +using Microsoft.Legal.MatterCenter.Models; +using System; +using System.Collections.Generic; +using System.Net; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public static class SearchUtility + { + + /// + /// Encodes search results before saving to the list. + /// + /// SavedSearchDetails object containing Current search details + /// Flag for matter or document search (true = matter, false = document) + public static void EncodeSearchDetails(FilterObject searchDetails, Boolean isMatterSearch) + { + // Encode all the values which are coming from the JS file + searchDetails.FromDate = (null != searchDetails.FromDate) ? WebUtility.HtmlEncode(searchDetails.FromDate) : string.Empty; + searchDetails.ToDate = (null != searchDetails.ToDate) ? WebUtility.HtmlEncode(searchDetails.ToDate) : string.Empty; + + if (searchDetails.AOLList !=null) + { + IList encodedAOLList = new List(); + foreach (string aolList in searchDetails.AOLList) + { + if (!string.IsNullOrWhiteSpace(aolList)) + { + encodedAOLList.Add(WebUtility.HtmlEncode(aolList)); + } + } + searchDetails.AOLList = encodedAOLList; + } + + if (searchDetails.PGList != null) + { + IList encodedPGList = new List(); + foreach (string pgList in searchDetails.PGList) + { + if (!string.IsNullOrWhiteSpace(pgList)) + { + encodedPGList.Add(WebUtility.HtmlEncode(pgList)); + } + } + searchDetails.PGList = encodedPGList; + } + + + if (searchDetails.ClientsList != null) + { + IList encodedClientsList = new List(); + foreach (string clientsList in searchDetails.ClientsList) + { + if (!string.IsNullOrWhiteSpace(clientsList)) + { + encodedClientsList.Add(WebUtility.HtmlEncode(clientsList)); + } + } + searchDetails.ClientsList = encodedClientsList; + } + + if (searchDetails.DocumentAuthor != null) + { + searchDetails.DocumentAuthor = WebUtility.HtmlEncode(searchDetails.DocumentAuthor); + } + + EncodeSearchDetailsUtility(searchDetails, isMatterSearch); + } + + /// + /// Encodes search results before saving to the list. + /// + /// SavedSearchDetails object containing Current search details + /// Flag for matter or document search (true = matter, false = document) + private static void EncodeSearchDetailsUtility(FilterObject searchDetails, Boolean isMatterSearch) + { + if (isMatterSearch && null != searchDetails.Name) // Encode name only in case of Matter search + { + searchDetails.Name = WebUtility.HtmlEncode(searchDetails.Name); + } + + if (null != searchDetails.ResponsibleAttorneys) + { + searchDetails.ResponsibleAttorneys = WebUtility.HtmlEncode(searchDetails.ResponsibleAttorneys); + } + + if (null != searchDetails.SubareaOfLaw) + { + searchDetails.SubareaOfLaw = WebUtility.HtmlEncode(searchDetails.SubareaOfLaw); + } + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/ServiceUtility.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/ServiceUtility.cs new file mode 100644 index 00000000..6a52d1ba --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/Utility/ServiceUtility.cs @@ -0,0 +1,155 @@ +using System; +using StackExchange.Redis; +using Newtonsoft.Json; +using System.Text.RegularExpressions; +using System.Net; +using Microsoft.Legal.MatterCenter.Models; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using System.Dynamic; + +namespace Microsoft.Legal.MatterCenter.Utility +{ + public class ServiceUtility + { + + + public static string RedisCacheHostName + { + get; set; + } + + + /// + /// For matter and document search, the dynamic object would be + /// created to have dynamic properties so that same code will work for project center + /// and matter center + /// + /// + /// + /// + public static void AddProperty(ExpandoObject expando, string propertyName, object propertyValue) + { + var expandoDict = expando as IDictionary; + if (expandoDict.ContainsKey(propertyName)) + expandoDict[propertyName] = propertyValue; + else + expandoDict.Add(propertyName, propertyValue); + + } + + /// + /// Will try to get data from azure redis cache for the given cache key + /// + /// + /// cache data or empty string + public static string GetDataFromAzureRedisCache(string key) + { + string cachedData = string.Empty; + try + { + if (!string.IsNullOrWhiteSpace(RedisCacheHostName) && !string.IsNullOrWhiteSpace(key)) + { + IDatabase cacheDatabase = Connection.GetDatabase(); + cachedData = cacheDatabase.StringGet(key); + if (cachedData == null) + { + cachedData = string.Empty; + } + } + } + catch (Exception exception) + { + cachedData = string.Empty; + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ConstantStrings.LogTableName); + } + return cachedData; + } + + /// + /// Sets the data into Azure redis cache using the given key + /// + /// + /// + /// + /// The value to be set into the Azure redis cache + public static void SetDataIntoAzureRedisCache(string key, T value) + { + string cachedData = string.Empty; + try + { + if (!string.IsNullOrWhiteSpace(RedisCacheHostName) && !string.IsNullOrWhiteSpace(key)) + { + IDatabase cacheDatabase = Connection.GetDatabase(); + var serializeData = JsonConvert.SerializeObject(value); + cacheDatabase.StringSet(key, serializeData, TimeSpan.FromDays(1)); + } + } + catch (Exception exception) + { + //Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ConstantStrings.LogTableName); + } + } + + /// + /// Ensure that only one connection to azure redis cache has been enabled + /// + private static Lazy LazyConnection = new Lazy(() => ConnectionMultiplexer.Connect($"{RedisCacheHostName}")); + + /// + /// + /// + public static ConnectionMultiplexer Connection=> LazyConnection.Value; + + /// + /// Remove Escape character + /// + /// The input message to remove escape character + /// Escape character removed message + public static string RemoveEscapeCharacter(string message)=> Regex.Replace(message, ServiceConstants.ESCAPE_CHARACTER_PATTERN, string.Empty); + + /// + /// Encodes the pinned user details + /// + /// Matter properties + /// Encoded String + public static string EncodeValues(string value)=> !string.IsNullOrWhiteSpace(value) ? WebUtility.HtmlEncode(value.Trim()) : string.Empty; + + /// + /// + /// + /// + /// + /// + public static GenericResponseVM GenericResponse(string code, string value) + { + GenericResponseVM genericResponseVM = new GenericResponseVM(); + genericResponseVM.Code = code; + genericResponseVM.Value = value; + return genericResponseVM; + } + + + /// + /// Gets encoded value for search index property. + /// + /// Key value of the property + /// Encoded value + public static string GetEncodedValueForSearchIndexProperty(List keys) + { + StringBuilder stringBuilder = new StringBuilder(); + + if (null != keys && 0 < keys.Count) + { + foreach (string current in keys) + { + stringBuilder.Append(Convert.ToBase64String(Encoding.Unicode.GetBytes(current))); + stringBuilder.Append(ServiceConstants.PIPE); + } + } + + return Convert.ToString(stringBuilder, CultureInfo.InvariantCulture); + } + } +} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/project.json b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/project.json new file mode 100644 index 00000000..d7014776 --- /dev/null +++ b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Service/Microsoft.Legal.MatterCenter.Utility/project.json @@ -0,0 +1,24 @@ +{ + "version": "1.0.0-*", + "description": "Microsoft.Legal.MatterCenter.Utility Class Library", + "authors": [ "v-lapedd" ], + "dependencies": { + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", + "Microsoft.IdentityModel.Clients.ActiveDirectory": "3.13.1", + "WindowsAzure.Storage": "7.1.3-preview", + "NETStandard.Library": "1.6.0", + "Microsoft.AspNetCore.Authorization": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.NETCore.Portable.Compatibility": "1.0.0", + "Microsoft.SharePointOnline.CSOM": "16.1.5026.1200", + "Microsoft.NETCore.Platforms": "1.0.1", + "MimeKit": "1.3.0-beta7", + "MailKit": "1.3.0-beta7", + "StackExchange.Redis": "1.1.604-alpha", + "Microsoft.AspNetCore.Http.Abstractions": "1.0.0", + "Microsoft.Legal.MatterCenter.Models": "1.0.0-*", + }, + "frameworks": { + "net46": {} + } +} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/GenericFunctions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/GenericFunctions.cs deleted file mode 100644 index 26342a92..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/GenericFunctions.cs +++ /dev/null @@ -1,346 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-nikhid -// Created : 06-16-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file defines methods related to resource files. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Collections; - using System.Configuration; - using System.Globalization; - using System.Reflection; - using System.Resources; - using System.Text; - using System.Web; - #endregion - - /// - /// Generic functions used in SharePoint application. - /// - public static class GenericFunctions - { - /// - /// Gets the data from resource file and stores it in a JSON object. - /// - /// Name of resource file - /// Location of resource file - /// - /// JSON object which will have the data from resource file. - /// - public static string GetResourceData(string fileName, string resourceFileLocation) - { - ResourceSet resourceSet; - StringBuilder scriptBuilder = new StringBuilder(); - try - { - using (ResXResourceReader resxReader = new ResXResourceReader(HttpContext.Current.Server.MapPath(@"~/" + resourceFileLocation + ConstantStrings.ForwardSlash + fileName + ConstantStrings.ResourceFileExtension))) - { - resourceSet = new ResourceSet(resxReader); - foreach (DictionaryEntry entry in resourceSet) - { - string resourceKey = (string)entry.Key; - object resource = entry.Value; - scriptBuilder.Append("\"" + resourceKey + "\":" + "\"" + resource + "\","); - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - - return string.Concat(Convert.ToString(scriptBuilder, CultureInfo.InvariantCulture).TrimEnd(',')); - } - - /// - /// Forms the global object with configurable data from Azure. - /// - /// The resource file containing Global Configurations details - /// JSON object which will have the data from resource file - /// Location of resource file - /// - /// JavaScript object as string - /// - public static string SetGlobalConfigurations(string resourceFile, string jsonObject, Enumerators.ResourceFileLocation resourceFileLocation) - { - StringBuilder scriptBuilder = new StringBuilder(); - try - { - if (!string.IsNullOrWhiteSpace(resourceFile) && !string.IsNullOrWhiteSpace(jsonObject)) - { - // Add the script tag - scriptBuilder.Append(""); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - - return Convert.ToString(scriptBuilder, CultureInfo.InvariantCulture); - } - - /// - /// Sets the error object to be stored on the page - /// - /// Property to check if the error has occurred - /// The object having a code:value pair - /// JavaScript object as string - public static string SetErrorResponse(string isErrorOccured, string errorPopupData) - { - StringBuilder scriptBuilder = new StringBuilder(); - try - { - // Add the script tag - scriptBuilder.Append(""); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - - return Convert.ToString(scriptBuilder, CultureInfo.InvariantCulture); - } - - /// - /// Set the cookies required by Matter Center app - /// - /// Request Object - /// Response Object - /// Redirect URL - /// Object to fetch constants from resource file - /// Name of the app specific resource file - /// Parameter to check if Token Request failed or not - /// Refresh Token - private static string SetMatterCenterCookie(HttpRequest request, HttpResponse response, string redirectURL, string constantFileObject, string constantFile, bool isTokenRequestFailure) - { - string refreshToken = string.Empty; - //// Redirect in case of the App Token is not set by SharePoint - if (string.IsNullOrEmpty(request.Form[UIConstantStrings.SPAppToken])) - { - response.Redirect(redirectURL, false); - } - else - { - //// Regenerate the refresh token from Sp App Token - refreshToken = UIUtility.GetRefreshToken(request.Form[UIConstantStrings.SPAppToken]); - if (isTokenRequestFailure) - { - //// Reset the cookie with new value of refresh token - response.Cookies[UIConstantStrings.refreshToken].Value = refreshToken; - } - else - { - HttpCookie data = new HttpCookie(UIConstantStrings.refreshToken, refreshToken); - data.Secure = true; - data.Expires = DateTime.Now.AddHours(Convert.ToInt32(UIConstantStrings.RefreshTokenCookieExpiration, CultureInfo.InvariantCulture)); - response.Cookies.Add(data); - SetResponse(request, response, constantFileObject, constantFile, refreshToken); - response.Write(UIUtility.SetSharePointResponse(refreshToken)); - } - } - return refreshToken; - } - - /// - /// Sets constants response from resource file and stores the refresh token in the cookie. - /// - /// Request Object - /// Response Object - /// Cookie Name - /// Redirect URL - /// Object to fetch constants from resource file - /// Name of the app specific resource file - internal static void SetConstantsResponse(HttpRequest request, HttpResponse response, string redirectURL, string constantFileObject, string constantFile) - { - string refreshToken = string.Empty; - try - { - bool environment = Convert.ToBoolean(UIConstantStrings.IsDeployedOnAzure, CultureInfo.InvariantCulture); - if (environment) - { - //// Check if page loaded due to Token Request failure issue (Query string will contain IsInvalidToken parameter) - if (request.Url.Query.ToString().ToUpperInvariant().Contains(UIConstantStrings.TokenRequestFailedQueryString.ToUpperInvariant())) - { - refreshToken = SetMatterCenterCookie(request, response, redirectURL, constantFileObject, constantFile, true); - } - else - { - refreshToken = (null != request.Cookies[UIConstantStrings.refreshToken]) ? request.Cookies[UIConstantStrings.refreshToken].Value : string.Empty; - } - if (string.IsNullOrWhiteSpace(refreshToken)) - { - refreshToken = SetMatterCenterCookie(request, response, redirectURL, constantFileObject, constantFile, false); - } - else - { - string DecryptedrefreshToken = string.Empty; - string key = ConfigurationManager.AppSettings["Encryption_Key"]; - if (!string.IsNullOrWhiteSpace(key)) - { - DecryptedrefreshToken = EncryptionDecryption.Decrypt(refreshToken, key); - if (!string.IsNullOrWhiteSpace(DecryptedrefreshToken)) - { - SetResponse(request, response, constantFileObject, constantFile, refreshToken); - response.Write(UIUtility.SetSharePointResponse(refreshToken)); - } - else - { - key = ConfigurationManager.AppSettings["Old_Encryption_Key"]; - if (!string.IsNullOrWhiteSpace(key)) - { - DecryptedrefreshToken = EncryptionDecryption.Decrypt(refreshToken, key); - if (!string.IsNullOrWhiteSpace(DecryptedrefreshToken)) - { - request.Cookies[UIConstantStrings.refreshToken].Value = refreshToken = EncryptionDecryption.Encrypt(DecryptedrefreshToken); - SetResponse(request, response, constantFileObject, constantFile, refreshToken); - response.Write(UIUtility.SetSharePointResponse(refreshToken)); - } - } - } - } - } - } - else - { - SetResponse(request, response, constantFileObject, constantFile, refreshToken); - response.Write(UIUtility.SetSharePointResponse(refreshToken)); - } - } - catch (Exception exception) - { - string result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, result)); - } - } - - /// - /// Sets response on the page. - /// - /// Request Object - /// Response Object - /// Name of the constant file object - /// Name of the constant file - /// Name of the global constant file - /// Deployed on Azure flag - /// Refresh Token for client context - private static void SetResponse(HttpRequest request, HttpResponse response, string constantFileObject, string constantFile, string refreshToken) - { - bool bContainsEdit = false, isSettingsPage = false; - try - { - bContainsEdit = request.Url.Query.Contains(UIConstantStrings.IsEdit); - string url = HttpUtility.UrlDecode(request.Url.Query); - if (bContainsEdit) - { - string clientUrl = HttpUtility.ParseQueryString(url).Get(UIConstantStrings.clientUrl); - string matterName = HttpUtility.ParseQueryString(url).Get(UIConstantStrings.matterName); - if (!UIUtility.GetUserAccess(refreshToken, new Uri(ConstantStrings.ProvisionMatterAppURL), request) || !UIUtility.CheckUserManagePermission(refreshToken, new Uri(clientUrl), matterName, request)) - { - response.Write(UIConstantStrings.EditMatterAccessDeniedMessage); - response.End(); - } - } - else if (string.Equals(constantFile, ConstantStrings.ConstantFileForSettings, StringComparison.OrdinalIgnoreCase)) - { - isSettingsPage = true; - string clientdetails = HttpUtility.ParseQueryString(url).Get(UIConstantStrings.clientDetails); - string clientUrl = string.IsNullOrWhiteSpace(clientdetails) ? UIConstantStrings.TenantUrl : clientdetails.Split(new string[] { ConstantStrings.DOLLAR + ConstantStrings.Pipe + ConstantStrings.DOLLAR }, StringSplitOptions.RemoveEmptyEntries)[0]; - if (!ServiceUtility.GetUserGroup(refreshToken, new Uri(clientUrl), request)) - { - response.Write(string.Format(CultureInfo.InvariantCulture, UIConstantStrings.SettingsPageAccessDeniedMessage, UIConstantStrings.MatterCenterSupportEmail)); - response.End(); - } - } - else - { - if (string.Equals(constantFile, ConstantStrings.ConstantFileForProvision, StringComparison.OrdinalIgnoreCase)) - { - if (!UIUtility.GetUserAccess(refreshToken, new Uri(ConstantStrings.ProvisionMatterAppURL), request)) - { - response.Redirect(UIConstantStrings.ServicePathFindMatter, false); - } - } - } - - response.Write(SetGlobalConfigurations("Constants", UIConstantStrings.GlobalConstants, Enumerators.ResourceFileLocation.App_GlobalResources)); - response.Write(SetGlobalConfigurations(constantFile, constantFileObject, Enumerators.ResourceFileLocation.App_LocalResources)); - } - catch (Exception exception) - { - if (!bContainsEdit && !isSettingsPage) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - } - } - - /// - /// Gets the redirect URL. - /// - /// redirect URL - internal static string GetRedirectURL(HttpRequest request) - { - try - { - string redirectURL = string.Empty; - if (!string.IsNullOrWhiteSpace(request.Url.Query)) - { - redirectURL = string.Concat(UIConstantStrings.AppRedirectURL, ConstantStrings.QUESTION, ConstantStrings.ClientId, ConstantStrings.OperatorEqual, UIConstantStrings.ClientID, ConstantStrings.OperatorAmpersand, ConstantStrings.RedirectUrl, ConstantStrings.OperatorEqual, request.Url.AbsoluteUri.Replace(ConstantStrings.HTTP + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash, ConstantStrings.HTTPS + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash).Replace(request.Url.Query, string.Empty), ConstantStrings.QUESTION, ConstantStrings.StandardToken); - } - else - { - redirectURL = string.Concat(UIConstantStrings.AppRedirectURL, ConstantStrings.QUESTION, ConstantStrings.ClientId, ConstantStrings.OperatorEqual, UIConstantStrings.ClientID, ConstantStrings.OperatorAmpersand, ConstantStrings.RedirectUrl, ConstantStrings.OperatorEqual, request.Url.AbsoluteUri.Replace(ConstantStrings.HTTP + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash, ConstantStrings.HTTPS + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash), ConstantStrings.QUESTION, ConstantStrings.StandardToken); - } - - return redirectURL; - } - catch (Exception exception) - { - return Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - } - - /// - /// Append appropriate query parameter to identify application type - /// - /// Redirect URL - /// HTTP request - /// Redirect URL with appropriate query parameter appended - internal static string AppendQueryParameter(string redirectURL, HttpRequest request) - { - if (!string.IsNullOrWhiteSpace(request.Url.Query)) - { - redirectURL = string.Concat(redirectURL, ConstantStrings.QUESTION, UIConstantStrings.QUERY_PARAMETER_APPTYPE, ConstantStrings.OperatorEqual); - string appType = request.QueryString[UIConstantStrings.QUERY_PARAMETER_APPTYPE]; - if (!string.IsNullOrEmpty(appType)) - { - if (string.Equals(appType, UIConstantStrings.IS_OUTLOOK, StringComparison.OrdinalIgnoreCase)) - { - redirectURL = string.Concat(redirectURL, UIConstantStrings.IS_OUTLOOK); - } - else if (string.Equals(appType, UIConstantStrings.IS_OFFICE, StringComparison.OrdinalIgnoreCase)) - { - redirectURL = string.Concat(redirectURL, UIConstantStrings.IS_OFFICE); - } - } - } - return redirectURL; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/UIConstantStrings.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/UIConstantStrings.cs deleted file mode 100644 index 925203ea..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_Code/UIConstantStrings.cs +++ /dev/null @@ -1,572 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-nikhid -// Created : 06-16-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file holds all the constants used in the app web. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - #endregion - - /// - /// Holds all the variables used in the app web. - /// - public static class UIConstantStrings - { - /// - /// Query parameter app type - /// - internal const string QUERY_PARAMETER_APPTYPE = "appType"; - - /// - /// Name for refreshToken cookie - /// - internal const string refreshToken = "refreshToken"; - - /// - /// Name of SpAppToken - /// - internal const string SPAppToken = "SPAppToken"; - - /// - /// Name of Global constants file object - /// - internal const string GlobalConstants = "oGlobalConstants"; - - /// - /// IsEdit query string - /// - internal const string IsEdit = "IsEdit"; - - /// - /// matterName query string - /// - internal const string matterName = "matterName"; - - /// - /// clientUrl query string - /// - internal const string clientUrl = "clientUrl"; - - /// - /// clientDetails query string - /// - internal const string clientDetails = "clientDetails"; - - /// - /// The is deployed on azure - /// - private static string isDeployedOnAzure = ConstantStrings.GetConfigurationFromResourceFile("Constants", "IsDeployedOnAzure", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The log table name - /// - private static string logTableName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "UILogTableName", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The message with no inputs - /// - private static string messageNoInputs = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Message_No_Inputs", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The App redirect URL - /// - private static string appRedirectURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "App_Redirect_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The client identifier - /// - private static string clientID = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ClientID", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The central repository - /// - private static string centralRepository = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Central_Repository_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The service path find matter for outlook - /// - private static string servicePathFindMatter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "ServicePath_FindMatter", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The error having invalid character - /// - private static string errorInvalidCharacter = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Error_Invalid_Character", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The temp email name - /// - private static string emailName = ConstantStrings.GetConfigurationFromResourceFile("WebDashboard", "Temp_Email_Name", Enumerators.ResourceFileLocation.App_LocalResources); - - /// - /// The provision matter app name - /// - private static string provisionMatterName = ConstantStrings.GetConfigurationFromResourceFile("Constants", "App_Name_Provision_Matters", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// - /// - private static string timeStampFormat = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Time_Stamp_Format", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The tenant URL - /// - private static string siteURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Site_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The sign out page URL - /// - private static string signOutURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Sign_Out_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The user photo URL - /// - private static string userPhotoURL = ConstantStrings.GetConfigurationFromResourceFile("Constants", "User_Photo_Src", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The personal URL separator to extract my-site URL and account name - /// - private static string personalURLSeparator = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Perosnal_URL_Separator", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The access denied message for adding or editing team members with insufficient permissions - /// - private static string editMatterAccessDeniedMessage = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Edit_Matter_Access_Denied_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query parameter value for Outlook app - /// - private static string is_Outlook = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Querystring_Outlook", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query parameter value for Office app - /// - private static string is_Office = ConstantStrings.GetConfigurationFromResourceFile("Constants", "Querystring_Office", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Query parameter value in case of Token Request failed exception - /// - internal static string TokenRequestFailedQueryString = ConstantStrings.GetConfigurationFromResourceFile("Constants", "TokenRequestFailedQueryString", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// Expiration period of refresh token cookie in hours - /// - internal static string RefreshTokenCookieExpiration = ConstantStrings.GetConfigurationFromResourceFile("Constants", "RefreshTokenCookieExpiration", Enumerators.ResourceFileLocation.App_GlobalResources); - - /// - /// The query string for Edit Matter. The private variable is required as it has both getter and setter property. - /// - private static string editMatterQueryString = string.Empty; - - /// - /// The query string for settings page. - /// - private static string settingsPageQueryString = string.Empty; - - /// - /// The query string for Send To OneDrive page. - /// - private static string sendToOneDriveQueryString = string.Empty; - - /// - /// The user photo small size code - /// - internal static string userPhotoSmall = "S"; - - /// - /// The user photo medium size code - /// - internal static string userPhotoMedium = "M"; - - /// - /// Title attribute used to set the tooltip - /// - internal static string titleAttribute = "title"; - - /// - /// User access for Provision Matter - /// - internal static bool provisionMatterAccess = false; - - /// - /// Get the deployment status - /// - /// - /// The name of the Azure deployment flag. - /// - internal static string IsDeployedOnAzure - { - get - { - return isDeployedOnAzure; - } - } - - /// - /// Gets the name of the log table. - /// - /// - /// The name of the log table. - /// - internal static string LogTableName - { - get - { - return logTableName; - } - } - - /// - /// Gets the name of the temporary email. - /// - /// - /// The name of the temporary email. - /// - internal static string EmailName - { - get - { - return emailName; - } - } - - /// - /// Gets the message with no inputs. - /// - /// - /// The message no inputs. - /// - internal static string MessageNoInputs - { - get - { - return messageNoInputs; - } - } - - /// - /// Gets the application redirect URL. - /// - /// - /// The application redirect URL. - /// - internal static string AppRedirectURL - { - get - { - return appRedirectURL; - } - } - - /// - /// Gets the client identifier. - /// - /// - /// The client identifier. - /// - internal static string ClientID - { - get - { - return clientID; - } - } - - /// - /// Gets the central repository. - /// - /// - /// The central repository. - /// - internal static string CentralRepository - { - get - { - return centralRepository; - } - } - - /// - /// Gets the service path find matter for outlook. - /// - /// - /// The service path find matter for outlook. - /// - internal static string ServicePathFindMatter - { - get - { - return servicePathFindMatter; - } - } - - /// - /// Gets the error with invalid character. - /// - /// - /// The error with invalid character. - /// - internal static string ErrorInvalidCharacter - { - get - { - return errorInvalidCharacter; - } - } - - /// - /// Get the query string parameter value for Outlook app - /// - /// - /// The value of the Outlook app that has been used in query parameter - /// - internal static string IS_OUTLOOK - { - get - { - return is_Outlook; - } - } - - /// - /// Get the query string parameter value for Office app - /// - /// - /// The value for the Office app that has been used in query parameter - /// - internal static string IS_OFFICE - { - get - { - return is_Office; - } - } - - /// - /// Get the URL Referrer Cookie Name - /// - /// - /// The name of the URL Referrer Cookie. - /// - internal static string URLReferrerCookieName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "URLReferrerCookieName", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Get the Request Token Cookie Name - /// - /// - /// The name of the Request Token Cookie Name. - /// - internal static string RequestTokenCookieName - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "RequestTokenCookieName", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Gets office.js file path - /// - public static string OfficeJSPath - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Office_JS_URL", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Get the Request Token Cookie Name - /// - /// - /// The name of the Request Token Cookie Name. - /// - internal static string ProvisionMatterName - { - get - { - return provisionMatterName; - } - } - /// - /// - /// - internal static string TimeStampFormat - { - get - { - return timeStampFormat; - } - } - - /// - /// Get the tenant site URL - /// - internal static string SiteURL - { - get - { - return siteURL; - } - } - - /// - /// Get the sign out page URL - /// - internal static string SignOutURL - { - get - { - return signOutURL; - } - } - - /// - /// Get the sign out page URL - /// - internal static string UserPhotoURL - { - get - { - return userPhotoURL; - } - } - - /// - /// Get the sign out page URL - /// - internal static string PersonalURLSeparator - { - get - { - return personalURLSeparator; - } - } - - /// - /// Get the access denied message for adding or editing team members with insufficient permissions - /// - internal static string EditMatterAccessDeniedMessage - { - get - { - return editMatterAccessDeniedMessage; - } - } - - /// - /// The query string for Edit Matter - /// - internal static string EditMatterQueryString - { - get - { - return editMatterQueryString; - } - set - { - editMatterQueryString = value; - } - } - - /// - /// The query string for settings page - /// - internal static string SettingsPageQueryString - { - get - { - return settingsPageQueryString; - } - set - { - settingsPageQueryString = value; - } - } - - /// - /// The query string for Send To OneDrive page - /// - internal static string SendToOneDriveQueryString - { - get - { - return sendToOneDriveQueryString; - } - set - { - sendToOneDriveQueryString = value; - } - } - - /// - /// Get access denied message for the settings page - /// - /// - /// The access denied message for the settings page - /// - internal static string SettingsPageAccessDeniedMessage - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Settings_Page_Access_Denied_Message", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Get the Matter Center support URL - /// - /// - /// The email of Matter Center support - /// - internal static string MatterCenterSupportEmail - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Matter_Center_Support_Email", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - - /// - /// Boolean variable for user access for Provision Matter - /// - internal static bool ProvisionMatterAccess - { - get - { - return provisionMatterAccess; - } - set - { - provisionMatterAccess = value; - } - } - /// - /// Get tenant URL for the Matter Center app - /// - /// - /// The tenant URL for the Matter Center app - /// - internal static string TenantUrl - { - get - { - return ConstantStrings.GetConfigurationFromResourceFile("Constants", "Tenant_Url", Enumerators.ResourceFileLocation.App_GlobalResources); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.Designer.cs deleted file mode 100644 index f30508d4..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.Designer.cs +++ /dev/null @@ -1,2385 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_GlobalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Constants { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Constants() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_GlobalResources.Constants", typeof(Constants).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to /AddToMailCart. - /// - internal static string Add_To_Mail_Cart { - get { - return ResourceManager.GetString("Add_To_Mail_Cart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to #. - /// - internal static string Admin_Support_URL { - get { - return ResourceManager.GetString("Admin_Support_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage documents: view, edit, or pin a document. - /// - internal static string All_Documents_Message { - get { - return ResourceManager.GetString("All_Documents_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All documents. - /// - internal static string All_Documents_Title { - get { - return ResourceManager.GetString("All_Documents_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Forms/AllItems.aspx. - /// - internal static string All_Items_Extension { - get { - return ResourceManager.GetString("All_Items_Extension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage matters: upload emails or documents to a matter, review matter details, or pin matters. - /// - internal static string All_Matters_Message { - get { - return ResourceManager.GetString("All_Matters_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All matters. - /// - internal static string All_Matters_Title { - get { - return ResourceManager.GetString("All_Matters_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to App Landing Page. - /// - internal static string App_Name_App_Landing_Page { - get { - return ResourceManager.GetString("App_Name_App_Landing_Page", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Provision Matters. - /// - internal static string App_Name_Provision_Matters { - get { - return ResourceManager.GetString("App_Name_Provision_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Documents. - /// - internal static string App_Name_Search_Documents { - get { - return ResourceManager.GetString("App_Name_Search_Documents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Matters. - /// - internal static string App_Name_Search_Matters { - get { - return ResourceManager.GetString("App_Name_Search_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Settings. - /// - internal static string App_Name_Settings_Page { - get { - return ResourceManager.GetString("App_Name_Settings_Page", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Web Dashboard. - /// - internal static string App_Name_Web_Dashboard { - get { - return ResourceManager.GetString("App_Name_Web_Dashboard", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter app redirect URL for tenant, e.g. https://[TENANTNAME].sharepoint.com/sites/catalog/_layouts/15/appredirect.aspx]. - /// - internal static string App_Redirect_URL { - get { - return ResourceManager.GetString("App_Redirect_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter Application Insights ID specific to environment, e.g. a70d9cb8-e6f0-c8e7-0cbb8d1d-a4cf342c]. - /// - internal static string Application_Insight_App_Id { - get { - return ResourceManager.GetString("Application_Insight_App_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCAreaofLaw. - /// - internal static string Area_Of_Law { - get { - return ResourceManager.GetString("Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MSITOfficeAuthor. - /// - internal static string Author { - get { - return ResourceManager.GetString("Author", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Browser. - /// - internal static string Browser { - get { - return ResourceManager.GetString("Browser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the central repository where all the common lists are stored, e.g. https://[TENANTNAME].sharepoint.com/sites/catalog]. - /// - internal static string Central_Repository_Url { - get { - return ResourceManager.GetString("Central_Repository_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error occurred while checking out the document:. - /// - internal static string Check_Out_Document_Fail { - get { - return ResourceManager.GetString("Check_Out_Document_Fail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File does not exist.. - /// - internal static string Checked_Out_File_Not_Found { - get { - return ResourceManager.GetString("Checked_Out_File_Not_Found", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to It might have been moved or deleted.. - /// - internal static string Checked_Out_File_Not_Found_Moved_Deleted { - get { - return ResourceManager.GetString("Checked_Out_File_Not_Found_Moved_Deleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientID, ClientURL. - /// - internal static string Client_Custom_Properties { - get { - return ResourceManager.GetString("Client_Custom_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientId. - /// - internal static string Client_Custom_Properties_Id { - get { - return ResourceManager.GetString("Client_Custom_Properties_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientURL. - /// - internal static string Client_Custom_Properties_Url { - get { - return ResourceManager.GetString("Client_Custom_Properties_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientID. - /// - internal static string Client_ID { - get { - return ResourceManager.GetString("Client_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientName. - /// - internal static string Client_Name { - get { - return ResourceManager.GetString("Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ClientName. - /// - internal static string Client_Name_Search_Term { - get { - return ResourceManager.GetString("Client_Name_Search_Term", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Clients. - /// - internal static string Client_Term_Set_Name { - get { - return ResourceManager.GetString("Client_Term_Set_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter Client ID of SharePoint App from the specific Tenancy, e.g. 4e55c7b2-eb66a-753e7-2679ac37be8b08]. - /// - internal static string ClientID { - get { - return ResourceManager.GetString("ClientID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to .. - /// - internal static string ClientID_MatterID_Separator { - get { - return ResourceManager.GetString("ClientID_MatterID_Separator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Clients. - /// - internal static string Clients { - get { - return ResourceManager.GetString("Clients", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /CloseAdvanceSearch. - /// - internal static string Close_Advance_Search { - get { - return ResourceManager.GetString("Close_Advance_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div class=\"ms-ChoiceField columnPickerCheckBox\"><input class=\"ms-ChoiceField-input {3}\" id=\"options-checkbox-unselected{0}\" type=\"checkbox\" onChange=\"oCommonObject.onColumnPickerCheckboxClick({2},event)\"/><label class=\"ms-ChoiceField-field {3}\" for=\"options-checkbox-unselected{0}\"><span class=\"ms-Label columnOptionName\" title=\"{1}\">{1}</span></label></div>. - /// - internal static string ColumnPickerChunk { - get { - return ResourceManager.GetString("ColumnPickerChunk", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterTerms. - /// - internal static string Common_Term_Set_Group_Name { - get { - return ResourceManager.GetString("Common_Term_Set_Group_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Content check has been aborted.. - /// - internal static string Content_Check_Abort { - get { - return ResourceManager.GetString("Content_Check_Abort", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Contextual help. - /// - internal static string Contextual_help { - get { - return ResourceManager.GetString("Contextual_help", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Convenience copy only available. - /// - internal static string Convenience_copy_available { - get { - return ResourceManager.GetString("Convenience_copy_available", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /CreateMatter. - /// - internal static string Create_Matter { - get { - return ResourceManager.GetString("Create_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to created. - /// - internal static string Created { - get { - return ResourceManager.GetString("Created", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Created. - /// - internal static string Created_Date { - get { - return ResourceManager.GetString("Created_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to mm/dd/yy. - /// - internal static string DatePickerFormat { - get { - return ResourceManager.GetString("DatePickerFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -1D. - /// - internal static string DatePickerFromMaxDate { - get { - return ResourceManager.GetString("DatePickerFromMaxDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -70:+70. - /// - internal static string DatePickerFromYearRange { - get { - return ResourceManager.GetString("DatePickerFromYearRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to +0D. - /// - internal static string DatePickerToMaxDate { - get { - return ResourceManager.GetString("DatePickerToMaxDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -70:+10. - /// - internal static string DatePickerToYearRange { - get { - return ResourceManager.GetString("DatePickerToYearRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 60. - /// - internal static string Default_Filter_Container_Height { - get { - return ResourceManager.GetString("Default_Filter_Container_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 130. - /// - internal static string Default_Flyout_Container_Height { - get { - return ResourceManager.GetString("Default_Flyout_Container_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 90. - /// - internal static string Default_Flyout_Wrapper_Height { - get { - return ResourceManager.GetString("Default_Flyout_Wrapper_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 30. - /// - internal static string Default_Record_Height { - get { - return ResourceManager.GetString("Default_Record_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Delve. - /// - internal static string Delve { - get { - return ResourceManager.GetString("Delve", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter Delve link URL, e.g. https://[TENANTNAME]-my.sharepoint.com/_layouts/15/me.aspx?q=]. - /// - internal static string Delve_Link { - get { - return ResourceManager.GetString("Delve_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to description. - /// - internal static string Description { - get { - return ResourceManager.GetString("Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterMatters. - /// - internal static string DMS_Matter_List_Name { - get { - return ResourceManager.GetString("DMS_Matter_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterRoles. - /// - internal static string DMS_Role_List_Name { - get { - return ResourceManager.GetString("DMS_Role_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Checked out copy available. - /// - internal static string Document_Checked_Out_Message { - get { - return ResourceManager.GetString("Document_Checked_Out_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCDocumentClientID. - /// - internal static string Document_Client_ID { - get { - return ResourceManager.GetString("Document_Client_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCDocumentClientName. - /// - internal static string Document_Client_Name { - get { - return ResourceManager.GetString("Document_Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to dlcDocIdOWSText. - /// - internal static string Document_ID { - get { - return ResourceManager.GetString("Document_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Document info. - /// - internal static string Document_Info { - get { - return ResourceManager.GetString("Document_Info", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCModifiedDate. - /// - internal static string Document_Last_Modified_Time { - get { - return ResourceManager.GetString("Document_Last_Modified_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString12. - /// - internal static string Document_Matter_ID { - get { - return ResourceManager.GetString("Document_Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString13. - /// - internal static string Document_Matter_Name { - get { - return ResourceManager.GetString("Document_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /DocumentTextboxSearch. - /// - internal static string Document_Textbox_Search { - get { - return ResourceManager.GetString("Document_Textbox_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/documentDetails.aspx. - /// - internal static string DocumentLandingURL { - get { - return ResourceManager.GetString("DocumentLandingURL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Edit Document. - /// - internal static string Edit_Document { - get { - return ResourceManager.GetString("Edit_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You do not have sufficient permissions to add or edit the team members. - /// - internal static string Edit_Matter_Access_Denied_Message { - get { - return ResourceManager.GetString("Edit_Matter_Access_Denied_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong while updating the users for the matter. - /// - internal static string Edit_Matter_Failure { - get { - return ResourceManager.GetString("Edit_Matter_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Insufficient Query string parameters. - /// - internal static string Edit_Matter_Insufficient_Parameter { - get { - return ResourceManager.GetString("Edit_Matter_Insufficient_Parameter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} cannot be empty.. - /// - internal static string Edit_Matter_Validate_User { - get { - return ResourceManager.GetString("Edit_Matter_Validate_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /EmailAttachment. - /// - internal static string Email_Attachment { - get { - return ResourceManager.GetString("Email_Attachment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Email. - /// - internal static string Email_Folder_Name { - get { - return ResourceManager.GetString("Email_Folder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /EmailLink. - /// - internal static string Email_Link { - get { - return ResourceManager.GetString("Email_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ^[\\s]*\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*[\\s]*$. - /// - internal static string Email_Validation_Regex { - get { - return ResourceManager.GetString("Email_Validation_Regex", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Search. - /// - internal static string Enterprise_Search { - get { - return ResourceManager.GetString("Enterprise_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 125. - /// - internal static string Error_Code_Security_Group_Exists { - get { - return ResourceManager.GetString("Error_Code_Security_Group_Exists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid characters in file name. Following characters are not allowed in file name: ~ # % &amp; * : &lt; &gt; ? / \"{ | }. - /// - internal static string Error_Invalid_Character { - get { - return ResourceManager.GetString("Error_Invalid_Character", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The search request is invalid, update the fields and try again.. - /// - internal static string Error_Invalid_Search_Request { - get { - return ResourceManager.GetString("Error_Invalid_Search_Request", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An unexpected error has occured while performing your last action. Please <a class='ErrorPoUpLinks TryAgainLink' href=''>try again</a>. If this issue persist, please contact your <a class='ErrorPoUpLinks AdminLink' target='_blank' href=''>administrator</a>.. - /// - internal static string Error_Pop_Up_Message { - get { - return ResourceManager.GetString("Error_Pop_Up_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000010. - /// - internal static string ErrorCodeOneDriveNotConfigured { - get { - return ResourceManager.GetString("ErrorCodeOneDriveNotConfigured", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The documents were not sent as OneDrive is not yet configured, <span class=\"briefcaseURL\" onClick=\"window.open(\'{0}\', \'_blank\')\">click here</span> to configure your OneDrive and try again.. - /// - internal static string ErrorMessageOneDriveNotConfigured { - get { - return ResourceManager.GetString("ErrorMessageOneDriveNotConfigured", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong while sending documents to OneDrive.. - /// - internal static string ErrorMessageSendToOneDrive { - get { - return ResourceManager.GetString("ErrorMessageSendToOneDrive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pages/. - /// - internal static string Events_Tracking_Pages { - get { - return ResourceManager.GetString("Events_Tracking_Pages", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong!. - /// - internal static string Failure_Message { - get { - return ResourceManager.GetString("Failure_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to fileextension. - /// - internal static string File_Extension { - get { - return ResourceManager.GetString("File_Extension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileName. - /// - internal static string File_Name { - get { - return ResourceManager.GetString("File_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File is not available. - /// - internal static string File_Not_Available { - get { - return ResourceManager.GetString("File_Not_Available", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to retrieve document check-out status.. - /// - internal static string File_Not_Available_Error { - get { - return ResourceManager.GetString("File_Not_Available_Error", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no items that match this filter. - /// - internal static string FilterFlyout_NoResult { - get { - return ResourceManager.GetString("FilterFlyout_NoResult", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 50. - /// - internal static string FilterFlyoutItemsPerCall { - get { - return ResourceManager.GetString("FilterFlyoutItemsPerCall", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 5. - /// - internal static string FilterLazyLoadingLimit { - get { - return ResourceManager.GetString("FilterLazyLoadingLimit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to T00:00:00Z. - /// - internal static string From_Date_Append_Time { - get { - return ResourceManager.GetString("From_Date_Append_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Go to Document Details page. - /// - internal static string Go_To_Document_Landing { - get { - return ResourceManager.GetString("Go_To_Document_Landing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Go to Matter Sites. - /// - internal static string Go_To_Matter_Sites { - get { - return ResourceManager.GetString("Go_To_Matter_Sites", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /GoToOneNote. - /// - internal static string Go_To_OneNote { - get { - return ResourceManager.GetString("Go_To_OneNote", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 710. - /// - internal static string GridView_BreakPoint { - get { - return ResourceManager.GetString("GridView_BreakPoint", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All column headers. - /// - internal static string GridViewAllColumnOption { - get { - return ResourceManager.GetString("GridViewAllColumnOption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 21. - /// - internal static string GridViewItemsPerPage { - get { - return ResourceManager.GetString("GridViewItemsPerPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 95. - /// - internal static string GridViewLazyLoadingLimit { - get { - return ResourceManager.GetString("GridViewLazyLoadingLimit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to documenturl. - /// - internal static string GridViewPinnedDocumentUrl { - get { - return ResourceManager.GetString("GridViewPinnedDocumentUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Home page. - /// - internal static string Home_page { - get { - return ResourceManager.GetString("Home_page", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to image/. - /// - internal static string Image_ContentType { - get { - return ResourceManager.GetString("Image_ContentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter path of icon to display as per document selected e.g. https://[TENANTNAME].sharepoint.com/_layouts/15/images/ic{0}.gif]. - /// - internal static string Image_Document_Icon { - get { - return ResourceManager.GetString("Image_Document_Icon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter path of icon to display for general document e.g. https://[TENANTNAME].sharepoint.com/_layouts/15/images/generaldocument.png]. - /// - internal static string Image_General_Document { - get { - return ResourceManager.GetString("Image_General_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 126. - /// - internal static string Incorrect_Team_Members_Code { - get { - return ResourceManager.GetString("Incorrect_Team_Members_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sending this file to One-Drive will not checkout the DMS version to you because its already checked out by another user.. - /// - internal static string Info_Popup_Document_Already_Check_Out { - get { - return ResourceManager.GetString("Info_Popup_Document_Already_Check_Out", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to When sending to your OneDrive the DMS version will be checked out to you until you check it back in.. - /// - internal static string Info_Popup_Document_Check_Out { - get { - return ResourceManager.GetString("Info_Popup_Document_Check_Out", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An unexpected error has occured while retrieving the document. Please <a class=\\'ErrorPoUpLinks ErrorTryAgainLink\\' href=\\'\\'>try again</a>. If this issue persist, please contact your <a class=\\'ErrorPoUpLinks AdminLink\\' target=\\'_blank\\' href=\\'\\'>administrator</a>\.. - /// - internal static string Info_Popup_Error_Message { - get { - return ResourceManager.GetString("Info_Popup_Error_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to True. - /// - internal static string IsDeployedOnAzure { - get { - return ResourceManager.GetString("IsDeployedOnAzure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to isreadonlyuser. - /// - internal static string IsReadOnly { - get { - return ResourceManager.GetString("IsReadOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to True. - /// - internal static string IsTenantDeployment { - get { - return ResourceManager.GetString("IsTenantDeployment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LastModifiedTime. - /// - internal static string Last_Modified_Time { - get { - return ResourceManager.GetString("Last_Modified_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /_layouts/15/images/folder.gif. - /// - internal static string Layout_Folder_Icon { - get { - return ResourceManager.GetString("Layout_Folder_Icon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of Learn More link used on App Landing page e.g. http://www.microsoft.com/mattercenter]. - /// - internal static string Learn_More_Link { - get { - return ResourceManager.GetString("Learn_More_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Learn More link. - /// - internal static string Learn_More_link_Name { - get { - return ResourceManager.GetString("Learn_More_link_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Briefcase. - /// - internal static string Legal_Briefcase_Folder_Name { - get { - return ResourceManager.GetString("Legal_Briefcase_Folder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the service to be used for legal briefcase apps, e.g. https://[SERVICENAME].azurewebsites.net/LegalBriefcase.svc/]. - /// - internal static string Legal_Briefcase_Service_Url { - get { - return ResourceManager.GetString("Legal_Briefcase_Service_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while the contextual help sections are being loaded.... - /// - internal static string Load_Contextual_Help_Context { - get { - return ResourceManager.GetString("Load_Contextual_Help_Context", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while clients are being loaded.... - /// - internal static string Loading_Clients { - get { - return ResourceManager.GetString("Loading_Clients", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /LocalUpload. - /// - internal static string Local_Upload { - get { - return ResourceManager.GetString("Local_Upload", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /MailAttachmentUpload. - /// - internal static string Mail_Attachment_Upload { - get { - return ResourceManager.GetString("Mail_Attachment_Upload", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Document(s). - /// - internal static string Mail_Cart_Mail_Subject { - get { - return ResourceManager.GetString("Mail_Cart_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCCheckoutUser. - /// - internal static string Managed_Property_Document_CheckOutuser { - get { - return ResourceManager.GetString("Managed_Property_Document_CheckOutuser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCVersionNumber. - /// - internal static string Managed_Property_Document_Version { - get { - return ResourceManager.GetString("Managed_Property_Document_Version", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Title. - /// - internal static string Managed_Property_Title { - get { - return ResourceManager.GetString("Managed_Property_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Matter Center Support. - /// - internal static string Matter_Center_Support { - get { - return ResourceManager.GetString("Matter_Center_Support", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to #. - /// - internal static string Matter_Center_Support_Email { - get { - return ResourceManager.GetString("Matter_Center_Support_Email", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientID. - /// - internal static string Matter_Client_Custom_Properties_Id { - get { - return ResourceManager.GetString("Matter_Client_Custom_Properties_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 255. - /// - internal static string Matter_Description_Max_Length { - get { - return ResourceManager.GetString("Matter_Description_Max_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenterMatterGUID. - /// - internal static string Matter_GUID { - get { - return ResourceManager.GetString("Matter_GUID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterID. - /// - internal static string Matter_ID { - get { - return ResourceManager.GetString("Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterID. - /// - internal static string Matter_ID_Alias { - get { - return ResourceManager.GetString("Matter_ID_Alias", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 75. - /// - internal static string Matter_Id_Max_Length { - get { - return ResourceManager.GetString("Matter_Id_Max_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Matter info. - /// - internal static string Matter_Info { - get { - return ResourceManager.GetString("Matter_Info", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SitePages. - /// - internal static string Matter_Landing_Page_Repository { - get { - return ResourceManager.GetString("Matter_Landing_Page_Repository", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName. - /// - internal static string Matter_Name { - get { - return ResourceManager.GetString("Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 75. - /// - internal static string Matter_Name_Max_Length { - get { - return ResourceManager.GetString("Matter_Name_Max_Length", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName. - /// - internal static string Matter_Name_Search_Term { - get { - return ResourceManager.GetString("Matter_Name_Search_Term", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the service to be used for matter provisioning app, e.g. https://[SERVICENAME].azurewebsites.net/MatterProvision.svc/]. - /// - internal static string Matter_Provision_Service_Url { - get { - return ResourceManager.GetString("Matter_Provision_Service_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /MatterTextboxSearch. - /// - internal static string Matter_Textbox_Search { - get { - return ResourceManager.GetString("Matter_Textbox_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 200. - /// - internal static string Maximum_Filter_Container { - get { - return ResourceManager.GetString("Maximum_Filter_Container", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 273. - /// - internal static string Maximum_Flyout_Height { - get { - return ResourceManager.GetString("Maximum_Flyout_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Inputs. - /// - internal static string Message_No_Inputs { - get { - return ResourceManager.GetString("Message_No_Inputs", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 73. - /// - internal static string Minimum_Flyout_Height { - get { - return ResourceManager.GetString("Minimum_Flyout_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 300. - /// - internal static string Minimum_Window_Size { - get { - return ResourceManager.GetString("Minimum_Window_Size", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 3. - /// - internal static string Minlength_For_PeoplePicker { - get { - return ResourceManager.GetString("Minlength_For_PeoplePicker", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage your recent documents: view, edit, or pin a document. - /// - internal static string My_Documents_Message { - get { - return ResourceManager.GetString("My_Documents_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My documents. - /// - internal static string My_Documents_Title { - get { - return ResourceManager.GetString("My_Documents_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage your recent matters: upload emails or documents to a matter, review matter details, or pin matters. - /// - internal static string My_Matters_Message { - get { - return ResourceManager.GetString("My_Matters_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My matters. - /// - internal static string My_Matters_Title { - get { - return ResourceManager.GetString("My_Matters_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No files uploaded. - /// - internal static string No_Files_Uploaded { - get { - return ResourceManager.GetString("No_Files_Uploaded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no help links available.. - /// - internal static string No_Help_Links_Message { - get { - return ResourceManager.GetString("No_Help_Links_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results. - /// - internal static string No_Results_Autocomplete { - get { - return ResourceManager.GetString("No_Results_Autocomplete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div class='noResultsText'>Nothing matches your search term or the filter you selected. Please try again.<br />If you applied a filter, remove it to get back to your list.<br />Search suggestions:<br /><ul><li>Make sure all words are spelled correctly</li><li>Try different keywords</li><li>Try searching by the matter name or client name</li><li>Try more general search terms</li></ul></div>. - /// - internal static string No_Results_Message { - get { - return ResourceManager.GetString("No_Results_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of office JS files, e.g. https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js]. - /// - internal static string Office_JS_URL { - get { - return ResourceManager.GetString("Office_JS_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _OneNote. - /// - internal static string OneNoteLibrary_Name_Suffix { - get { - return ResourceManager.GetString("OneNoteLibrary_Name_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /OpenAdvanceSearch. - /// - internal static string Open_Advance_Search { - get { - return ResourceManager.GetString("Open_Advance_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCOpenDate. - /// - internal static string Open_Date { - get { - return ResourceManager.GetString("Open_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Outlook. - /// - internal static string Outlook { - get { - return ResourceManager.GetString("Outlook", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Email Only. - /// - internal static string Overwrite_Config_Property { - get { - return ResourceManager.GetString("Overwrite_Config_Property", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OWA. - /// - internal static string OWA { - get { - return ResourceManager.GetString("OWA", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to docx,docm,odt,doc,dot,dotx,dotm,xlsx,xlsm,xlsb,ods,pptx,ppsx,odp,potx,pot,ppt,pps,pptm,potm,ppsm,ppam,vsdx,vsdm. - /// - internal static string OWA_Document_Extensions { - get { - return ResourceManager.GetString("OWA_Document_Extensions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to vsdx,vsdm. - /// - internal static string OWA_Visio_Extensions { - get { - return ResourceManager.GetString("OWA_Visio_Extensions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _layouts/WopiFrame.aspx?sourcedoc={0}&action=default&DefaultItemOpen=1. - /// - internal static string OWA_WOPIFrameUrl { - get { - return ResourceManager.GetString("OWA_WOPIFrameUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to parentlink. - /// - internal static string Parent_Link { - get { - return ResourceManager.GetString("Parent_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to path. - /// - internal static string Path { - get { - return ResourceManager.GetString("Path", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results found. - /// - internal static string People_Picker_No_Results { - get { - return ResourceManager.GetString("People_Picker_No_Results", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <img src=\"../Images/loadingcirclests16.gif\" alt=\"\"/>Checking content. - /// - internal static string Performing_Content_Check { - get { - return ResourceManager.GetString("Performing_Content_Check", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /personal/. - /// - internal static string Perosnal_URL_Separator { - get { - return ResourceManager.GetString("Perosnal_URL_Separator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /PinDocument. - /// - internal static string Pin_Document { - get { - return ResourceManager.GetString("Pin_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /PinMatter. - /// - internal static string Pin_Matter { - get { - return ResourceManager.GetString("Pin_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /PinSearch. - /// - internal static string Pin_Search { - get { - return ResourceManager.GetString("Pin_Search", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /PinnedDocuments. - /// - internal static string Pinned_Documents { - get { - return ResourceManager.GetString("Pinned_Documents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage your pinned documents: view, edit, or unpin a document. - /// - internal static string Pinned_Documents_Message { - get { - return ResourceManager.GetString("Pinned_Documents_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pinned documents. - /// - internal static string Pinned_Documents_Title { - get { - return ResourceManager.GetString("Pinned_Documents_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /PinnedMatters. - /// - internal static string Pinned_Matters { - get { - return ResourceManager.GetString("Pinned_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage your pinned matters: upload emails or documents to a matter, review matter details, or unpin matters. - /// - internal static string Pinned_Matters_Message { - get { - return ResourceManager.GetString("Pinned_Matters_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pinned matters. - /// - internal static string Pinned_Matters_Title { - get { - return ResourceManager.GetString("Pinned_Matters_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to pdf;. - /// - internal static string PNG_Icon_Extensions { - get { - return ResourceManager.GetString("PNG_Icon_Extensions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCPracticeGroup. - /// - internal static string Practice_Group { - get { - return ResourceManager.GetString("Practice_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ContentTypeName. - /// - internal static string Practice_Group_Custom_Properties { - get { - return ResourceManager.GetString("Practice_Group_Custom_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Practice Groups. - /// - internal static string Practice_Group_Term_Set_Name { - get { - return ResourceManager.GetString("Practice_Group_Term_Set_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Profile switch. - /// - internal static string Profile_switch { - get { - return ResourceManager.GetString("Profile_switch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Office. - /// - internal static string Querystring_Office { - get { - return ResourceManager.GetString("Querystring_Office", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Outlook. - /// - internal static string Querystring_Outlook { - get { - return ResourceManager.GetString("Querystring_Outlook", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OWA. - /// - internal static string Querystring_OWA { - get { - return ResourceManager.GetString("Querystring_OWA", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /RecentDocuments. - /// - internal static string Recent_Documents { - get { - return ResourceManager.GetString("Recent_Documents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /RecentMatters. - /// - internal static string Recent_Matters { - get { - return ResourceManager.GetString("Recent_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9_, ]+(\.[-A-Za-z0-9_, ]*)*. - /// - internal static string Refiners_Regex { - get { - return ResourceManager.GetString("Refiners_Regex", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 7. - /// - internal static string Refresh_Local_Storage { - get { - return ResourceManager.GetString("Refresh_Local_Storage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 10. - /// - internal static string RefreshTokenCookieExpiration { - get { - return ResourceManager.GetString("RefreshTokenCookieExpiration", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /RemoveFromMailCart. - /// - internal static string Remove_From_Mail_Cart { - get { - return ResourceManager.GetString("Remove_From_Mail_Cart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /RenameMailAttachment. - /// - internal static string Rename_Mail_Attachment { - get { - return ResourceManager.GetString("Rename_Mail_Attachment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RequestToken. - /// - internal static string RequestTokenCookieName { - get { - return ResourceManager.GetString("RequestTokenCookieName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCResponsibleAttorney. - /// - internal static string Responsible_Attorney { - get { - return ResourceManager.GetString("Responsible_Attorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SaveRenamedMailAttachment. - /// - internal static string Save_Renamed_Mail_Attachment { - get { - return ResourceManager.GetString("Save_Renamed_Mail_Attachment", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Save. - /// - internal static string Save_Settings { - get { - return ResourceManager.GetString("Save_Settings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the service to be used for search apps, e.g. https://[SERVICENAME].azurewebsites.net/Search.svc/]. - /// - internal static string Search_Service_Url { - get { - return ResourceManager.GetString("Search_Service_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All matters,allmatters;My matters,mymatters;Pinned matters,pinnedmatters;Recent matters,recentmatters. - /// - internal static string SearchDropdownFields { - get { - return ResourceManager.GetString("SearchDropdownFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SendMail. - /// - internal static string Send_Mail_List_Name { - get { - return ResourceManager.GetString("Send_Mail_List_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SendtoOneDrive. - /// - internal static string Send_to_OneDrive { - get { - return ResourceManager.GetString("Send_to_OneDrive", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while sending documents to OneDrive. Error code :. - /// - internal static string Send_To_OneDrive_Error_Message { - get { - return ResourceManager.GetString("Send_To_OneDrive_Error_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /pages/Home.aspx. - /// - internal static string ServicePath_AppLandingPage { - get { - return ResourceManager.GetString("ServicePath_AppLandingPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /pages/finddocument.aspx. - /// - internal static string ServicePath_FindDocument { - get { - return ResourceManager.GetString("ServicePath_FindDocument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /pages/findmatter.aspx. - /// - internal static string ServicePath_FindMatter { - get { - return ResourceManager.GetString("ServicePath_FindMatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /pages/MatterProvision.aspx. - /// - internal static string ServicePath_MatterProvision { - get { - return ResourceManager.GetString("ServicePath_MatterProvision", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /pages/WebDashboard.aspx. - /// - internal static string ServicePath_WebDashboard { - get { - return ResourceManager.GetString("ServicePath_WebDashboard", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <div>You do not have permission to access this page. If you feel you need to access this page, kindly contact your support <a href='mailto:{0}'>team</a> to grant you access.</div>. - /// - internal static string Settings_Page_Access_Denied_Message { - get { - return ResourceManager.GetString("Settings_Page_Access_Denied_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/Settings.aspx. - /// - internal static string SettingsPage { - get { - return ResourceManager.GetString("SettingsPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /_layouts/15/SignOut.aspx. - /// - internal static string Sign_Out_URL { - get { - return ResourceManager.GetString("Sign_Out_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to sitename. - /// - internal static string Site_Name { - get { - return ResourceManager.GetString("Site_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter URL of the SharePoint site, e.g. https://mytenant.sharepoint.com]. - /// - internal static string Site_Url { - get { - return ResourceManager.GetString("Site_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 54. - /// - internal static string Small_WindowSize_Flyout_Container_Height { - get { - return ResourceManager.GetString("Small_WindowSize_Flyout_Container_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 128. - /// - internal static string Small_WindowSize_Flyout_Height { - get { - return ResourceManager.GetString("Small_WindowSize_Flyout_Height", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Alphabetical ↑. - /// - internal static string Sort_Type_Alphabetical_ASC { - get { - return ResourceManager.GetString("Sort_Type_Alphabetical_ASC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Alphabetical ↓. - /// - internal static string Sort_Type_Alphabetical_DESC { - get { - return ResourceManager.GetString("Sort_Type_Alphabetical_DESC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Created date ↑. - /// - internal static string Sort_Type_Date_Created_ASC { - get { - return ResourceManager.GetString("Sort_Type_Date_Created_ASC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Created date ↓. - /// - internal static string Sort_Type_Date_Created_DESC { - get { - return ResourceManager.GetString("Sort_Type_Date_Created_DESC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Modified date ↑. - /// - internal static string Sort_Type_Date_Modified_ASC { - get { - return ResourceManager.GetString("Sort_Type_Date_Modified_ASC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Modified date ↓. - /// - internal static string Sort_Type_Date_Modified_DESC { - get { - return ResourceManager.GetString("Sort_Type_Date_Modified_DESC", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to None. - /// - internal static string Sort_Type_None { - get { - return ResourceManager.GetString("Sort_Type_None", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Relevant. - /// - internal static string Sort_Type_Relevant { - get { - return ResourceManager.GetString("Sort_Type_Relevant", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to spweburl. - /// - internal static string SP_Web_Url { - get { - return ResourceManager.GetString("SP_Web_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 148. - /// - internal static string Space_Above_Filter_Flyout { - get { - return ResourceManager.GetString("Space_Above_Filter_Flyout", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCSubAreaofLaw. - /// - internal static string Sub_Area_Of_Law { - get { - return ResourceManager.GetString("Sub_Area_Of_Law", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentTemplates. - /// - internal static string Sub_Area_Of_Law_Document_Templates { - get { - return ResourceManager.GetString("Sub_Area_Of_Law_Document_Templates", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter tenant URL of the Matter Center app, e.g. https://[TENANTNAME].sharepoint.com]. - /// - internal static string Tenant_Url { - get { - return ResourceManager.GetString("Tenant_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/MatterCenterHome.aspx. - /// - internal static string TenantWebDashboard { - get { - return ResourceManager.GetString("TenantWebDashboard", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to yyyy-MM-ddTHH:mm:ss_fffZ. - /// - internal static string Time_Stamp_Format { - get { - return ResourceManager.GetString("Time_Stamp_Format", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to T23:59:59Z. - /// - internal static string To_Date_Append_Time { - get { - return ResourceManager.GetString("To_Date_Append_Time", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000011. - /// - internal static string TokenRequestFailedErrorCode { - get { - return ResourceManager.GetString("TokenRequestFailedErrorCode", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to IsInvalidToken. - /// - internal static string TokenRequestFailedQueryString { - get { - return ResourceManager.GetString("TokenRequestFailedQueryString", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [[[Enter name of the table on Azure storage where all error/exception log, e.g. MatterCenterUILogStorage]]]. - /// - internal static string UILogTableName { - get { - return ResourceManager.GetString("UILogTableName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /UnpinDocument. - /// - internal static string Unpin_Document { - get { - return ResourceManager.GetString("Unpin_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /UnpinMatter. - /// - internal static string Unpin_Matter { - get { - return ResourceManager.GetString("Unpin_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Append date to file name and save. - /// - internal static string Upload_Append_Button { - get { - return ResourceManager.GetString("Upload_Append_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The file will be saved as new, separate document with the current date and time added to the end of the file name.. - /// - internal static string Upload_Append_Button_Tooltip { - get { - return ResourceManager.GetString("Upload_Append_Button_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Search Matters. - /// - internal static string Upload_Attachments { - get { - return ResourceManager.GetString("Upload_Attachments", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cancel upload. - /// - internal static string Upload_Cancel_Button { - get { - return ResourceManager.GetString("Upload_Cancel_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This document will not be uploaded and you will return to the previous screen.. - /// - internal static string Upload_Cancel_Button_Tooltip { - get { - return ResourceManager.GetString("Upload_Cancel_Button_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An issue occurred while reading content check settings. The ability to perform content check is disabled.. - /// - internal static string Upload_Content_Check_Setting_Failed { - get { - return ResourceManager.GetString("Upload_Content_Check_Setting_Failed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center will compare all content and data associated with the two documents. Navigating away from this screen will cancel the content check.. - /// - internal static string Upload_Content_Check_Tooltip { - get { - return ResourceManager.GetString("Upload_Content_Check_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Perform content check. - /// - internal static string Upload_ContentCheck_Button { - get { - return ResourceManager.GetString("Upload_ContentCheck_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Continue. - /// - internal static string Upload_Continue_Button { - get { - return ResourceManager.GetString("Upload_Continue_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (failed). - /// - internal static string Upload_Failed_Marker { - get { - return ResourceManager.GetString("Upload_Failed_Marker", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Uploading mail or mail attachment has failed.. - /// - internal static string Upload_Failed_Message { - get { - return ResourceManager.GetString("Upload_Failed_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You can also drag and drop files from your desktop.. - /// - internal static string Upload_Footer_Text { - get { - return ResourceManager.GetString("Upload_Footer_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OK. - /// - internal static string Upload_Ok_Button { - get { - return ResourceManager.GetString("Upload_Ok_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save as latest version. - /// - internal static string Upload_Overwrite_Button { - get { - return ResourceManager.GetString("Upload_Overwrite_Button", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The file will be saved as the latest version of the existing document that has same title. Matter Center will retain all prior versions of the document.. - /// - internal static string Upload_Overwrite_Button_Tooltip { - get { - return ResourceManager.GetString("Upload_Overwrite_Button_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Upload complete.. - /// - internal static string Upload_Success_Notification { - get { - return ResourceManager.GetString("Upload_Success_Notification", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to URLReferrer. - /// - internal static string URLReferrerCookieName { - get { - return ResourceManager.GetString("URLReferrerCookieName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /User Photos/Profile Pictures/{0}_{1}Thumb.jpg. - /// - internal static string User_Photo_Src { - get { - return ResourceManager.GetString("User_Photo_Src", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Read. - /// - internal static string User_Upload_Permissions { - get { - return ResourceManager.GetString("User_Upload_Permissions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /ViewDocument. - /// - internal static string View_Document { - get { - return ResourceManager.GetString("View_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /ViewMatter. - /// - internal static string View_Matter { - get { - return ResourceManager.GetString("View_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _layouts/15/VisioWebAccess/VisioWebAccess.aspx?id={0}&DefaultItemOpen=1. - /// - internal static string VisioWebAccessUrl { - get { - return ResourceManager.GetString("VisioWebAccessUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Word. - /// - internal static string Word { - get { - return ResourceManager.GetString("Word", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.resx deleted file mode 100644 index 100674da..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_GlobalResources/Constants.resx +++ /dev/null @@ -1,1154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - [Enter URL of the central repository where all the common lists are stored, e.g. https://[TENANTNAME].sharepoint.com/sites/catalog] - URL of the central repository where all the common lists are stored - - - ClientID, ClientURL - ',' separated custom property names that are stamped on client terms - - - ClientId - Custom property name that is stamped on client terms - - - ClientURL - Custom property name that is stamped on client terms - - - Clients - Name of the term set which holds names of all the available clients with additional details - - - MatterCenterTerms - Name of the term set group which holds all the taxonomy configurations - - - MatterCenterMatters - Name of the list where details for each matter are stored - - - MatterCenterRoles - Name of the list where details for each role are stored - - - Email - Name of the folder to be created for saving e-mails in matter libraries - - - Please wait while clients are being loaded... - This loading message is displayed if while clients are being fetched - - - [Enter URL of the service to be used for matter provisioning app, e.g. https://[SERVICENAME].azurewebsites.net/MatterProvision.svc/] - URL of the service to be used for matter provisioning app - - - No Inputs - Error message saying no inputs specified - - - ContentTypeName - ',' separated custom property names that are stamped on practice group terms/sub-terms - - - Practice Groups - Name of the term set which holds hierarchy with details of Practice Groups, Area of Laws, Sub Area of Laws and Content Types - - - [A-Za-z0-9_, ]+(\.[-A-Za-z0-9_, ]*)* - Regular Expression for validating refiners for special characters - - - 7 - Refresh cycle period for data stored in local storage - - - [Enter URL of the service to be used for search apps, e.g. https://[SERVICENAME].azurewebsites.net/Search.svc/] - URL of the service to be used for search apps - - - SendMail - Name of the list where details for sending share matter mail are stored - - - /pages/finddocument.aspx - URL for Find Document App - - - /pages/findmatter.aspx - URL for Search Matter App - - - [Enter URL of the SharePoint site, e.g. https://mytenant.sharepoint.com] - URL of the SharePoint site - - - True - Indicates web service deployed on Azure or IIS - - - [Enter app redirect URL for tenant, e.g. https://[TENANTNAME].sharepoint.com/sites/catalog/_layouts/15/appredirect.aspx] - URL for app redirect page - - - [Enter Client ID of SharePoint App from the specific Tenancy, e.g. 4e55c7b2-eb66a-753e7-2679ac37be8b08] - This text represents Client ID - - - [[[Enter name of the table on Azure storage where all error/exception log, e.g. MatterCenterUILogStorage]]] - Name of the table on Azure storage where all error/exception log - - - [Enter Application Insights ID specific to environment, e.g. a70d9cb8-e6f0-c8e7-0cbb8d1d-a4cf342c] - Application ID for application insights - - - DocumentTemplates - Name of the associated document templates for a sub area of law - - - True - Flag to differentiate wheather the deployment is carried out on Tenant level or site collection level - - - [Enter URL of the service to be used for legal briefcase apps, e.g. https://[SERVICENAME].azurewebsites.net/LegalBriefcase.svc/] - URL of the service to be used for legal briefcase apps - - - /pages/MatterProvision.aspx - URL for Matter Provision App - - - Matter Center Document(s) - Subject of the mail required as part of mail cart feature - - - Something went wrong! - This is a failure message for invalid service response - - - Read - ',' separated list of permissions for which upload functionality is not allowed - - - Invalid characters in file name. Following characters are not allowed in file name: ~ # % &amp; * : &lt; &gt; ? / \"{ | } - This message is displayed if file name has invalid characters - - - File does not exist. - Message to be displayed when file is unavailable - - - It might have been moved or deleted. - Message to be displayed when file is unavailable - - - Matter Center Briefcase - Name of the legal briefcase folder in user's OneDrive - - - Created date ↑ - Name of the option which is displayed in "Sort by" dropdown - - - Created date ↓ - Name of the option which is displayed in "Sort by" dropdown - - - Modified date ↑ - Name of the option which is displayed in "Sort by" dropdown - - - Modified date ↓ - Name of the option which is displayed in "Sort by" dropdown - - - None - Name of the option which is displayed in "Sort by" dropdown - - - Relevant - Name of the option which is displayed in "Sort by" dropdown - - - Alphabetical ↑ - Name of the option which is displayed in "Sort by" dropdown - - - Alphabetical ↓ - Name of the option which is displayed in "Sort by" dropdown - - - . - '.' separated Client ID and Matter ID in search results - - - No files uploaded - Message to be displayed when there are no current uploads - - - [Enter path of icon to display as per document selected e.g. https://[TENANTNAME].sharepoint.com/_layouts/15/images/ic{0}.gif] - This is icon to be displayed according to the document selected - - - [Enter path of icon to display for general document e.g. https://[TENANTNAME].sharepoint.com/_layouts/15/images/generaldocument.png] - Path of general document image on lcadms site - - - MCClientID - Alias name for the MatterCenterClientID - ClientID mapped property - - - # - Support URL for administrator in case of failure - - - /pages/WebDashboard.aspx - URL for Web Dashboard - - - An unexpected error has occured while performing your last action. Please <a class='ErrorPoUpLinks TryAgainLink' href=''>try again</a>. If this issue persist, please contact your <a class='ErrorPoUpLinks AdminLink' target='_blank' href=''>administrator</a>. - Message to be displayed on Error Pop up - - - File is not available - Message to be displayed when file URL not present - - - Checked out copy available - Document check out message - - - Failed to retrieve document check-out status. - Message to be displayed when file URL not present in the error popup - - - An unexpected error has occured while retrieving the document. Please <a class=\\'ErrorPoUpLinks ErrorTryAgainLink\\' href=\\'\\'>try again</a>. If this issue persist, please contact your <a class=\\'ErrorPoUpLinks AdminLink\\' target=\\'_blank\\' href=\\'\\'>administrator</a>\. - Info popup message for file not available - - - Sending this file to One-Drive will not checkout the DMS version to you because its already checked out by another user. - Info popup message when file is already checked out by other user - - - When sending to your OneDrive the DMS version will be checked out to you until you check it back in. - Info popup message for file check out - - - [Enter URL of office JS files, e.g. https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js] - URLof office JS - - - Convenience copy only available - Convenience copy available message - - - RequestToken - Request Token cookie name - - - URLReferrer - Referrer URl cookie name - - - /_layouts/15/images/folder.gif - URL for layout folder's icon - - - Provision Matters - Name of Provision Matter App that will be displayed on App Switcher - - - Search Documents - Name of Document Matter App that will be displayed on App Switcher - - - Search Matters - Name of Search Matter App that will be displayed on App Switcher - - - The search request is invalid, update the fields and try again. - Message to be displayed when invalid search field are present - - - MCAreaofLaw - Name of managed property to retrieve Area of Law - - - MCClientID - Name of managed property / alias to retrieve Client Id - - - MCClientName - Name of managed property / alias to retrieve Client Name - - - MCDocumentClientID - Name of managed property to retrieve document’s Client Id - - - MCDocumentClientName - Name of managed property to retrieve document’s Client Name - - - dlcDocIdOWSText - Name of managed property to retrieve Document Id - - - RefinableString12 - Name of managed property to retrieve document’s Matter Id - - - RefinableString13 - Name of managed property to retrieve document’s Matter Name - - - MCMatterID - Name of managed property to retrieve Matter Id - - - MCMatterName - Name of managed property to retrieve Matter Name - - - MCOpenDate - Name of managed property to retrieve Open Date of matter - - - MCPracticeGroup - Name of managed property to retrieve Practice Group - - - MCResponsibleAttorney - Name of managed property to retrieve Responsible Attorney names - - - MCSubAreaofLaw - Name of managed property to retrieve Sub Area of Law - - - Created - Name of managed property to retrieve created date - - - FileName - Name of managed property to retrieve file name - - - LastModifiedTime - Name of managed property to retrieve last modified time - - - /AddToMailCart - App Insight event name for adding documents to mail cart - - - /Clients - App Insight event name for clients tab - - - /CloseAdvanceSearch - App Insight event name for closing advance search dropdown - - - /DocumentTextboxSearch - App Insight event name for textbox search in find document app - - - /EmailAttachment - App Insight event name for email as attachment functionality - - - /EmailLink - App Insight event name for email as link functionality - - - /LocalUpload - App Insight event name for local upload - - - /MailAttachmentUpload - App Insight event name for Mail Attachment upload - - - /MatterTextboxSearch - App Insight event name for textbox search in find matter app - - - /OpenAdvanceSearch - App Insight event name for opening advance search dropdown - - - /PinnedDocuments - App Insight event name for pinned documents - - - /PinnedMatters - App Insight event name for pinned matters - - - /PinDocument - App Insight event name for pin document - - - /PinMatter - App Insight event name for pin matter - - - /PinSearch - App Insight event name for pin search - - - /RecentDocuments - App Insight event name for recent documents - - - /RecentMatters - App Insight event name for recent matters - - - /RemoveFromMailCart - App Insight event name for removing document from mail cart - - - /RenameMailAttachment - App Insight event name for renaming mail attachment - - - /SaveRenamedMailAttachment - App Insight event name for saving renamed mail attachment - - - /SendtoOneDrive - App Insight event name for send to OneDrive - - - /UnpinDocument - App Insight event name for unpin document - - - /UnpinMatter - App Insight event name for unpin matter - - - /GoToOneNote - App Insight event name for go to OneNote functionality - - - /ViewMatter - App Insight event name for view matter link - - - Browser - App Insight event name for tracking events in browser - - - Outlook - App Insight event name for tracking events from Outlook App - - - Word - App Insight event name for tracking events in Word App - - - /CreateMatter - App Insight event name for create matter - - - OWA - App Insight event name for tracking events in OWA - - - Uploading mail or mail attachment has failed. - This message is displayed if uploading a mail or attachment has failed - - - (failed) - This message is displayed against the mail/attachment for which upload has failed - - - Pages/ - This is the first level hierarchy in the events tracking - - - yyyy-MM-ddTHH:mm:ss_fffZ - Format for appending date time stamp - - - Email Only - Name of the property to make overwrite functionality configurable - - - 3 - This is the minimumn length of the string for which an AJAX request will be sent to fetch the SharePoint users based on filters applied - - - _OneNote - Suffix for OneNoteLibrary Name - - - image/ - This is the content type substring, used to differentiate images from other attachments - - - SitePages - Represents the library URL holding the matter landing pages for the site collection - - - Web Dashboard - App Insight page name for Web dashboard - - - /Contextual help - App Insight event name for Contextual help link - - - Home page - App Insight page name for home page - - - /Learn More link - App Insight event name for learn more link - - - /Matter Center Support - App Insight event name for Matter Center support link - - - /Profile switch - App Insight event name for Profile switch - - - /pages/Home.aspx - URL for App Landing page - - - [Enter URL of Learn More link used on App Landing page e.g. http://www.microsoft.com/mattercenter] - Hyperlink on click of Learn More link on app landing page - - - # - Support Email for Matter Center - - - App Landing Page - Name of App Landing page - - - /SitePages/MatterCenterHome.aspx - This is the URL for tenant level Web Dashboard - - - docx,docm,odt,doc,dot,dotx,dotm,xlsx,xlsm,xlsb,ods,pptx,ppsx,odp,potx,pot,ppt,pps,pptm,potm,ppsm,ppam,vsdx,vsdm - ',' separated list of extensions that Office Online or OWA supports viewing in the browser - - - vsdx,vsdm - ',' separated list of Visio extensions supported by OWA - - - _layouts/WopiFrame.aspx?sourcedoc={0}&action=default&DefaultItemOpen=1 - Represents the OWA URL to open the documents in browser - - - _layouts/15/VisioWebAccess/VisioWebAccess.aspx?id={0}&DefaultItemOpen=1 - Represents the URL to open Visio file in browser - - - 21 - Number of rows to fetch in a single request to display in list view control. -Note: The value of this field should not be less than 21. In case you want to set it less than 21, than update GridView_BreakPoint property to value as per the following formula. -GridView_BreakPoint = (710/21)*Number of items to show - - - 95 - Value of x in %. where x = Limit to trigger a service request for lazy loading of data on list view control when user scrolls to x% of screen height - - - You can also drag and drop files from your desktop. - This message is displayed in the upload popup footer - - - /_layouts/15/SignOut.aspx - URL of the sign out page - - - /User Photos/Profile Pictures/{0}_{1}Thumb.jpg - URL of the user picture - - - /personal/ - Separator to extract my site URL and account name - - - All matters,allmatters;My matters,mymatters;Pinned matters,pinnedmatters;Recent matters,recentmatters - Semicolon separated string of (comma separated string of options,class) options that are to be displayed in dropdown control - - - /Document info - App Insight event name for Matter Info - - - /Edit Document - App Insight event name for Edit Document - - - /Go to Matter Sites - App Insight event name for Go to Matter Sites - - - /Matter info - App Insight event name for Document Info - - - <div class='noResultsText'>Nothing matches your search term or the filter you selected. Please try again.<br />If you applied a filter, remove it to get back to your list.<br />Search suggestions:<br /><ul><li>Make sure all words are spelled correctly</li><li>Try different keywords</li><li>Try searching by the matter name or client name</li><li>Try more general search terms</li></ul></div> - Message for no results - - - No results - No results message for auto complete - - - Please wait while the contextual help sections are being loaded... - This message is displayed while retrieving contextual help content - - - pdf; - Semicolon separated list of extensions for which icons are available in png format - - - You do not have sufficient permissions to add or edit the team members - Access denied message for adding or editing team members with insufficient permissions - - - Insufficient Query string parameters - Error message for insufficient parameters while adding or editing users of the matter - - - Something went wrong while updating the users for the matter - Edit_Matter_Failure - - - {0} cannot be empty. - User validation error message - - - Title - Managed property name for title - - - 710 - Breakpoint for calculate number of rows in Grid View - - - All column headers - Option to be displayed for selecting all columns in the list view column picker - - - <div class=\"ms-ChoiceField columnPickerCheckBox\"><input class=\"ms-ChoiceField-input {3}\" id=\"options-checkbox-unselected{0}\" type=\"checkbox\" onChange=\"oCommonObject.onColumnPickerCheckboxClick({2},event)\"/><label class=\"ms-ChoiceField-field {3}\" for=\"options-checkbox-unselected{0}\"><span class=\"ms-Label columnOptionName\" title=\"{1}\">{1}</span></label></div> - This text is used to generate the HTML chunk for column picker options - - - 125 - Error code for security group existence in team members - - - No results found - Message to be shown on people picker if no results satisfy the search criteria. - - - <img src=\"../Images/loadingcirclests16.gif\" alt=\"\"/>Checking content - Message to be shown while performing content check. - - - Append date to file name and save - Text to be displayed on append button. - - - Cancel upload - Text to be displayed on cancel upload button. - - - Perform content check - Text to be displayed on content check button. - - - Save as latest version - Text to be displayed on overwrite button. - - - Content check has been aborted. - A Message to be displayed on content check aborted. - - - 50 - Number of items to be fetched with one service call for data on filter flyouts - - - mm/dd/yy - Date format for date picker control - - - -1D - Maximum allowed date in the date picker from 'From' field - - - -70:+70 - Year range for date picker in 'From' field - - - +0D - Maximum allowed date in the date picker from 'To' field - - - -70:+10 - Year range for date picker in 'To' field - - - There are no items that match this filter - Message to be appearing with no results inside filter fly out - - - 5 - Value of x in %. where x = Limit to trigger a service request for lazy loading of data on filter fly out when user scrolls to 100 - x% of screen height - - - MCVersionNumber - Managed property for document version - - - MCCheckoutUser - Managed property for document check out user - - - Manage documents: view, edit, or pin a document - Message for all documents section - - - All documents - Title for all documents section - - - Manage matters: upload emails or documents to a matter, review matter details, or pin matters - Tooltip all matters matters section - - - All matters - Title for all matters section - - - Manage your recent documents: view, edit, or pin a document - Message for my documents section - - - My documents - Title for my documents section - - - Manage your recent matters: upload emails or documents to a matter, review matter details, or pin matters - Tooltip my matters matters section - - - My matters - Title for my matters section - - - Manage your pinned documents: view, edit, or unpin a document - Tooltip for pinned documents section - - - Pinned documents - Title for pinned documents section - - - Manage your pinned matters: upload emails or documents to a matter, review matter details, or unpin matters - Tooltip for pinned matters section - - - Pinned matters - Title for pinned matters section - - - created - Refiner name for document created property - - - description - Refiner name for matter description - - - MSITOfficeAuthor - Refiner name for document display author property - - - fileextension - Refiner name for document file extension property - - - isreadonlyuser - Refiner name for Is Read only property - - - parentlink - Refiner name for document parent link property - - - path - Refiner name for matter path - - - sitename - Refiner name for matter site name - - - OK - Text to be displayed on ok button - - - The file will be saved as new, separate document with the current date and time added to the end of the file name. - A tooltip to be shown over Append date to file name and save button. - - - This document will not be uploaded and you will return to the previous screen. - A tooltip to be shown over Cancel Upload button. - - - The file will be saved as the latest version of the existing document that has same title. Matter Center will retain all prior versions of the document. - A tooltip to be shown over Save as latest version button. - - - Matter Center will compare all content and data associated with the two documents. Navigating away from this screen will cancel the content check. - A tooltip to be shown over Perform content check button. - - - An issue occurred while reading content check settings. The ability to perform content check is disabled. - This message is displayed if operation failed while retrieving content check settings - - - Upload complete. - This message is displayed if upload is successful - - - MatterID - Alias for the Matter ID search from the textbox - - - Continue - Text for configuration fail continue button. - - - 60 - Default height of the Filter Result Container - - - 130 - Default height of the Flyout Container - - - 90 - Default flyout wrapper height - - - 30 - Default height of each record - - - 200 - Maximum_Filter_Container - - - 273 - Maximum_Flyout_Height - - - 73 - Minimum flyout wrapper height - - - 148 - Space needed above filter flyout - - - 300 - Minimum Window Size - - - 54 - Default flyout container height if Windows size is less 300 - - - 128 - Default flyout height if Windows size is less 300 - - - There are no help links available. - No help links available message - - - T00:00:00Z - Append time for from date - - - T23:59:59Z - Append time for to date - - - <div>You do not have permission to access this page. If you feel you need to access this page, kindly contact your support <a href='mailto:{0}'>team</a> to grant you access.</div> - Access denied message for Settings page if user is not a site owner - - - ClientName - Term used in free text search box to retrieve results based on client name - - - MatterName - Term used in free text search box to retrieve results based on matter name - - - /Search Matters - App Insight page name for Upload attachment - - - [Enter tenant URL of the Matter Center app, e.g. https://[TENANTNAME].sharepoint.com] - The tenant url for the Matter Center app - - - [Enter Delve link URL, e.g. https://[TENANTNAME]-my.sharepoint.com/_layouts/15/me.aspx?q=] - The default page to which the Delve link redirects on being clicked - - - /Delve - App Insight event name for Delve - - - MCModifiedDate - Holds managed property name for find documents view. - - - /SitePages/Settings.aspx - This is the URL for settings page - - - /SitePages/documentDetails.aspx - Relative URL of document landing page on SharePoint - - - spweburl - Refiner name for document spweburl property - - - /Go to Document Details page - App Insight event name for Document Details page - - - /Forms/AllItems.aspx - Extension for All items page - - - An error occurred while sending documents to OneDrive. Error code : - Error message that will be displayed to user in case of exception while sending documents to OneDrive - - - -900000010 - Error code if OneDrive is not configured for user - - - The documents were not sent as OneDrive is not yet configured, <span class=\"briefcaseURL\" onClick=\"window.open(\'{0}\', \'_blank\')\">click here</span> to configure your OneDrive and try again. - Error message in case of exception if OneDrive is not configured while sending documents to OneDrive - - - Something went wrong while sending documents to OneDrive. - Error message in case of exception while sending documents to OneDrive - - - /Search - App Insight event name for enterprise search - - - /ViewDocument - App Insight event name for view document link - - - documenturl - Property name for document path in pinned documents section - - - Error occurred while checking out the document: - Display error message while document checkout fails - - - Settings - App Insight event name for tracking Settings Page events - - - /Save - App Insight event name for tracking save button event in settings page - - - Office - Value of app type parameter in querystring for Office app - - - Outlook - Value of app type parameter in querystring for Outlook app - - - OWA - Value of app type parameter in querystring for OWA app - - - 255 - Maximum number of characters allowed in matter description - - - 75 - Maximum number of characters allowed in matter id - - - 75 - Maximum number of characters allowed in matter name - - - MatterCenterMatterGUID - Name of managed property to retrieve Matter GUID - - - -900000011 - Error code in case of Token Request Failed exception - - - IsInvalidToken - Query string that wil be passed in case of Token Request failure exception - - - 10 - Expiration period of refresh token cookie in hours - - - ^[\\s]*\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*[\\s]*$ - Regex pattern to validate email address - - - 126 - Error code for invalid team members - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.Designer.cs deleted file mode 100644 index fec32159..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.Designer.cs +++ /dev/null @@ -1,486 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class FindDocument { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal FindDocument() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.FindDocument", typeof(FindDocument).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Attach Documents. - /// - internal static string AttachButtonText { - get { - return ResourceManager.GetString("AttachButtonText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to One or more of your selected documents failed to attach:. - /// - internal static string AttachFailureMessage { - get { - return ResourceManager.GetString("AttachFailureMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Attaching <span id=\"currentDocumentCount\"></span>of {0} documents... <div>Do not close Matter Center until all documents are attached.</div>. - /// - internal static string AttachInProgressMessage { - get { - return ResourceManager.GetString("AttachInProgressMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Documents successfully attached.. - /// - internal static string AttachSuccessMessage { - get { - return ResourceManager.GetString("AttachSuccessMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search by ID, document title, or client name. - /// - internal static string AutoComplete_Placeholder { - get { - return ResourceManager.GetString("AutoComplete_Placeholder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Attach Documents. - /// - internal static string Event_Name_Attach_Document { - get { - return ResourceManager.GetString("Event_Name_Attach_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Document you are trying to unpin is not pinned.. - /// - internal static string Failure_Invalid_Unpin { - get { - return ResourceManager.GetString("Failure_Invalid_Unpin", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong. - /// - internal static string Failure_Message { - get { - return ResourceManager.GetString("Failure_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MSITOfficeAuthor. - /// - internal static string FilterRefinerAuthor { - get { - return ResourceManager.GetString("FilterRefinerAuthor", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCCheckoutUser. - /// - internal static string FilterRefinerCheckOutUser { - get { - return ResourceManager.GetString("FilterRefinerCheckOutUser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Created. - /// - internal static string FilterRefinerCreated { - get { - return ResourceManager.GetString("FilterRefinerCreated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCDocumentClientName. - /// - internal static string FilterRefinerDocumentClient { - get { - return ResourceManager.GetString("FilterRefinerDocumentClient", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentOwner. - /// - internal static string FilterRefinerPinnedAuthor { - get { - return ResourceManager.GetString("FilterRefinerPinnedAuthor", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentCheckoutUser. - /// - internal static string FilterRefinerPinnedCheckOutUser { - get { - return ResourceManager.GetString("FilterRefinerPinnedCheckOutUser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentCreatedDate. - /// - internal static string FilterRefinerPinnedCreatedDate { - get { - return ResourceManager.GetString("FilterRefinerPinnedCreatedDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentClient. - /// - internal static string FilterRefinerPinnedDocumentClient { - get { - return ResourceManager.GetString("FilterRefinerPinnedDocumentClient", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentModifiedDate. - /// - internal static string FilterRefinerPinnedModifiedDate { - get { - return ResourceManager.GetString("FilterRefinerPinnedModifiedDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to loadCheckboxColumn;loadDocumentTypeIcon;loadNameColumn;loadEllipsisColumn;genericColumn;loadClientMatterID_Column;loadDateColumn;genericColumn;genericColumn;loadCheckedOutToUser;loadDateColumn. - /// - internal static string GridViewColumnFomatter { - get { - return ResourceManager.GetString("GridViewColumnFomatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Document;Client;Client.Matter ID;Modified date;Author;Document version;Checked out to;Created date. - /// - internal static string GridViewColumnPickerFields { - get { - return ResourceManager.GetString("GridViewColumnPickerFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckBox;DocType;FileName;ECB;MCDocumentClientName;MCDocumentClientID;MCModifiedDate;MSITOfficeAuthor;MCVersionNumber;MCCheckoutUser;Created. - /// - internal static string GridViewColumnValueFields { - get { - return ResourceManager.GetString("GridViewColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 21;30;210;30;210;160;205;150;210;220;200. - /// - internal static string GridViewColumnWidth { - get { - return ResourceManager.GetString("GridViewColumnWidth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check Box,NA;DocType,NA;Document,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date. - /// - internal static string GridViewDefaultColumns { - get { - return ResourceManager.GetString("GridViewDefaultColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileExtension. - /// - internal static string GridViewDocumentExtension { - get { - return ResourceManager.GetString("GridViewDocumentExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentOWAUrl. - /// - internal static string GridViewDocumentOWAUrl { - get { - return ResourceManager.GetString("GridViewDocumentOWAUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Path. - /// - internal static string GridViewDocumentPath { - get { - return ResourceManager.GetString("GridViewDocumentPath", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SPWebUrl. - /// - internal static string GridViewDocumentSPWebUrl { - get { - return ResourceManager.GetString("GridViewDocumentSPWebUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Open this Document,editdocument;View Matter Details,gotoMatterSites;Pin this Document,pin;Unpin this Document,unpin. - /// - internal static string GridViewECBActions { - get { - return ResourceManager.GetString("GridViewECBActions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to View this document$|$Go to this document\'s matter details$|$Add this document to Pinned Documents$|$Remove this document from Pinned Documents. - /// - internal static string GridViewECBActionsTitle { - get { - return ResourceManager.GetString("GridViewECBActionsTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click to view the document menu. - /// - internal static string GridViewECBMenuTitle { - get { - return ResourceManager.GetString("GridViewECBMenuTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check Box,NA;DocType,NA;Document,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date;Author,singleselect;Document version,NA;Checked out to,singleselect;Created date,date. - /// - internal static string GridViewHeaderName { - get { - return ResourceManager.GetString("GridViewHeaderName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Select all$|$Doc type$|$Click to sort by document name$|$$|$Click to sort by client name$|$Click to sort by Client.Matter ID$|$Click to sort by last modified date$|$Click to sort by document author$|$Click to sort by version$|$Click to sort by who has documents checked out$|$Click to sort by created date. - /// - internal static string GridViewHeaderNameTitle { - get { - return ResourceManager.GetString("GridViewHeaderNameTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString12. - /// - internal static string GridViewMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check Box,NA;DocType,NA;ECB,NA. - /// - internal static string GridViewNonDataColumns { - get { - return ResourceManager.GetString("GridViewNonDataColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CalClientMatterId. - /// - internal static string GridViewPinnedClientMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedClientMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckBox;DocType;DocumentName;ECB;DocumentClient;CalClientMatterId;DocumentModifiedDate;DocumentOwner;DocumentVersion;DocumentCheckoutUser;DocumentCreatedDate. - /// - internal static string GridViewPinnedColumnValueFields { - get { - return ResourceManager.GetString("GridViewPinnedColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentClientId. - /// - internal static string GridViewPinnedDocumentClientIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedDocumentClientIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentMatterId. - /// - internal static string GridViewPinnedMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentName. - /// - internal static string GridViewPinnedTitleProperty { - get { - return ResourceManager.GetString("GridViewPinnedTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileName. - /// - internal static string GridViewTitleProperty { - get { - return ResourceManager.GetString("GridViewTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while the documents load.. - /// - internal static string Loading_Document { - get { - return ResourceManager.GetString("Loading_Document", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Do not select more than five documents to attach at one time.. - /// - internal static string MaxAttachedMessage { - get { - return ResourceManager.GetString("MaxAttachedMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results found.. - /// - internal static string No_Data_Message { - get { - return ResourceManager.GetString("No_Data_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NA. - /// - internal static string No_Data_String { - get { - return ResourceManager.GetString("No_Data_String", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no pinned documents.. - /// - internal static string No_Pinned_Documents { - get { - return ResourceManager.GetString("No_Pinned_Documents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search document assigned to Me. - /// - internal static string Search_Assigned_To_Me { - get { - return ResourceManager.GetString("Search_Assigned_To_Me", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search entire Matter Center. - /// - internal static string Search_Entire_DMS { - get { - return ResourceManager.GetString("Search_Entire_DMS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All documents,alldata;My documents,mydata;Pinned documents,pinneddata. - /// - internal static string SearchDropdownFields { - get { - return ResourceManager.GetString("SearchDropdownFields", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.resx deleted file mode 100644 index 89219a77..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindDocument.resx +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Search by ID, document title, or client name - Placeholder on Search bar for Outlook View - - - Document you are trying to unpin is not pinned. - This is a failure message when user tries to unpin a document which is not pinned - - - Something went wrong - This is a failure message for invalid service response - - - MSITOfficeAuthor - Managed property / alias name for Author field - - - MCCheckoutUser - Managed property / alias name for Check out user field - - - MCDocumentClientName - Managed property / alias name for Document Client field - - - DocumentOwner - This is the refiner name for pinned document authors - - - DocumentCheckoutUser - This is the refiner name for pinned document check out user - - - DocumentClient - This is the refiner name for pinned document client - - - loadCheckboxColumn;loadDocumentTypeIcon;loadNameColumn;loadEllipsisColumn;genericColumn;loadClientMatterID_Column;loadDateColumn;genericColumn;genericColumn;loadCheckedOutToUser;loadDateColumn - Semicolon separated list of values whose function definition is already defined - - - Document;Client;Client.Matter ID;Modified date;Author;Document version;Checked out to;Created date - Semicolon separated list of column options available in the column picker - - - CheckBox;DocType;FileName;ECB;MCDocumentClientName;MCDocumentClientID;MCModifiedDate;MSITOfficeAuthor;MCVersionNumber;MCCheckoutUser;Created - Semicolon separated list of managed properties, which are used to bind JSON data - - - 21;30;210;30;210;160;205;150;210;220;200 - Semicolon separated list of width of columns of grid view control - - - Check Box,NA;DocType,NA;Document,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date - Semicolon separated list of default columns in the grid view control. This list will be bypassed, if user selection exists - - - FileExtension - Property name for document extension - - - DocumentOWAUrl - Property name for document OWA URL - - - Path - Property name for document path - - - SPWebUrl - Property name for document SPWebURL - - - Open this Document,editdocument;View Matter Details,gotoMatterSites;Pin this Document,pin;Unpin this Document,unpin - Semicolon separated string of (comma separated string of actions,class) actions that are to be displayed in ECB menu - - - Check Box,NA;DocType,NA;Document,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date;Author,singleselect;Document version,NA;Checked out to,singleselect;Created date,date - Semicolon separated list of name of the column headers of grid view control - - - RefinableString12 - This is the property name for matter ID - - - CalClientMatterId - This is the property name for client.matter ID - - - Check Box,NA;DocType,NA;ECB,NA - Name of non-data columns of grid view control - - - CheckBox;DocType;DocumentName;ECB;DocumentClient;CalClientMatterId;DocumentModifiedDate;DocumentOwner;DocumentVersion;DocumentCheckoutUser;DocumentCreatedDate - Semicolon separated list of key names, which are used to bind JSON data - - - DocumentClientId - This is the property name for client ID - - - DocumentMatterId - This is the property name for matter ID - - - DocumentName - This is the property name for document title - - - FileName - This is the property name for document title - - - Please wait while the documents load. - This is a loading message when documents are loaded - - - No results found. - This message is displayed when no data is present - - - NA - This is displayed when string is null or whitespace - - - There are no pinned documents. - This message is displayed when no documents are pinned - - - All documents,alldata;My documents,mydata;Pinned documents,pinneddata - Semicolon separated string of (comma separated string of options,class) options that are to be displayed in dropdown control - - - Search document assigned to Me - This text is displayed on auto-complete search options - - - Search entire Matter Center - This text is displayed on auto-complete search options - - - Created - Managed property name for Created - - - DocumentCreatedDate - This is the refiner name for pinned document created date - - - DocumentModifiedDate - This is the refiner name for pinned document modified date - - - View this document$|$Go to this document\'s matter details$|$Add this document to Pinned Documents$|$Remove this document from Pinned Documents - $|$ separated list of title for ECB actions - - - Select all$|$Doc type$|$Click to sort by document name$|$$|$Click to sort by client name$|$Click to sort by Client.Matter ID$|$Click to sort by last modified date$|$Click to sort by document author$|$Click to sort by version$|$Click to sort by who has documents checked out$|$Click to sort by created date - $|$ separated list of title for Grid view header - - - Click to view the document menu - Title for grid view ECB menu title - - - Attach Documents - Text for attach and send button - - - One or more of your selected documents failed to attach: - Message to be displayed in case of failure while attaching documents - - - Attaching <span id=\"currentDocumentCount\"></span>of {0} documents... <div>Do not close Matter Center until all documents are attached.</div> - Message to be displayed while attaching documents is in progress - - - Documents successfully attached. - Message to be displayed in case of success while attaching documents - - - Do not select more than five documents to attach at one time. - Message to be displayed if user selects more than allowed number of attachments - - - /Attach Documents - App Insight event name for attaching documents - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.Designer.cs deleted file mode 100644 index 74cd1b8d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.Designer.cs +++ /dev/null @@ -1,486 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class FindMatter { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal FindMatter() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.FindMatter", typeof(FindMatter).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Search by ID, or matter or client name. - /// - internal static string AutoComplete_Placeholder { - get { - return ResourceManager.GetString("AutoComplete_Placeholder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /Forms/AllItems.aspx. - /// - internal static string Document_Library_EndURL { - get { - return ResourceManager.GetString("Document_Library_EndURL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to get attachment token. - /// - internal static string Fail_Attachment_Token { - get { - return ResourceManager.GetString("Fail_Attachment_Token", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter you are trying to unpin is not pinned.. - /// - internal static string Failure_Invalid_Unpin { - get { - return ResourceManager.GetString("Failure_Invalid_Unpin", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong!. - /// - internal static string Failure_Message { - get { - return ResourceManager.GetString("Failure_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no pinned matters.. - /// - internal static string Failure_No_Pinned_Matters { - get { - return ResourceManager.GetString("Failure_No_Pinned_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCClientName. - /// - internal static string FilterRefinerClientName { - get { - return ResourceManager.GetString("FilterRefinerClientName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCOpenDate. - /// - internal static string FilterRefinerOpenDate { - get { - return ResourceManager.GetString("FilterRefinerOpenDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterClient. - /// - internal static string FilterRefinerPinnedClientName { - get { - return ResourceManager.GetString("FilterRefinerPinnedClientName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCreatedDate. - /// - internal static string FilterRefinerPinnedCreatedDate { - get { - return ResourceManager.GetString("FilterRefinerPinnedCreatedDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterModifiedDate. - /// - internal static string FilterRefinerPinnedModifiedDate { - get { - return ResourceManager.GetString("FilterRefinerPinnedModifiedDate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterResponsibleAttorney. - /// - internal static string FilterRefinerPinnedResponsibleAttorney { - get { - return ResourceManager.GetString("FilterRefinerPinnedResponsibleAttorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterSubAreaOfLaw. - /// - internal static string FilterRefinerPinnedSubAreaofLaw { - get { - return ResourceManager.GetString("FilterRefinerPinnedSubAreaofLaw", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCResponsibleAttorney. - /// - internal static string FilterRefinerResponsibleAttorney { - get { - return ResourceManager.GetString("FilterRefinerResponsibleAttorney", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCSubAreaofLaw. - /// - internal static string FilterRefinerSubAreaofLaw { - get { - return ResourceManager.GetString("FilterRefinerSubAreaofLaw", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to loadNameColumn;loadEllipsisColumn;genericColumn;loadClientMatterID_Column;loadDateColumn;genericColumn;genericColumn;loadDateColumn. - /// - internal static string GridViewColumnFomatter { - get { - return ResourceManager.GetString("GridViewColumnFomatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter;Client;Client.Matter ID;Modified date;Responsible attorney;Sub area of law;Open date. - /// - internal static string GridViewColumnPickerFields { - get { - return ResourceManager.GetString("GridViewColumnPickerFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName;ECB;MCClientName;MCClientID;LastModifiedTime;MCResponsibleAttorney;MCSubAreaofLaw;MCOpenDate. - /// - internal static string GridViewColumnValueFields { - get { - return ResourceManager.GetString("GridViewColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 255;30;210;160;205;260;220;180. - /// - internal static string GridViewColumnWidth { - get { - return ResourceManager.GetString("GridViewColumnWidth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date. - /// - internal static string GridViewDefaultColumns { - get { - return ResourceManager.GetString("GridViewDefaultColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Upload to this Matter,upload;View Matter Details,gotoMatterSites;Go to Matter OneNote,gotoOneNote;Pin this Matter,pin;Unpin this Matter,unpin. - /// - internal static string GridViewECBActions { - get { - return ResourceManager.GetString("GridViewECBActions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Upload documents to this matter$|$Go to this matter\'s details$|$Go to this matter\'s OneNote$|$Add this matter to Pinned Matters$|$Remove this matter from Pinned Matters. - /// - internal static string GridViewECBActionsTitle { - get { - return ResourceManager.GetString("GridViewECBActionsTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click to view the matter menu. - /// - internal static string GridViewECBMenuTitle { - get { - return ResourceManager.GetString("GridViewECBMenuTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date;Responsible attorney,singleselect;Sub area of law,singleselect;Open date,date. - /// - internal static string GridViewHeaderName { - get { - return ResourceManager.GetString("GridViewHeaderName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click to sort by matter name$|$$|$Click to sort by client name$|$Click to sort by Client.Matter ID$|$Click to sort by last modified date$|$Click to sort by attorney$|$Click to sort by sub area of law$|$Click to sort by matter open date. - /// - internal static string GridViewHeaderNameTitle { - get { - return ResourceManager.GetString("GridViewHeaderNameTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterID. - /// - internal static string GridViewMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ECB,NA. - /// - internal static string GridViewNonDataColumns { - get { - return ResourceManager.GetString("GridViewNonDataColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CalClientMatterId. - /// - internal static string GridViewPinnedClientMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedClientMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName;ECB;MatterClient;CalClientMatterId;MatterModifiedDate;MatterResponsibleAttorney;MatterSubAreaOfLaw;MatterCreatedDate. - /// - internal static string GridViewPinnedColumnValueFields { - get { - return ResourceManager.GetString("GridViewPinnedColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterClientId. - /// - internal static string GridViewPinnedMatterClientIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedMatterClientIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterID. - /// - internal static string GridViewPinnedMatterIDPropertyName { - get { - return ResourceManager.GetString("GridViewPinnedMatterIDPropertyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName. - /// - internal static string GridViewPinnedTitleProperty { - get { - return ResourceManager.GetString("GridViewPinnedTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName. - /// - internal static string GridViewTitleProperty { - get { - return ResourceManager.GetString("GridViewTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while clients are being loaded.... - /// - internal static string Loading_Message_Clients { - get { - return ResourceManager.GetString("Loading_Message_Clients", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while the matters load.. - /// - internal static string Loading_Message_Matters { - get { - return ResourceManager.GetString("Loading_Message_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please wait while pinned matters load.. - /// - internal static string Loading_Message_PinnedMatter { - get { - return ResourceManager.GetString("Loading_Message_PinnedMatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to upload document. - /// - internal static string Mail_Upload_Failure { - get { - return ResourceManager.GetString("Mail_Upload_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Document uploaded successfully. - /// - internal static string Mail_Upload_Success { - get { - return ResourceManager.GetString("Mail_Upload_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to .aspx. - /// - internal static string MatterLandingPageExtension { - get { - return ResourceManager.GetString("MatterLandingPageExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results found.. - /// - internal static string No_Data_Message { - get { - return ResourceManager.GetString("No_Data_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Untitled. - /// - internal static string No_Subject_Mail { - get { - return ResourceManager.GetString("No_Subject_Mail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to .onetoc2. - /// - internal static string OneNoteTableOfContentsExtension { - get { - return ResourceManager.GetString("OneNoteTableOfContentsExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search matters assigned to Me. - /// - internal static string Search_Assigned_To_Me { - get { - return ResourceManager.GetString("Search_Assigned_To_Me", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search entire Matter Center. - /// - internal static string Search_Entire_DMS { - get { - return ResourceManager.GetString("Search_Entire_DMS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All matters,alldata;My matters,mydata;Pinned matters,pinneddata. - /// - internal static string SearchDropdownFields { - get { - return ResourceManager.GetString("SearchDropdownFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong while uploading the file.. - /// - internal static string Upload_Failure { - get { - return ResourceManager.GetString("Upload_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _layouts/WopiFrame.aspx?sourcedoc=. - /// - internal static string WOPIFrameURL { - get { - return ResourceManager.GetString("WOPIFrameURL", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.resx deleted file mode 100644 index 8221b1ac..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/FindMatter.resx +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Matter you are trying to unpin is not pinned. - This is a failure message when user tries to unpin a matter which is not pinned - - - Something went wrong! - This is a failure message for invalid service response - - - There are no pinned matters. - This is a failure message if no pinned matters are present - - - Failed to get attachment token - This is a failure message if office API does not return attachment token - - - Please wait while clients are being loaded... - This is a loading message while clients are loaded - - - Please wait while the matters load. - This is a loading message while matters are loaded - - - Please wait while pinned matters load. - This is a loading message while pinned matters are loaded - - - Failed to upload document - This is a success message when user failed to upload mail to SharePoint - - - Document uploaded successfully - This is a success message when user uploaded mail to SharePoint - - - No results found. - This message is displayed when no data is found - - - Untitled - This is a default subject line for mail with no subject - - - Search matters assigned to Me - This text is displayed on auto-complete search options - - - Search entire Matter Center - This text is displayed on auto-complete search options - - - Something went wrong while uploading the file. - This is a success message when user failed to upload documents from drag and drop - - - .onetoc2 - This is the file extension of the OneNote table of contents - - - _layouts/WopiFrame.aspx?sourcedoc= - This is the URL for the WOPIFrame that allows the user to open the OneNote for a matter - - - loadNameColumn;loadEllipsisColumn;genericColumn;loadClientMatterID_Column;loadDateColumn;genericColumn;genericColumn;loadDateColumn - Semicolon separated list of values whose function definition is already defined - - - 255;30;210;160;205;260;220;180 - Semicolon separated list of width of columns of grid view control - - - Upload to this Matter,upload;View Matter Details,gotoMatterSites;Go to Matter OneNote,gotoOneNote;Pin this Matter,pin;Unpin this Matter,unpin - Semicolon separated string of (comma separated string of actions,class) actions that are to be displayed in ECB menu - - - Matter,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date;Responsible attorney,singleselect;Sub area of law,singleselect;Open date,date - Semicolon separated list of name of the column headers of grid view control - - - MCMatterID - This is the property name for matter ID - - - MCMatterName - This is the property name for matter title - - - .aspx - This is the file extension of the Matter Landing page - - - Search by ID, or matter or client name - Placeholder on Search bar for Outlook View - - - All matters,alldata;My matters,mydata;Pinned matters,pinneddata - Semicolon separated string of (comma separated string of options,class) options that are to be displayed in dropdown control - - - MCMatterName;ECB;MCClientName;MCClientID;LastModifiedTime;MCResponsibleAttorney;MCSubAreaofLaw;MCOpenDate - Semicolon separated list of managed properties, which are used to bind JSON data - - - MatterName;ECB;MatterClient;CalClientMatterId;MatterModifiedDate;MatterResponsibleAttorney;MatterSubAreaOfLaw;MatterCreatedDate - Semicolon separated list of key names, which are used to bind JSON data - - - MatterID - This is the property name for matter ID - - - MatterName - This is the property name for matter title - - - CalClientMatterId - This is the property name for client.matter ID - - - MatterClientId - This is the property name for client ID - - - MCClientName - Managed property name for Client field - - - MCResponsibleAttorney - Managed property name for Responsible Attorney field - - - MCSubAreaofLaw - Managed property name for Sub area of law field - - - MatterClient - This is the refiner name for pinned matter client - - - MatterResponsibleAttorney - This is the refiner name for pinned matter responsible attorney - - - MatterSubAreaOfLaw - This is the refiner name for pinned matter sub area of law - - - Matter;Client;Client.Matter ID;Modified date;Responsible attorney;Sub area of law;Open date - Semicolon separated list of column options available in the column picker - - - ECB,NA - Name of non-data columns of grid view control - - - Matter,singleselect;ECB,NA;Client,singleselect;Client.Matter ID,NA;Modified date,date - Semicolon separated list of default columns in the grid view control. This list will be bypassed, if user selection exists - - - MCOpenDate - Managed property name for Open date - - - MatterCreatedDate - This is the refiner name for pinned matter created date - - - MatterModifiedDate - This is the refiner name for pinned matter modified date - - - Upload documents to this matter$|$Go to this matter\'s details$|$Go to this matter\'s OneNote$|$Add this matter to Pinned Matters$|$Remove this matter from Pinned Matters - $|$ separated list of title for ECB actions - - - Click to sort by matter name$|$$|$Click to sort by client name$|$Click to sort by Client.Matter ID$|$Click to sort by last modified date$|$Click to sort by attorney$|$Click to sort by sub area of law$|$Click to sort by matter open date - $|$ separated list of title for Grid view headers - - - Click to view the matter menu - Title for grid view ECB menu title - - - /Forms/AllItems.aspx - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.Designer.cs deleted file mode 100644 index 018c68eb..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.Designer.cs +++ /dev/null @@ -1,297 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class LegalBriefcase { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal LegalBriefcase() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.LegalBriefcase", typeof(LegalBriefcase).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Some of the document(s) are checked out to different user. - /// - internal static string CheckIn_Already_Checkout { - get { - return ResourceManager.GetString("CheckIn_Already_Checkout", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We are working on your changes. - /// - internal static string CheckIn_Message { - get { - return ResourceManager.GetString("CheckIn_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Some of the document(s) were checked in successfully. - /// - internal static string CheckIn_Partial { - get { - return ResourceManager.GetString("CheckIn_Partial", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your document has been checked in. - /// - internal static string CheckIn_Success { - get { - return ResourceManager.GetString("CheckIn_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check out failed. - /// - internal static string Checkout_Failure { - get { - return ResourceManager.GetString("Checkout_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We are checking out your file. - /// - internal static string Checkout_Message { - get { - return ResourceManager.GetString("Checkout_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You already have the document(s) checked out in the Matter Center Beta. - /// - internal static string CheckOut_Partial_Message { - get { - return ResourceManager.GetString("CheckOut_Partial_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your document has been checked out in the Matter Center Beta. - /// - internal static string Checkout_Success { - get { - return ResourceManager.GetString("Checkout_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to detach document. - /// - internal static string Detach_Document_Failure { - get { - return ResourceManager.GetString("Detach_Document_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We are detaching your file from Matter Center Beta. - /// - internal static string Detach_Document_Message { - get { - return ResourceManager.GetString("Detach_Document_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You are about to detach this file’s connection to Matter Center Beta where it will no longer be able to receive updates or perform actions related to Matter Center Beta. . - /// - internal static string Detach_Document_Question { - get { - return ResourceManager.GetString("Detach_Document_Question", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your file has been detached. - /// - internal static string Detach_Document_Success { - get { - return ResourceManager.GetString("Detach_Document_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Detach was successful for some document(s). - /// - internal static string Detach_Partial { - get { - return ResourceManager.GetString("Detach_Partial", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed!. - /// - internal static string Generic_Failure_Message { - get { - return ResourceManager.GetString("Generic_Failure_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Success!. - /// - internal static string Generic_Success_Message { - get { - return ResourceManager.GetString("Generic_Success_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Good News!. - /// - internal static string Good_News_Message { - get { - return ResourceManager.GetString("Good_News_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My Legal Briefcase. - /// - internal static string Legal_Briefcase_Folder_Name { - get { - return ResourceManager.GetString("Legal_Briefcase_Folder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You can only perform these actions on documents from the Matter Center Beta. - /// - internal static string Not_Supported_Message { - get { - return ResourceManager.GetString("Not_Supported_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Do you wish to continue?. - /// - internal static string Question { - get { - return ResourceManager.GetString("Question", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sit back and Relax!. - /// - internal static string Relax_Message { - get { - return ResourceManager.GetString("Relax_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We are updating your document. - /// - internal static string Update_Copy_Message { - get { - return ResourceManager.GetString("Update_Copy_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to update document. - /// - internal static string Update_Document_Failure { - get { - return ResourceManager.GetString("Update_Document_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Some document(s) were updated successfully. - /// - internal static string Update_Document_Partial { - get { - return ResourceManager.GetString("Update_Document_Partial", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating your copy will overwrite your current OneDrive version and any changes you may have made. . - /// - internal static string Update_Document_Question { - get { - return ResourceManager.GetString("Update_Document_Question", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your document has been updated. - /// - internal static string Update_Document_Success { - get { - return ResourceManager.GetString("Update_Document_Success", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error occurred while retrieving version information. - /// - internal static string Version_Info_Failed { - get { - return ResourceManager.GetString("Version_Info_Failed", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.resx deleted file mode 100644 index 1ed509c7..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/LegalBriefcase.resx +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - We are working on your changes - Loading message that gets displayed for Check in functionality - - - Your document has been checked in - Success message that gets displayed when check in operation is completed - - - Check out failed - Failure message for check out functionality - - - We are checking out your file - Loading message that gets displayed for check out functionality - - - You already have the document(s) checked out in the Matter Center Beta - Message that gets displayed when some of documents are not checked out from Matter Center Beta - - - Your document has been checked out in the Matter Center Beta - Success message that gets displayed when Check Out action is completed - - - Failed to detach document - Failure message that gets displayed when unknown failure occurs for Detach functionality in One Drive - - - We are detaching your file from Matter Center Beta - Loading message for Detach document functionality in One Drive - - - You are about to detach this file’s connection to Matter Center Beta where it will no longer be able to receive updates or perform actions related to Matter Center Beta. - Question that is asked to the user whenever the user selects detach from Matter Center Beta as action in One Drive - - - Your file has been detached - Message that gets displayed when all the documents are detached successfully - - - Failed! - Failed message - - - Success! - Success message - - - Sit back and Relax! - Relax message that gets displayed while action is in progress - - - We are updating your document - Loading message for Update Copy functionality - - - Failed to update document - Failure message for update document functionality - - - Your document has been updated - Success message that gets displayed when all the documents have been updated - - - You can only perform these actions on documents from the Matter Center Beta - Message that gets displayed when any normal document is selected for Legal Briefcase functionality - - - Some of the document(s) were checked in successfully - Message that gets displayed when some of the documents were checked in from One Drive - - - Detach was successful for some document(s) - Message that gets displayed when some of the documents are detached and some are not - - - Some document(s) were updated successfully - Message that gets displayed when some of the documents were not updated - - - Good News! - Good News message - - - Error occurred while retrieving version information - Error message that gets displayed when unknown error occurs while retrieving version information for the documents - - - My Legal Briefcase - Name of the legal briefcase folder in user's OneDrive - - - Updating your copy will overwrite your current OneDrive version and any changes you may have made. - Question asked to user before performing update copy operation on One Drive - - - Do you wish to continue? - Message to ask user if he wants to perform a certain action - - - Some of the document(s) are checked out to different user - Error message to be displayed when user clicks on check in and some of the documents are checked out to different users - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.Designer.cs deleted file mode 100644 index b7906dc2..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.Designer.cs +++ /dev/null @@ -1,486 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34209 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class MatterProvision { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal MatterProvision() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.MatterProvision", typeof(MatterProvision).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Create. - /// - internal static string Create_Button_Text { - get { - return ResourceManager.GetString("Create_Button_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Create and Notify. - /// - internal static string Create_Notify_Button_Text { - get { - return ResourceManager.GetString("Create_Notify_Button_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to However an issue occurred and the custom view was not created.. - /// - internal static string Create_View_Failure { - get { - return ResourceManager.GetString("Create_View_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Full Control. - /// - internal static string Edit_Matter_Mandatory_Permission_Level { - get { - return ResourceManager.GetString("Edit_Matter_Mandatory_Permission_Level", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign Permission Failure: . - /// - internal static string Error_Assign_Permission { - get { - return ResourceManager.GetString("Error_Assign_Permission", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign permission to at least one team member. - /// - internal static string Error_Assign_Permission_To_User { - get { - return ResourceManager.GetString("Error_Assign_Permission_To_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Associate Content Type Failure: . - /// - internal static string Error_Associate_Content_Type { - get { - return ResourceManager.GetString("Error_Associate_Content_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter users that are conflicted with this matter.. - /// - internal static string Error_Blocked_Users { - get { - return ResourceManager.GetString("Error_Blocked_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter users who are not conducting conflict check. - /// - internal static string Error_Conflict_Check_User { - get { - return ResourceManager.GetString("Error_Conflict_Check_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A conflict check must be completed prior to provisioning this matter.. - /// - internal static string Error_Conflict_Exists { - get { - return ResourceManager.GetString("Error_Conflict_Exists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter the conflict reviewers name (for auditing purposes).. - /// - internal static string Error_Conflict_Reviewer_User { - get { - return ResourceManager.GetString("Error_Conflict_Reviewer_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error in creation of matter: . - /// - internal static string Error_Create_Matter { - get { - return ResourceManager.GetString("Error_Create_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please select primary matter type. - /// - internal static string Error_Default_Matter_Type { - get { - return ResourceManager.GetString("Error_Default_Matter_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter a different Matter name. A matter with same name already exists.. - /// - internal static string Error_Duplicate_Matter { - get { - return ResourceManager.GetString("Error_Duplicate_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Landing page of this Matter is already created. Kindly delete existing landing page or please enter a different Matter name.. - /// - internal static string Error_Duplicate_MatterLandingPage { - get { - return ResourceManager.GetString("Error_Duplicate_MatterLandingPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OneNote library for this Matter is already created. Kindly delete the library or please enter a different Matter name.. - /// - internal static string Error_Duplicate_OneNoteLibrary { - get { - return ResourceManager.GetString("Error_Duplicate_OneNoteLibrary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please provide at least one user who has Full Control permission on this matter.. - /// - internal static string Error_Edit_Matter_Mandatory_Permission { - get { - return ResourceManager.GetString("Error_Edit_Matter_Mandatory_Permission", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter valid users in the Assign Permission users list. - /// - internal static string Error_Invalid_Assign_Permission_Users { - get { - return ResourceManager.GetString("Error_Invalid_Assign_Permission_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter valid users in Conflicted Users list. - /// - internal static string Error_Invalid_Block_Users { - get { - return ResourceManager.GetString("Error_Invalid_Block_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter individual who is not conflicted. - /// - internal static string Error_Invalid_User { - get { - return ResourceManager.GetString("Error_Invalid_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter at least one {0} for this matter.. - /// - internal static string Error_Mandatory_Role { - get { - return ResourceManager.GetString("Error_Mandatory_Role", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter a description for this matter.. - /// - internal static string Error_Matter_Description { - get { - return ResourceManager.GetString("Error_Matter_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter a matter ID.. - /// - internal static string Error_Matter_ID { - get { - return ResourceManager.GetString("Error_Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to create Matter Landing page, continuing with other steps.... - /// - internal static string Error_Matter_Landing_Page_Creation { - get { - return ResourceManager.GetString("Error_Matter_Landing_Page_Creation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter a matter name.. - /// - internal static string Error_Matter_Title { - get { - return ResourceManager.GetString("Error_Matter_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error has occurred and the matter was not created. Error Code: {0}. - /// - internal static string Error_Provisioning_Process { - get { - return ResourceManager.GetString("Error_Provisioning_Process", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Select a client for this matter.. - /// - internal static string Error_Select_Client { - get { - return ResourceManager.GetString("Error_Select_Client", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Select matter type by area of law for this matter.. - /// - internal static string Error_Select_Content_Type { - get { - return ResourceManager.GetString("Error_Select_Content_Type", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter the date on which the conflict check was performed.. - /// - internal static string Error_Select_Date { - get { - return ResourceManager.GetString("Error_Select_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter at least one {0} for this matter.. - /// - internal static string Error_Select_User { - get { - return ResourceManager.GetString("Error_Select_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Share Matter Failure: . - /// - internal static string Error_Share_Matter { - get { - return ResourceManager.GetString("Error_Share_Matter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter a valid text which contains only alphanumeric characters, spaces & hyphen. - /// - internal static string Error_Special_Character { - get { - return ResourceManager.GetString("Error_Special_Character", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Stamp Properties Failure: . - /// - internal static string Error_Stamp_Properties { - get { - return ResourceManager.GetString("Error_Stamp_Properties", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter valid conflicted user from people picker. - /// - internal static string Error_Valid_Block_Users { - get { - return ResourceManager.GetString("Error_Valid_Block_Users", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter the valid date in MM/DD/YYYY format. - /// - internal static string Error_Valid_Date { - get { - return ResourceManager.GetString("Error_Valid_Date", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter a valid Matter name which contains only alphanumeric characters and spaces. - /// - internal static string Error_Valid_Matter_Name { - get { - return ResourceManager.GetString("Error_Valid_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to -900000005. - /// - internal static string ErrorCode_MatterLandingPageExists { - get { - return ResourceManager.GetString("ErrorCode_MatterLandingPageExists", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to true. - /// - internal static string Flag_Send_Email { - get { - return ResourceManager.GetString("Flag_Send_Email", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Step <span>{0}</span> of {1}. - /// - internal static string Header_Display_Step { - get { - return ResourceManager.GetString("Header_Display_Step", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to However an issue occurred and the email notification was not sent. Team members will see the new Matter in Search Matter soon.. - /// - internal static string Share_Matter_Failure { - get { - return ResourceManager.GetString("Share_Matter_Failure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9_]+[-A-Za-z0-9_, .]*. - /// - internal static string Special_Character_Expression_Matter_Description { - get { - return ResourceManager.GetString("Special_Character_Expression_Matter_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9_]+[-A-Za-z0-9_, ]*. - /// - internal static string Special_Character_Expression_Matter_Id { - get { - return ResourceManager.GetString("Special_Character_Expression_Matter_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9-_]+[A-Za-z0-9-_ ]*. - /// - internal static string Special_Character_Expression_Matter_Title { - get { - return ResourceManager.GetString("Special_Character_Expression_Matter_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter is successfully created. You can find recently created matter over <a target='_blank' href='{0}'>here</a>.. - /// - internal static string Success_Matter_Creation { - get { - return ResourceManager.GetString("Success_Matter_Creation", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Step 1/3: Creating matter library and OneNote library.... - /// - internal static string Success_Matter_Step_1 { - get { - return ResourceManager.GetString("Success_Matter_Step_1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Step 2/3: Assigning permissions to matter library and OneNote library, associating Content Types, creating view and matter landing page.... - /// - internal static string Success_Matter_Step_2 { - get { - return ResourceManager.GetString("Success_Matter_Step_2", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Step 3/3: Updating metadata of matter library and sharing matter with the users.... - /// - internal static string Success_Matter_Step_3 { - get { - return ResourceManager.GetString("Success_Matter_Step_3", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.resx deleted file mode 100644 index 40cff2bb..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/MatterProvision.resx +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Create - Value to be displayed on button when checkbox is unchecked - - - Create and Notify - Value to be displayed on button when checkbox is checked - - - However an issue occurred and the custom view was not created. - Failure message for create View - - - Full Control - Mandatory permission needed for edit team member - - - -900000005 - - - Assign Permission Failure: - Error message when service returns invalid response for assign permission - - - Assign permission to at least one team member - Validation message to ask user to enter at least one team member - - - Associate Content Type Failure: - Error message when service returns invalid response for associate content type - - - Enter users that are conflicted with this matter. - Validation message to ask user to enter users who are conflicted - - - Please enter users who are not conducting conflict check - Validation message to ask user to enter users who are not conducting conflict check - - - A conflict check must be completed prior to provisioning this matter. - Validation message to ask user to select if conflict exists for the matter - - - Enter the conflict reviewers name (for auditing purposes). - Validation message to ask user to enter conflict reviewer's name - - - Error in creation of matter: - Error message when service returns invalid response for create matter - - - Please select primary matter type - Validation message to ask user to select default content type - - - Please enter a different Matter name. A matter with same name already exists. - Validation message to check if user has entered a matter name which is already present in the client site collection - - - Landing page of this Matter is already created. Kindly delete existing landing page or please enter a different Matter name. - Validation message to check if Matter landing page is already present in the client site collection - - - OneNote library for this Matter is already created. Kindly delete the library or please enter a different Matter name. - Validation message to check if OneNote library is already present in the client site collection - - - Please provide at least one user who has Full Control permission on this matter. - Validation message to ask user to select full control permission level for at least one user - - - Please enter valid users in the Assign Permission users list - Validation message to ask users to enter valid users in the assign permission list - - - Please enter valid users in Conflicted Users list - Validation message to ask users to enter valid users in the conflicted list - - - Please enter individual who is not conflicted - Validation message to ask user to enter valid user in the conflicted user - - - Enter at least one {0} for this matter. - Validation message to ask user to select at-least one mandatory role - - - Enter a description for this matter. - Validation message to ask user to enter matter description - - - Enter a matter ID. - Validation message to ask user to enter matter Id - - - Failed to create Matter Landing page, continuing with other steps... - Failure message for Matter Landing page not getting created - - - Enter a matter name. - Validation message to ask user to enter a matter title - - - An error has occurred and the matter was not created. Error Code: {0} - Failure message in case of any issue while provisioning a matter - - - Select a client for this matter. - Validation message to ask user to select the client from the clients dropdown - - - Select matter type by area of law for this matter. - Validation message to ask user to select at-least on Area of Law - - - Enter the date on which the conflict check was performed. - Validation message to ask user to select the conflict check date - - - Enter at least one {0} for this matter. - Validation message to ask user to select at-least one user for the selected role - - - Share Matter Failure: - Error message when service returns invalid response for share matter - - - Please enter a valid text which contains only alphanumeric characters, spaces & hyphen - Validation message to ask user to enter valid characters in input text. Special characters not allowed - - - Stamp Properties Failure: - Error message when service returns invalid response for update metadata - - - Please enter valid conflicted user from people picker - Validation message to ask user to enter valid users in conflicted users list - - - Please enter the valid date in MM/DD/YYYY format - Validation message to ask user to enter the date in valid format. i.e. MM/DD/YYYY - - - Please enter a valid Matter name which contains only alphanumeric characters and spaces - Validation message to check if user has entered a valid matter name - - - true - Flag to identify whether to send an email or not - - - Step <span>{0}</span> of {1} - This is a header that displays the step number that user is currently on out of the total number of steps - - - However an issue occurred and the email notification was not sent. Team members will see the new Matter in Search Matter soon. - Failure message for share matter - - - [A-Za-z0-9_]+[-A-Za-z0-9_, .]* - Regular Expression for validating matter description - - - [A-Za-z0-9_]+[-A-Za-z0-9_, ]* - Regular Expression for validating matter id - - - [A-Za-z0-9-_]+[A-Za-z0-9-_ ]* - Regular Expression for validating matter title - - - Matter is successfully created. You can find recently created matter over <a target='_blank' href='{0}'>here</a>. - Success message after matter is created in the selected client's site collection - - - Step 1/3: Creating matter library and OneNote library... - Success message for Step 1 of 3 while provisioning matter - - - Step 2/3: Assigning permissions to matter library and OneNote library, associating Content Types, creating view and matter landing page... - Success message for Step 2 of 3 while provisioning matter - - - Step 3/3: Updating metadata of matter library and sharing matter with the users... - Success message for Step 3 of 3 while provisioning matter - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.Designer.cs deleted file mode 100644 index cd3f034b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.Designer.cs +++ /dev/null @@ -1,594 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Settings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Settings() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.Settings", typeof(Settings).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Add More. - /// - internal static string Add_More_Link { - get { - return ResourceManager.GetString("Add_More_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Some changes have occurred to the settings and your changes were not saved. Refresh the page to view the updated settings. - /// - internal static string Already_Edited_Message { - get { - return ResourceManager.GetString("Already_Edited_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Area of law. - /// - internal static string Area_Law_Text { - get { - return ResourceManager.GetString("Area_Law_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assign team permission. - /// - internal static string Assign_Team_Permission_Title { - get { - return ResourceManager.GetString("Assign_Team_Permission_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cancel. - /// - internal static string Cancel_Button_Text { - get { - return ResourceManager.GetString("Cancel_Button_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Client Name. - /// - internal static string Client_Name { - get { - return ResourceManager.GetString("Client_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0}. - /// - internal static string Client_Name_PlaceHolder { - get { - return ResourceManager.GetString("Client_Name_PlaceHolder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Settings. - /// - internal static string Clients_Header { - get { - return ResourceManager.GetString("Clients_Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click on a name to configure matter creation options for that client.. - /// - internal static string Clients_View_Message { - get { - return ResourceManager.GetString("Clients_View_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Default selections will be editable when a new matter is created.. - /// - internal static string Default_Values_Section_Description { - get { - return ResourceManager.GetString("Default_Values_Section_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Select default values. - /// - internal static string Default_Values_Section_Title { - get { - return ResourceManager.GetString("Default_Values_Section_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Delete. - /// - internal static string Delete_Icon_Title { - get { - return ResourceManager.GetString("Delete_Icon_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter at least one {0} for this matter.. - /// - internal static string Error_Mandatory_Role { - get { - return ResourceManager.GetString("Error_Mandatory_Role", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter a matter ID.. - /// - internal static string Error_Matter_ID { - get { - return ResourceManager.GetString("Error_Matter_ID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter a matter name.. - /// - internal static string Error_Matter_Title { - get { - return ResourceManager.GetString("Error_Matter_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter at least one {0} for this matter.. - /// - internal static string Error_Select_User { - get { - return ResourceManager.GetString("Error_Select_User", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter a valid text which contains only alphanumeric characters, spaces & hyphen. - /// - internal static string Error_Special_Character { - get { - return ResourceManager.GetString("Error_Special_Character", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please enter a valid Matter name which contains only alphanumeric characters and spaces. - /// - internal static string Error_Valid_Matter_Name { - get { - return ResourceManager.GetString("Error_Valid_Matter_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Remove. - /// - internal static string Icon_Title_Backward { - get { - return ResourceManager.GetString("Icon_Title_Backward", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Add. - /// - internal static string Icon_Title_Forward { - get { - return ResourceManager.GetString("Icon_Title_Forward", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Include calendar?. - /// - internal static string Include_Calendar_Default_Title { - get { - return ResourceManager.GetString("Include_Calendar_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Include email notification?. - /// - internal static string Include_Email_Notification_Default_Title { - get { - return ResourceManager.GetString("Include_Email_Notification_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Include RSS Feeds?. - /// - internal static string Include_RSS_Feeds_Default_Title { - get { - return ResourceManager.GetString("Include_RSS_Feeds_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Include tasks?. - /// - internal static string Include_Tasks_Title { - get { - return ResourceManager.GetString("Include_Tasks_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Portal. - /// - internal static string Matter_Center_Portal_Link { - get { - return ResourceManager.GetString("Matter_Center_Portal_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selecting No will remove the conflict check declaration fields from new matters. - /// - internal static string Matter_Conflict_Check_Description { - get { - return ResourceManager.GetString("Matter_Conflict_Check_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Do matters need conflict check data?. - /// - internal static string Matter_Conflict_Check_Title { - get { - return ResourceManager.GetString("Matter_Conflict_Check_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selecting No will allow new matters to be saved without a description. - /// - internal static string Matter_Description_Field_Description { - get { - return ResourceManager.GetString("Matter_Description_Field_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Make the matter description field required?. - /// - internal static string Matter_Description_Required_Title { - get { - return ResourceManager.GetString("Matter_Description_Required_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ID numbers must be manually entered when a new matter is created. Enter default text, such as ID prefix or suffix, or numbering instructions. This text can be removed or changed when a new matter is created.. - /// - internal static string Matter_Id_Default_Description { - get { - return ResourceManager.GetString("Matter_Id_Default_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter ID. - /// - internal static string Matter_Id_Default_Title { - get { - return ResourceManager.GetString("Matter_Id_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enter default text to appear when a new matter is created. For example, a matter name prefix or suffix, or naming convention instructions.This text can be removed or changed when a new matter is created.. - /// - internal static string Matter_Name_Default_Description { - get { - return ResourceManager.GetString("Matter_Name_Default_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Name. - /// - internal static string Matter_Name_Default_Title { - get { - return ResourceManager.GetString("Matter_Name_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selected default matter type. - /// - internal static string Matter_Type_Column_Title { - get { - return ResourceManager.GetString("Matter_Type_Column_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selection complete? Hide matter type section. - /// - internal static string Matter_Type_Default_Info { - get { - return ResourceManager.GetString("Matter_Type_Default_Info", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Set a default matter type by selecting a Practice group, Area of law, and Sub areas of law below.. - /// - internal static string Matter_Type_Default_Title { - get { - return ResourceManager.GetString("Matter_Type_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selection complete? <span class=\"clientLinks\" id=\"hideSection\" title=\"Hide\">Hide</span> matter type section. - /// - internal static string Matter_Type_Hidden_Message { - get { - return ResourceManager.GetString("Matter_Type_Hidden_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name. - /// - internal static string Name_Column_Text { - get { - return ResourceManager.GetString("Name_Column_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No clients here!. - /// - internal static string No_Clients_Message { - get { - return ResourceManager.GetString("No_Clients_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This page shows the current settings for this client’s new matters. The first section allows you to set new matter default selections, which can be changed when a matter is created. The second section defines settings that can not be changed when a new matter is created. No changes are required, and any changes made will not affect existing matters.. - /// - internal static string Page_Default_Description { - get { - return ResourceManager.GetString("Page_Default_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Permission Level. - /// - internal static string Permission_Column_Text { - get { - return ResourceManager.GetString("Permission_Column_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Default to restricting access to an assigned team?. - /// - internal static string Restricted_Access_Default_Title { - get { - return ResourceManager.GetString("Restricted_Access_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This can be changed when a new matter is created. If you select yes, you can either define a default team below or leave the team permission blank.. - /// - internal static string Restricted_Access_Description { - get { - return ResourceManager.GetString("Restricted_Access_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Role. - /// - internal static string Role_Column_Text { - get { - return ResourceManager.GetString("Role_Column_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save. - /// - internal static string Save_Button_Text { - get { - return ResourceManager.GetString("Save_Button_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your changes have been saved. Go back to <span class=\"clientLinks\" id=\"goToClients\" title = \"Clients\">Clients</span>.. - /// - internal static string Save_Success_Message { - get { - return ResourceManager.GetString("Save_Success_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search by Typing. - /// - internal static string Search_By_Typing_Placeholder { - get { - return ResourceManager.GetString("Search_By_Typing_Placeholder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /search/Pages/results.aspx?k={0}. - /// - internal static string Search_Page_URL { - get { - return ResourceManager.GetString("Search_Page_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Select a Practice Group. - /// - internal static string Select_Practice_Group { - get { - return ResourceManager.GetString("Select_Practice_Group", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selected default matter type. - /// - internal static string Selected_Default_Matter_Text { - get { - return ResourceManager.GetString("Selected_Default_Matter_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to These settings will not be editable when a new matter is created.. - /// - internal static string Set_Matter_Options_Default_Description { - get { - return ResourceManager.GetString("Set_Matter_Options_Default_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Set matter options. - /// - internal static string Set_Matter_Options_Default_Title { - get { - return ResourceManager.GetString("Set_Matter_Options_Default_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/Settings.aspx. - /// - internal static string Settings_Page_Url { - get { - return ResourceManager.GetString("Settings_Page_Url", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <span class=\"clientLinks\" id=\"showMatterType\" title=\"Show\">Show</span> matter type section. - /// - internal static string Show_Matter_Section { - get { - return ResourceManager.GetString("Show_Matter_Section", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Show matter type section. - /// - internal static string Show_Matter_Type_Section { - get { - return ResourceManager.GetString("Show_Matter_Type_Section", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9_]+[-A-Za-z0-9_, ]*. - /// - internal static string Special_Character_Expression_Matter_Id { - get { - return ResourceManager.GetString("Special_Character_Expression_Matter_Id", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [A-Za-z0-9-_]+[A-Za-z0-9-_ ]*. - /// - internal static string Special_Character_Expression_Matter_Title { - get { - return ResourceManager.GetString("Special_Character_Expression_Matter_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sub area of law. - /// - internal static string Sub_Area_Law_Text { - get { - return ResourceManager.GetString("Sub_Area_Law_Text", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /SitePages/MatterCenterHome.aspx. - /// - internal static string WebDashboard_Page_Url { - get { - return ResourceManager.GetString("WebDashboard_Page_Url", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.resx deleted file mode 100644 index 4fc31f80..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/Settings.resx +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Area of law - Text for Area of Law - - - Assign team permission - The title of the Assign Team Permission field on the Settings page - - - Cancel - Value to be displayed on Cancel button - - - Default selections will be editable when a new matter is created. - Default values section description - - - Select default values - Select default values section text - - - Include calendar? - The title of the Include Calendar field on the Settings page - - - Include email notification? - The title of the Include email notification field on the Settings page - - - Include RSS Feeds? - The title of the Include RSS Feeds field on the Settings page - - - Matter Center Portal - Matter Center Portal link - - - Selecting No will remove the conflict check declaration fields from new matters - The description of the Matter Conflict Check field on the Setting page - - - Do matters need conflict check data? - The title of the Matter Conflict Check field on the Settings page - - - Selecting No will allow new matters to be saved without a description - The description of the Matter Description field on the Settings page - - - Make the matter description field required? - The title of the Matter Description Required field on the Settings page - - - ID numbers must be manually entered when a new matter is created. Enter default text, such as ID prefix or suffix, or numbering instructions. This text can be removed or changed when a new matter is created. - The description to be displayed for the Matter ID field - - - Matter ID - The title of the Matter Id field on the Settings page - - - Enter default text to appear when a new matter is created. For example, a matter name prefix or suffix, or naming convention instructions.This text can be removed or changed when a new matter is created. - The description to be displayed for the Matter Name field - - - Matter Name - The title of the Matter Name field on the Settings page - - - Selection complete? Hide matter type section - The information to be displayed for the Matter Type field - - - Set a default matter type by selecting a Practice group, Area of law, and Sub areas of law below. - The title of the Matter Type field on the Settings page - - - Name - Assign permission name column text - - - This page shows the current settings for this client’s new matters. The first section allows you to set new matter default selections, which can be changed when a matter is created. The second section defines settings that can not be changed when a new matter is created. No changes are required, and any changes made will not affect existing matters. - The description to be displayed on the Settings page - - - Permission Level - Assign permission column text - - - Default to restricting access to an assigned team? - The title of the Restricted Access field on the Settings page - - - This can be changed when a new matter is created. If you select yes, you can either define a default team below or leave the team permission blank. - Description of restricted access field on Settings page - - - Role - Assign permission role column text - - - Save - Value to be displayed on Save button - - - Selected default matter type - Selected default matter type text - - - Select a Practice Group - Text for Select a practice group - - - These settings will not be editable when a new matter is created. - The description of the Set Matter options section on the Settings page - - - Set matter options - The title of the Set Matter options section on the Settings page - - - Sub area of law - Text for Sub area of law - - - Settings - Header for the clients grid view - - - Click on a name to configure matter creation options for that client. - Message to be displayed when on Clients view - - - Client Name - Client Name text - - - Add More - Add more link - - - Show matter type section - Show matter type section text - - - [A-Za-z0-9_]+[-A-Za-z0-9_, ]* - Regular Expression for validating matter id - - - [A-Za-z0-9-_]+[A-Za-z0-9-_ ]* - Regular Expression for validating matter title - - - Enter a matter ID. - Validation message to ask user to enter matter Id - - - Enter a matter name. - Validation message to ask user to enter a matter title - - - Please enter a valid text which contains only alphanumeric characters, spaces & hyphen - Validation message to ask user to enter valid characters in input text. Special characters not allowed - - - Please enter a valid Matter name which contains only alphanumeric characters and spaces - Validation message to check if user has entered a valid matter name - - - Enter at least one {0} for this matter. - Validation message to ask user to select at-least one mandatory role - - - Enter at least one {0} for this matter. - Validation message to ask user to select at-least one user for the selected role - - - Delete - Delete icon title - - - Remove - Backward icon title - - - Add - Forward icon title - - - Selected default matter type - Matter Type column title - - - Selection complete? <span class=\"clientLinks\" id=\"hideSection\" title=\"Hide\">Hide</span> matter type section - Matter type hidden section message - - - Your changes have been saved. Go back to <span class=\"clientLinks\" id=\"goToClients\" title = \"Clients\">Clients</span>. - Success message to be displayed on click of Save button - - - Search by Typing - Placeholder for Search by typing - - - <span class=\"clientLinks\" id=\"showMatterType\" title=\"Show\">Show</span> matter type section - Show matter type section - - - {0} - Client name placeholder - - - /SitePages/Settings.aspx - Settings page URL - - - /SitePages/MatterCenterHome.aspx - Tenant level webdashboard URL - - - No clients here! - No clients message - - - Some changes have occurred to the settings and your changes were not saved. Refresh the page to view the updated settings - - - Include tasks? - Title for including the tasks list section - - - /search/Pages/results.aspx?k={0} - This is the URL to be used for enterprise level search - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.Designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.Designer.cs deleted file mode 100644 index 06916152..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.Designer.cs +++ /dev/null @@ -1,504 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class WebDashboard { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal WebDashboard() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Legal.MatterCenter.SharePointAppWeb.App_LocalResources.WebDashboard", typeof(WebDashboard).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to addCheckBox;loadDocumentTypeIcon;loadNameColumn;loadGenericColumn;loadGenericColumn;changeDateFormat;loadGenericColumn;loadGenericColumn;loadPinIcon. - /// - internal static string DocumentColumnFormatter { - get { - return ResourceManager.GetString("DocumentColumnFormatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckBox;FileExtension;FileName;MCDocumentClientName;MSITOfficeAuthor;MCModifiedDate;dlcDocIdOWSText;MCVersionNumber;Pin. - /// - internal static string DocumentColumnValueFields { - get { - return ResourceManager.GetString("DocumentColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 20;30;200;200;140;160;150;80;30. - /// - internal static string DocumentColumnWidth { - get { - return ResourceManager.GetString("DocumentColumnWidth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to View document details. - /// - internal static string DocumentDetailsAction { - get { - return ResourceManager.GetString("DocumentDetailsAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileExtension. - /// - internal static string DocumentExtension { - get { - return ResourceManager.GetString("DocumentExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check Box;DocType;Document;Client;Author;Modified date;Document ID;Version;Pin. - /// - internal static string DocumentHeaderName { - get { - return ResourceManager.GetString("DocumentHeaderName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Open document. - /// - internal static string DocumentOpenAction { - get { - return ResourceManager.GetString("DocumentOpenAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentOWAUrl. - /// - internal static string DocumentOWAUrl { - get { - return ResourceManager.GetString("DocumentOWAUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Path. - /// - internal static string DocumentPath { - get { - return ResourceManager.GetString("DocumentPath", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckBox;DocumentExtension;DocumentName;DocumentClient;DocumentOwner;DocumentModifiedDate;DocumentID;DocumentVersion;Pin. - /// - internal static string DocumentPinnedColumnValueFields { - get { - return ResourceManager.GetString("DocumentPinnedColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentName. - /// - internal static string DocumentPinnedTitleProperty { - get { - return ResourceManager.GetString("DocumentPinnedTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SPWebUrl. - /// - internal static string DocumentSPWebUrl { - get { - return ResourceManager.GetString("DocumentSPWebUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileName. - /// - internal static string DocumentTitleProperty { - get { - return ResourceManager.GetString("DocumentTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Something went wrong!. - /// - internal static string Failure_Message { - get { - return ResourceManager.GetString("Failure_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to [Enter Redirect URL for Feedback and Support, e.g. mailto:support@supportsite.com]. - /// - internal static string Feedback_and_Support { - get { - return ResourceManager.GetString("Feedback_and_Support", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 30. - /// - internal static string ItemsPerPage { - get { - return ResourceManager.GetString("ItemsPerPage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter Center Document(s). - /// - internal static string Mail_Cart_Mail_Subject { - get { - return ResourceManager.GetString("Mail_Cart_Mail_Subject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterProvision.aspx. - /// - internal static string Matter_Provision_App_Link { - get { - return ResourceManager.GetString("Matter_Provision_App_Link", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to loadNameColumn;loadGenericColumn;generateClientMatterID;changeDateFormat;loadGenericColumn;loadPinIcon;loadUploadIcon. - /// - internal static string MatterColumnFormatter { - get { - return ResourceManager.GetString("MatterColumnFormatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName;MCClientName;MCClientID;LastModifiedTime;MCResponsibleAttorney;Pin;Upload. - /// - internal static string MatterColumnValueFields { - get { - return ResourceManager.GetString("MatterColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 240;200;150;160;180;30;30. - /// - internal static string MatterColumnWidth { - get { - return ResourceManager.GetString("MatterColumnWidth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to View matter details. - /// - internal static string MatterDetailsAction { - get { - return ResourceManager.GetString("MatterDetailsAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Matter;Client;Client.Matter ID;Modified date;Responsible attorney;Pin;Upload. - /// - internal static string MatterHeaderName { - get { - return ResourceManager.GetString("MatterHeaderName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RefinableString12. - /// - internal static string MatterIDPropertyForDocument { - get { - return ResourceManager.GetString("MatterIDPropertyForDocument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterID. - /// - internal static string MatterIDPropertyForMatter { - get { - return ResourceManager.GetString("MatterIDPropertyForMatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to .aspx. - /// - internal static string MatterLandingPageExtension { - get { - return ResourceManager.GetString("MatterLandingPageExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName;MatterClient;MatterClientId;MatterModifiedDate;MatterResponsibleAttorney;Pin;Upload. - /// - internal static string MatterPinnedColumnValueFields { - get { - return ResourceManager.GetString("MatterPinnedColumnValueFields", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterName. - /// - internal static string MatterPinnedTitleProperty { - get { - return ResourceManager.GetString("MatterPinnedTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MCMatterName. - /// - internal static string MatterTitleProperty { - get { - return ResourceManager.GetString("MatterTitleProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Upload to a matter. - /// - internal static string MatterUploadAction { - get { - return ResourceManager.GetString("MatterUploadAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NA. - /// - internal static string No_Data_String { - get { - return ResourceManager.GetString("No_Data_String", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CheckBox;Pin;Upload;FileExtension;DocumentExtension. - /// - internal static string NonDataColumns { - get { - return ResourceManager.GetString("NonDataColumns", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are no pinned documents.. - /// - internal static string NoPinnedDocuments { - get { - return ResourceManager.GetString("NoPinnedDocuments", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No pinned matters found. - /// - internal static string NoPinnedMatters { - get { - return ResourceManager.GetString("NoPinnedMatters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results found.. - /// - internal static string NoResults_Message { - get { - return ResourceManager.GetString("NoResults_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to .onetoc2. - /// - internal static string OneNoteTableOfContentsExtension { - get { - return ResourceManager.GetString("OneNoteTableOfContentsExtension", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentClientId. - /// - internal static string PinnedClientIDPropertyNameForDocument { - get { - return ResourceManager.GetString("PinnedClientIDPropertyNameForDocument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterClientId. - /// - internal static string PinnedClientIDPropertyNameForMatter { - get { - return ResourceManager.GetString("PinnedClientIDPropertyNameForMatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DocumentMatterId. - /// - internal static string PinnedMatterIDPropertyNameForDocument { - get { - return ResourceManager.GetString("PinnedMatterIDPropertyNameForDocument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterID. - /// - internal static string PinnedMatterIDPropertyNameForMatter { - get { - return ResourceManager.GetString("PinnedMatterIDPropertyNameForMatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Document assigned to Me. - /// - internal static string Search_Assigned_To_Me { - get { - return ResourceManager.GetString("Search_Assigned_To_Me", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Documents. - /// - internal static string Search_Documents { - get { - return ResourceManager.GetString("Search_Documents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search entire Matter Center. - /// - internal static string Search_Entire_DMS { - get { - return ResourceManager.GetString("Search_Entire_DMS", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Matters. - /// - internal static string Search_Matters { - get { - return ResourceManager.GetString("Search_Matters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search Matters assigned to Me. - /// - internal static string Search_Matters_Assigned_To_Me { - get { - return ResourceManager.GetString("Search_Matters_Assigned_To_Me", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /search/Pages/results.aspx?k={0}. - /// - internal static string Search_Page_URL { - get { - return ResourceManager.GetString("Search_Page_URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MatterCenter. - /// - internal static string Temp_Email_Name { - get { - return ResourceManager.GetString("Temp_Email_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to /sites/contentTypeHub/templates/Forms/AllItems.aspx. - /// - internal static string TemplatesURL { - get { - return ResourceManager.GetString("TemplatesURL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _layouts/WopiFrame.aspx?sourcedoc=. - /// - internal static string WOPIFrameURL { - get { - return ResourceManager.GetString("WOPIFrameURL", resourceCulture); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.resx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.resx deleted file mode 100644 index 528f7777..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/App_LocalResources/WebDashboard.resx +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Something went wrong! - This is a failure message for invalid service response - - - [Enter Redirect URL for Feedback and Support, e.g. mailto:support@supportsite.com] - Redirect URL for Feedback and Support - - - Matter Center Document(s) - Subject of the mail required as part of mail cart feature - - - .aspx - This is the file extension of the Matter Landing page - - - MatterProvision.aspx - This is used to add link to the global navigation matter provision tab - - - No results found. - This is a message for no result scenario - - - NA - This is displayed when string is null or whitespace - - - .onetoc2 - This is the file extension of the OneNote table of contents - - - Search Document assigned to Me - This text is displayed on auto-complete search options for Search Documents - - - Search Documents - This is used to check if Search Documents is loaded in Web Dashboard - - - Search entire Matter Center - This text is displayed on auto-complete search options - - - Search Matters - This is used to check if Search Matters is loaded in Web Dashboard - - - Search Matters assigned to Me - This text is displayed on auto-complete search options for Search Matters - - - /sites/contentTypeHub/templates/Forms/AllItems.aspx - This is the URL for templates link. - - - MatterCenter - This is used to give temporary email name while the email is being created - - - _layouts/WopiFrame.aspx?sourcedoc= - This is the URL for the WOPIFrame that allows the user to open the OneNote for a matter - - - There are no pinned documents. - This is message for no pinned documents - - - No pinned matters found - This is message for no pinned matters - - - addCheckBox;loadDocumentTypeIcon;loadNameColumn;loadGenericColumn;loadGenericColumn;changeDateFormat;loadGenericColumn;loadGenericColumn;loadPinIcon - Semicolon separated list of values for document view on web dashboard whose function definition is already defined - - - CheckBox;FileExtension;FileName;MCDocumentClientName;MSITOfficeAuthor;MCModifiedDate;dlcDocIdOWSText;MCVersionNumber;Pin - Semicolon separated list of managed properties for document view on web dashboard, which are used to bind JSON data - - - 20;30;200;200;140;160;150;80;30 - Semicolon separated list of width of columns for document view on web dashboard - - - Check Box;DocType;Document;Client;Author;Modified date;Document ID;Version;Pin - Semicolon separated list of name of the column headers for document view on web dashboard - - - loadNameColumn;loadGenericColumn;generateClientMatterID;changeDateFormat;loadGenericColumn;loadPinIcon;loadUploadIcon - Semicolon separated list of values for document view on web dashboard whose function definition is already defined - - - MCMatterName;MCClientName;MCClientID;LastModifiedTime;MCResponsibleAttorney;Pin;Upload - Semicolon separated list of managed properties for document view on web dashboard, which are used to bind JSON data - - - 240;200;150;160;180;30;30 - Semicolon separated list of width of columns for document view on web dashboard - - - Matter;Client;Client.Matter ID;Modified date;Responsible attorney;Pin;Upload - Semicolon separated list of name of the column headers for document view on web dashboard - - - CheckBox;DocumentExtension;DocumentName;DocumentClient;DocumentOwner;DocumentModifiedDate;DocumentID;DocumentVersion;Pin - Semicolon separated list of managed properties for pinned document view on web dashboard, which are used to bind JSON data - - - FileName - This is the property name for Document title - - - RefinableString12 - This is the property name for matter ID - - - MCMatterID - This is the property name for matter ID - - - MatterName;MatterClient;MatterClientId;MatterModifiedDate;MatterResponsibleAttorney;Pin;Upload - Semicolon separated list of managed properties for pinned document view on web dashboard, which are used to bind JSON data - - - MCMatterName - This is the property name for Matter title - - - MatterClientId - This is the property name for client ID - - - DocumentName - This is the property name for document title - - - MatterName - This is the property name for matter title - - - DocumentClientId - This is the property name for client ID - - - DocumentMatterId - This is the property name for matter ID - - - MatterID - This is the property name for matter ID - - - FileExtension - Property name for document extension - - - DocumentOWAUrl - Property name for document OWA URL - - - Path - Property name for document path - - - SPWebUrl - Property name for document SPWebURL - - - CheckBox;Pin;Upload;FileExtension;DocumentExtension - Semicolon separated list of columns which do not represent data items in web dashboard - - - 30 - Number of rows to fetch in a single request to display in grid view control. - - - View document details - Text to be displayed on Document details button on Documents fly out - - - Open document - Text to be displayed on Open document button on Documents fly out - - - View matter details - Text to be displayed on Matter details button on Matter fly out - - - Upload to a matter - Text to be displayed on Upload button on Matter fly out - - - /search/Pages/results.aspx?k={0} - This is the URL to be used for enterprise level search - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/ApplicationInsights.config b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/ApplicationInsights.config deleted file mode 100644 index 3e48c78b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/ApplicationInsights.config +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter Instrumentation Key for Application Insights, e.g. eea-9a5354ff56-889-0f0b5ca92-43f815d] - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/GlobalSuppressions.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/GlobalSuppressions.cs deleted file mode 100644 index 42f6972f..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/GlobalSuppressions.cs and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/LCADMSUIKey.snk b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/LCADMSUIKey.snk deleted file mode 100644 index 4577b128..00000000 Binary files a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/LCADMSUIKey.snk and /dev/null differ diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master deleted file mode 100644 index cc894d79..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master +++ /dev/null @@ -1,214 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MatterCenterMaster.Master.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.MatterCenterMaster" %> - - - - - - - <asp:ContentPlaceHolder ID="PageTitleContentPlaceHolder" runat="server"> - </asp:ContentPlaceHolder> - - - - - - - - - - - -
- -
-
-
-
- Close -
-
-
-
-
-
Error Code:
-
Timestamp:
-
-
-
-
-
-
- Loading -
-
-
-
- Close -
-
-
- -
-
-
-
-
- info -
-
-
-
-
-
- Toggle app switcher menu -
-
    - - - -
-
-
-
-
-
- Open App Switcher - Close App Switcher - -
-
- -
-
-
- - -
-
- Close flyout -
Matter Center For Outlook
-
-
-
- Questions? Contact Matter Center Support -
-
-
-
-
- Profile Picture -
-
-
-
- Profile Picture -
-
-
-
-
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
Matter Center
-
for Office 365
-
-
- -
- - - -
-
- - - - - -
-
-
- - - - - - - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.cs deleted file mode 100644 index d3a20669..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.cs +++ /dev/null @@ -1,138 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-akdigh -// Created : 06-16-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file holds code for common operations to be used across various pages. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using Microsoft.SharePoint.Client.UserProfiles; - using System; - using System.Globalization; - using System.Reflection; - using System.Web; - using System.Web.UI; - #endregion - - /// - /// Master page class for common operations. - /// - public partial class MatterCenterMaster : MasterPage - { - // - /// Handles the Load event of the Master Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string refreshToken = null != this.Request.Cookies[UIConstantStrings.refreshToken] ? this.Request.Cookies[UIConstantStrings.refreshToken].Value : string.Empty; - ProvisionMatterLink.InnerText = UIConstantStrings.ProvisionMatterAccess ? UIConstantStrings.ProvisionMatterName : string.Empty; - if (null == Request.Cookies[UIConstantStrings.URLReferrerCookieName] && null != Request.UrlReferrer) - { - HttpCookie referrer = new HttpCookie(UIConstantStrings.URLReferrerCookieName, Convert.ToString(Request.UrlReferrer.Host, CultureInfo.InvariantCulture)); - Response.Cookies.Add(referrer); - } - if (null == Request.Cookies[UIConstantStrings.RequestTokenCookieName] && String.IsNullOrWhiteSpace(Request.Form[this.requestvalidator.Name])) - { - string newGuid = Convert.ToString(Guid.NewGuid(), CultureInfo.InvariantCulture); - this.requestvalidator.Value = newGuid; - HttpCookie cookie = new HttpCookie(UIConstantStrings.RequestTokenCookieName, newGuid); - cookie.HttpOnly = false; - Response.Cookies.Add(cookie); - } - else - { - if (null != Request.Cookies[UIConstantStrings.RequestTokenCookieName]) - { - if (null != Request.UrlReferrer && Request.UrlReferrer.Host == Request.Cookies[UIConstantStrings.URLReferrerCookieName].Value) - { - this.requestvalidator.Value = Request.Cookies[UIConstantStrings.RequestTokenCookieName].Value; - } - else if (null != Request.Url) - { - this.requestvalidator.Value = Request.Cookies[UIConstantStrings.RequestTokenCookieName].Value; - } - } - } - //// This code is required to load Office.js when app is opened in Outlook - if (Request.Url.Query.ToString().ToUpper(CultureInfo.InvariantCulture).Contains(UIConstantStrings.IS_OUTLOOK.ToUpper(CultureInfo.InvariantCulture))) - { - LiteralControl javascriptRef = new LiteralControl(""); - Page.Header.Controls.Add(javascriptRef); - } - // Set User Details - using (ClientContext clientContext = ServiceUtility.GetClientContext(null, new Uri(UIConstantStrings.CentralRepository), refreshToken, this.Request)) - { - ShowProfilePicture(clientContext, refreshToken); - } - } - catch (Exception ex) - { - string response = Logger.LogError(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - - /// - /// Handles the click event of the sign out link. Clear cookies and sign out the user. - /// - /// The source of the event. - /// The instance containing the event data. - protected void SignOutLink_Click(object sender, EventArgs e) - { - HttpCookie refreshTokenCookie = new HttpCookie(UIConstantStrings.refreshToken); - refreshTokenCookie.Expires = DateTime.Now.AddDays(-1d); - Response.Cookies.Add(refreshTokenCookie); - Response.Redirect(UIConstantStrings.SiteURL + UIConstantStrings.SignOutURL); - } - - /// - /// Shows the profile picture on the app header and persona flyout. - /// - /// The client context. - /// The refresh token - private void ShowProfilePicture(ClientContext clientContext, string refreshToken) - { - PeopleManager peopleManager = new PeopleManager(clientContext); - PersonProperties personProperties = peopleManager.GetMyProperties(); - ///// Load users my site URL - clientContext.Load(personProperties); - clientContext.ExecuteQuery(); - string personalURL = personProperties.PersonalUrl.ToUpperInvariant().TrimEnd('/'); - string[] pictureInfo = personalURL.Split(new string[] { UIConstantStrings.PersonalURLSeparator.ToUpperInvariant() }, StringSplitOptions.None); - PersonaTitle.InnerHtml = personProperties.DisplayName; - PersonaTitle.Attributes.Add(UIConstantStrings.titleAttribute, personProperties.DisplayName); - PersonaEmail.InnerHtml = personProperties.Email; - PersonaEmail.Attributes.Add(UIConstantStrings.titleAttribute, personProperties.Email); - if (null != refreshToken && 2 == pictureInfo.Length) - { - using (ClientContext oneDriveClientContext = ServiceUtility.GetClientContext(null, new Uri(pictureInfo[0]), refreshToken, this.Request)) - { - string profilePictureURL = String.Format(CultureInfo.InvariantCulture, UIConstantStrings.UserPhotoURL, pictureInfo[1], UIConstantStrings.userPhotoSmall); - string smallImageContent = UIUtility.GetImageInBase64Format(oneDriveClientContext, profilePictureURL); - if (!string.IsNullOrWhiteSpace(smallImageContent)) - { - AppHeaderPersona.Src = smallImageContent; - } - profilePictureURL = String.Format(CultureInfo.InvariantCulture, UIConstantStrings.UserPhotoURL, pictureInfo[1], UIConstantStrings.userPhotoMedium); - string mediumImageContent = UIUtility.GetImageInBase64Format(oneDriveClientContext, profilePictureURL); - if (!string.IsNullOrWhiteSpace(mediumImageContent)) - { - PersonaPicture.Src = mediumImageContent; - } - } - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.designer.cs deleted file mode 100644 index 3dd3f37a..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MasterPage/MatterCenterMaster.Master.designer.cs +++ /dev/null @@ -1,123 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb { - - - public partial class MatterCenterMaster { - - /// - /// PageTitleContentPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder PageTitleContentPlaceHolder; - - /// - /// HeadContentPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder HeadContentPlaceHolder; - - /// - /// MasterPageForm control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm MasterPageForm; - - /// - /// ProvisionMatterLink control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl ProvisionMatterLink; - - /// - /// AppHeaderPersona control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlImage AppHeaderPersona; - - /// - /// PersonaPicture control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlImage PersonaPicture; - - /// - /// PersonaTitle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl PersonaTitle; - - /// - /// PersonaEmail control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl PersonaEmail; - - /// - /// SignOutLink control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton SignOutLink; - - /// - /// requestvalidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden requestvalidator; - - /// - /// BodyContentPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder BodyContentPlaceHolder; - - /// - /// ScriptContentPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder ScriptContentPlaceHolder; - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master deleted file mode 100644 index 4efe56e8..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master +++ /dev/null @@ -1,37 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MatterCenter.master.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.MatterCenter" %> - - - - - - - - - - -
- -
- - -
- -
- - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.cs deleted file mode 100644 index 8f59044d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.Helpers; - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb -{ - public partial class MatterCenter : System.Web.UI.MasterPage - { - protected void Page_Load(object sender, EventArgs e) - { - if (Request.Cookies[UIConstantStrings.URLReferrerCookieName] == null && Request.UrlReferrer != null) - { - HttpCookie referrer = new HttpCookie(UIConstantStrings.URLReferrerCookieName, Request.UrlReferrer.Host.ToString()); - Response.Cookies.Add(referrer); - } - - if (Request.Cookies[UIConstantStrings.RequestTokenCookieName] == null && String.IsNullOrWhiteSpace(Request.Form[this.requestvalidator.Name])) - { - Guid newGuid = Guid.NewGuid(); - this.requestvalidator.Value = newGuid.ToString(); - HttpCookie cookie = new HttpCookie(UIConstantStrings.RequestTokenCookieName, newGuid.ToString()); - cookie.HttpOnly = false; - Response.Cookies.Add(cookie); - } - else - { - if (Request.Cookies[UIConstantStrings.RequestTokenCookieName] != null) - { - if (Request.UrlReferrer != null && Request.UrlReferrer.Host == Request.Cookies[UIConstantStrings.URLReferrerCookieName].Value) - { - this.requestvalidator.Value = Request.Cookies[UIConstantStrings.RequestTokenCookieName].Value; - } - else if (Request.Url != null - && Request.UrlReferrer == null) - { - this.requestvalidator.Value = Request.Cookies[UIConstantStrings.RequestTokenCookieName].Value; - } - } - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.designer.cs deleted file mode 100644 index 9ffeefa4..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/MatterCenter.Master.designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb { - - - public partial class MatterCenter { - - /// - /// head control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder head; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// requestvalidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden requestvalidator; - - /// - /// ContentPlaceHolder1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1; - - /// - /// ContentPlaceHolder2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder2; - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj deleted file mode 100644 index 2e0ea81e..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj +++ /dev/null @@ -1,594 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {D81C60EA-B7A9-432A-B563-171997BC3A41} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Microsoft.Legal.MatterCenter.SharePointAppWeb - Microsoft.Legal.MatterCenter.SharePointAppWeb - v4.5 - true - 44329 - - - - - - SAK - SAK - SAK - SAK - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - true - false - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - false - true - false - - - - ..\packages\AntiXSS.4.3.0\lib\net40\AntiXssLibrary.dll - - - False - ..\External\DocumentFormat.OpenXml.dll - True - - - ..\packages\AntiXSS.4.3.0\lib\net40\HtmlSanitizationLibrary.dll - - - ..\packages\Microsoft.ApplicationInsights.Agent.Intercept.1.2.0\lib\net45\Microsoft.AI.Agent.Intercept.dll - True - - - ..\packages\Microsoft.ApplicationInsights.DependencyCollector.1.2.3\lib\net45\Microsoft.AI.DependencyCollector.dll - True - - - ..\packages\Microsoft.ApplicationInsights.PerfCounterCollector.1.2.3\lib\net45\Microsoft.AI.PerfCounterCollector.dll - True - - - ..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.1.2.3\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll - True - - - ..\packages\Microsoft.ApplicationInsights.Web.1.2.3\lib\net45\Microsoft.AI.Web.dll - True - - - ..\packages\Microsoft.ApplicationInsights.WindowsServer.1.2.3\lib\net45\Microsoft.AI.WindowsServer.dll - True - - - ..\packages\Microsoft.ApplicationInsights.1.2.3\lib\net45\Microsoft.ApplicationInsights.dll - True - - - True - - - True - - - True - - - ..\External\Microsoft.SharePoint.Client.dll - True - - - ..\External\Microsoft.SharePoint.Client.Runtime.dll - True - - - ..\External\Microsoft.SharePoint.Client.Search.dll - True - - - ..\External\Microsoft.SharePoint.Client.UserProfiles.dll - True - - - True - - - False - ..\External\Microsoft.WindowsAzure.ServiceRuntime.dll - True - - - False - ..\External\Microsoft.WindowsAzure.Storage.dll - True - - - ..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - - - True - - - - True - - - True - - - False - ..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll - - - True - - - True - - - True - - - True - - - True - - - True - - - - False - ..\External\System.Web.Helpers.dll - - - False - ..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll - - - False - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - - - - Always - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - Designer - - - Web.config - - - Web.config - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - Designer - - - - - - - True - True - Constants.resx - - - True - True - FindDocument.resx - - - True - True - FindMatter.resx - - - True - True - Settings.resx - - - - True - True - LegalBriefcase.resx - - - True - True - MatterProvision.resx - - - MatterCenterMaster.Master - ASPXCodeBehind - - - MatterCenterMaster.Master - - - BriefcaseOperations.aspx - ASPXCodeBehind - - - BriefcaseOperations.aspx - - - DownloadEmail.aspx - ASPXCodeBehind - - - DownloadEmail.aspx - - - FindDocument.aspx - ASPXCodeBehind - - - FindDocument.aspx - - - FindMatter.aspx - ASPXCodeBehind - - - FindMatter.aspx - - - Home.aspx - ASPXCodeBehind - - - Home.aspx - - - ManagePermissions.aspx - ASPXCodeBehind - - - ManagePermissions.aspx - - - MatterProvision.aspx - ASPXCodeBehind - - - MatterProvision.aspx - - - SendToOneDrive.aspx - ASPXCodeBehind - - - SendToOneDrive.aspx - - - Settings.aspx - ASPXCodeBehind - - - Settings.aspx - - - UploadFile.aspx - ASPXCodeBehind - False - - - UploadFile.aspx - - - WebDashboard.aspx - ASPXCodeBehind - - - WebDashboard.aspx - - - - True - True - WebDashboard.resx - - - - - - ResXFileCodeGenerator - Constants.Designer.cs - Designer - - - ResXFileCodeGenerator - FindDocument.Designer.cs - Designer - - - ResXFileCodeGenerator - FindMatter.Designer.cs - Designer - - - ResXFileCodeGenerator - LegalBriefcase.Designer.cs - - - ResXFileCodeGenerator - MatterProvision.Designer.cs - Designer - - - ResXFileCodeGenerator - WebDashboard.Designer.cs - Designer - - - - - {04b6e5ba-de44-4e40-9496-ee12f658de67} - Microsoft.Legal.MatterCenter.Entity - - - {8232f5f2-a0f9-4608-b7f3-22a321eca1b0} - Microsoft.Legal.MatterCenter.Utility - - - - - ResXFileCodeGenerator - Settings.Designer.cs - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - - - LCADMSUIKey.snk - - - - - - - - - False - True - 9663 - / - http://localhost:9663/ - False - False - - - False - - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.user b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.user deleted file mode 100644 index dfb5c1fa..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.user +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - CurrentPage - True - False - False - False - - - - - - - - - True - True - - - - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.vspscc b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.vspscc deleted file mode 100644 index b6d32892..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Microsoft.Legal.MatterCenter.SharePointAppWeb.csproj.vspscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx deleted file mode 100644 index 3bbe86a1..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx +++ /dev/null @@ -1,93 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage/MatterCenterMaster.Master" CodeBehind="BriefcaseOperations.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.BriefcaseOperations" %> - - - Processing - - - -
-
-
-
-
- OK - Cancel -
-
- OK -
-
-
-
-
- Version -
-
- Select the type of version you would like to check in. - - - What kind of version would you like to check in? - Minor Version (draft) - Major Version (publish) - Overwrite the current minor version - -
-
- Retain Checkout -
-
- Other users will not see your changes until you check in. If you wish to continue editing, you can retain your check out after checking in. - - - Retain your check out after checking in? - - Yes - - No - - - Would you like to keep a convenience copy in your OneDrive upon check in? - - - Yes - - No - - -
-
- Comments -
-
- Type comments describing what has changed in this version. - - - Comments: - - -
-
-
-
- OK -
-
- Cancel -
-
-
-
- - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.cs deleted file mode 100644 index 59fd4237..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.cs +++ /dev/null @@ -1,44 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-nikhid -// Created : 06-03-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of BriefcaseOperations.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality for all briefcase operations. - /// - public partial class BriefcaseOperations : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForBriefcase, ConstantStrings.ConstantFileForBriefcase); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.designer.cs deleted file mode 100644 index 81d1110b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/BriefcaseOperations.aspx.designer.cs +++ /dev/null @@ -1,14 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - public partial class BriefcaseOperations { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/CommonControls.html b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/CommonControls.html deleted file mode 100644 index 120fc0d9..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/CommonControls.html +++ /dev/null @@ -1,145 +0,0 @@ - - -
-
-
-
-
- - -
-
- -
-
- -
-
-
- -
-
- -
-
-
-
-
- Loading... -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
- - -
-
- -
-
-
-
-
-
-
-
- -
- -
Ok
-
-
-
-
-
-
-
- clear -
-
Clear filters from
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- - - - -
- Loading -
-
-
\ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx deleted file mode 100644 index 313fab95..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DownloadEmail.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.DownloadEmail" %> \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.cs deleted file mode 100644 index d52619c5..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.cs +++ /dev/null @@ -1,86 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-rijadh -// Created : 03-14-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of DownloadEmail.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.IO; - using System.Reflection; - #endregion - - /// - /// Provides functionality to download email. - /// - public partial class DownloadEmail : System.Web.UI.Page - { - /// - /// Generates the stream from mail content. - /// - /// The stream value. - /// Memory Stream. - private static MemoryStream GenerateStreamFromString(string streamValue) - { - MemoryStream result = null; - try - { - using (MemoryStream mailStream = new MemoryStream()) - { - StreamWriter mailStreamWriter = new StreamWriter(mailStream); - mailStreamWriter.Write(streamValue); - mailStreamWriter.Flush(); - mailStream.Position = 0; - result = mailStream; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - result = new MemoryStream(); - } - return result; - } - - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string requestValidationTokens = Request.Form["requestToken"]; - if (ServiceUtility.ValidateRequestToken(requestValidationTokens)) - { - string emailText = Server.UrlDecode(Request.Form["MailContent"]); - if (null != emailText) - { - string emailName = UIConstantStrings.EmailName + DateTime.Now + ConstantStrings.EmailFileExtension; - MemoryStream emailStream = GenerateStreamFromString(emailText); - Response.Buffer = true; - Response.ClearHeaders(); - Response.ContentType = "application/octet-stream"; - Response.AppendHeader("content-disposition", "inline; filename=" + emailName); - Response.BinaryWrite(emailStream.ToArray()); - Response.Flush(); - Response.End(); - } - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.designer.cs deleted file mode 100644 index 26d6e9fd..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/DownloadEmail.aspx.designer.cs +++ /dev/null @@ -1,14 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - public partial class DownloadEmail { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FilterPanel.html b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FilterPanel.html deleted file mode 100644 index 4d20a4ca..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FilterPanel.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - Filter Panel - - -
-
-
-
-
-
-
-
Search Matters
-
Search Documents
-
-
-
-
-
-
- - -
- Search -
- Drop Down - Drop Down - -
-
-
-
Clients
-
- - Drop Down -
-
- Loading -
-
-
-
-
-
Practice Group
-
- - Drop Down -
-
- Loading -
-
-
-
-
-
Area of Law
-
- - Drop Down -
-
- Loading -
-
-
-
-
-
Author
-
- -
-
- Loading -
-
-
-
-
-
Date
-
- - Date Picker - - Date Picker -
-
To Date cannot be less than From Date
-
-
-
-
-
-
-
-
- Search -
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
View matter details
-
Upload to a matter
-
- Loading -
-
-
-
-
-
- - - - - -
Open document
-
View document details
-
- Loading -
-
- -
-
Items
-
- -
-
Folders
-
-
-
- -
-
-
-
-
- - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx deleted file mode 100644 index eb884d3a..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx +++ /dev/null @@ -1,56 +0,0 @@ -<%@ Page Title="Search Document" Language="C#" MasterPageFile="~/MasterPage/MatterCenterMaster.Master" AutoEventWireup="true" CodeBehind="FindDocument.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.SearchDocument" %> - - - Search Document - - - - - - - -
- Warning icon -
-
-
-
-
-
-
-
Close
-
-
-
-
- Loading... -
-
-
-
-
-
Close
-
-
-
-
- -
-
- -
-
-
-
-
- - - - - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.cs deleted file mode 100644 index ae034659..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.cs +++ /dev/null @@ -1,45 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-prd -// Created : 13-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of FindDocument.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality for Search Document - /// - public partial class SearchDocument : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForDocument, ConstantStrings.ConstantFileForDocument); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.designer.cs deleted file mode 100644 index 9cecb0be..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindDocument.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages { - - - public partial class SearchDocument { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx deleted file mode 100644 index eb60d5e1..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx +++ /dev/null @@ -1,26 +0,0 @@ -<%@ Page Title="Search Matter" Language="C#" MasterPageFile="~/MasterPage/MatterCenterMaster.Master" AutoEventWireup="true" CodeBehind="FindMatter.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.SearchMatter" %> - - - Search Matter - - - - - - - - - -
-
-
-
-
- - - - - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.cs deleted file mode 100644 index d89bec8e..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.cs +++ /dev/null @@ -1,42 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-shpate -// Created : 13-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of FindMatter.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality for Search Matter - /// - public partial class SearchMatter : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) - { - string redirectURL = string.Empty; - try - { - redirectURL = GenericFunctions.GetRedirectURL(this.Request); - redirectURL = GenericFunctions.AppendQueryParameter(redirectURL, this.Request); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectFormatter, ConstantStrings.ConstantFileFormatter); - - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.designer.cs deleted file mode 100644 index 3ff43720..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/FindMatter.aspx.designer.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - - - public partial class SearchMatter - { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Footer.html b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Footer.html deleted file mode 100644 index f352a31e..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Footer.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Footer - - - -
- -
- - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx deleted file mode 100644 index 065a82fd..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx +++ /dev/null @@ -1,70 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.Home" MasterPageFile="~/MasterPage/MatterCenterMaster.Master" %> - - Home - - - - - -
-
- Welcome to Matter Center! Upload, share, and save your documents here. - Learn more or dismiss - -
- - -
- - - -
-
-
- - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.cs deleted file mode 100644 index 7912d706..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.cs +++ /dev/null @@ -1,54 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-nikhid -// Created : 02-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of Home.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality to app landing page. - /// - public partial class Home : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - redirectURL = GenericFunctions.AppendQueryParameter(redirectURL, this.Request); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, null, null); - /* Code to hide the Provision Matter icon if user is not having access Provision Matter App */ - // Get the refresh token which is saved in the cookies - string refreshToken = null != this.Request.Cookies[UIConstantStrings.refreshToken] ? this.Request.Cookies[UIConstantStrings.refreshToken].Value : string.Empty; - // Check whether the user is having access to Provision Matter App - UIConstantStrings.ProvisionMatterAccess = UIUtility.GetUserAccess(refreshToken, new Uri(ConstantStrings.ProvisionMatterAppURL), this.Request); - if (!UIConstantStrings.ProvisionMatterAccess) - { - CreateMatterLink.Visible = false; - } - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.designer.cs deleted file mode 100644 index b35ec89e..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Home.aspx.designer.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages { - - - public partial class Home { - - /// - /// CreateMatterLink control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl CreateMatterLink; - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx deleted file mode 100644 index b03e2eac..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx +++ /dev/null @@ -1,58 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage/MatterCenterMaster.Master" CodeBehind="ManagePermissions.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.ManagePermissions" %> - - - Manage Permissions - - - - -
- Loading -
Working on it...
-
-
-
-
- -
- -
- -
-
-
-
-
-
-
-
-
- - - -
-
- - - - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.cs deleted file mode 100644 index 98f41053..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.cs +++ /dev/null @@ -1,42 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-shpate -// Created : 03-02-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of ManagePermissions.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - public partial class ManagePermissions : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = string.Empty; - redirectURL = GenericFunctions.GetRedirectURL(this.Request); - UIConstantStrings.EditMatterQueryString = Request.Url.Query; // Stored the query string in a variable and used the variable for redirection as a fix for code analyzer warning. - if (!string.IsNullOrWhiteSpace(Request.Url.Query)) - { - redirectURL = string.Concat(redirectURL, UIConstantStrings.EditMatterQueryString); - } - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForProvision, ConstantStrings.ConstantFileForProvision); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.designer.cs deleted file mode 100644 index 1aae0753..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/ManagePermissions.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages { - - - public partial class ManagePermissions { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx deleted file mode 100644 index 36b95cd1..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx +++ /dev/null @@ -1,234 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage/MatterCenterMaster.Master" CodeBehind="MatterProvision.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.MatterProvision" %> - - - Provision Matter - - - - - - - -
-
-
-
-
-
-
-
-
- - - -
- -
-
- -
- -
- - Client Icon -
-
-
-
- - -
- - -
- - - - -
-
- -
- Loading... -
-
-
- -
-
-
- - -
- -
- - -
- -
-
- - -
-
-
- - -
-
-
-
- -
- - -
- - -
- -
- -
- -
-
-
- - Role Icon -
-
-
-
-
-
-
- - Permission Icon -
-
-
-
-
-
- Delete -
-
-
- Add More Names -
-
- -
-
- -
- - -
-
- - -
-
- - -
-
- - -
- -
-
- Loading... -
-
-
-
-
-
- -
-
- Close -
-
-
Select a Practice Group
-
-
- - Practice Group Icon -
-
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
-
-
-
-
Please select primary matter type
-
- - -
-
-
-
-
-
- info - Please select primary matter type before you save. -
- -
-
-
-
- - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.cs deleted file mode 100644 index fd089c26..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.cs +++ /dev/null @@ -1,44 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-rijadh -// Created : 14-03-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of MatterProvision.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality to provision matter. - /// - public partial class MatterProvision : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForProvision, ConstantStrings.ConstantFileForProvision); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.designer.cs deleted file mode 100644 index e6556ccc..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/MatterProvision.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages { - - - public partial class MatterProvision { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx deleted file mode 100644 index 842074b2..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx +++ /dev/null @@ -1,37 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage/MatterCenterMaster.Master" CodeBehind="SendToOneDrive.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.SendToOneDrive" %> - - - Send to One Drive - - - -
-
-
-
-
- Loading... -
-
-
OK
-
Cancel
-
-
-
OK
-
-
-
- - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.cs deleted file mode 100644 index e0ff3b4c..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.cs +++ /dev/null @@ -1,49 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-prd -// Created : 14-03-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of SendToOneDrive.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality to send documents to OneDrive. - /// - public partial class SendToOneDrive : System.Web.UI.Page - { - /// - /// Method called on page load. - /// - /// The source of the event - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - UIConstantStrings.SendToOneDriveQueryString = Request.Url.Query; // Stores the query string in a variable and used the variable for redirection as a fix for code analyzer warning. - if (!string.IsNullOrWhiteSpace(Request.Url.Query)) - { - redirectURL = string.Concat(redirectURL, UIConstantStrings.SendToOneDriveQueryString); - } - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForBriefcase, ConstantStrings.ConstantFileForBriefcase); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.designer.cs deleted file mode 100644 index 19edf4a8..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/SendToOneDrive.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages { - - - public partial class SendToOneDrive { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx deleted file mode 100644 index 858c8c6b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx +++ /dev/null @@ -1,325 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MatterCenterMaster.Master" AutoEventWireup="true" CodeBehind="Settings.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.Settings" %> - - - Settings - - - - - - - -
- Loading -
-
-
-
-
-
- - Matter Center - -
-
-
- -
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
- -
-
-
-
- - -
-
-
-
-
-
- -
-
- - -
-
-
-
-
-
- -
-
- - -
-
-
-
-
-
- - Practice Group Icon -
-
-
-
- Loading -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
-
-
-
- - -
-
-
- - -
-
-
-
-
-
- -
-
- - -
-
- - -
-
-
- - -
-
-
-
-
- Loading -
- -
- -
- -
- -
-
-
- - Role Icon -
-
-
-
-
-
-
- - Permission Icon -
-
-
-
-
-
- delete -
-
-
- -
-
-
- - -
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
-
-
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
-
-
-
- - -
-
- - -
-
-
- - -
- - -
- -
-
- -
- -
- - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.cs deleted file mode 100644 index aba77ff9..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.cs +++ /dev/null @@ -1,49 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-prd -// Created : 26-02-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of Settings.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides functionality to settings page - /// - public partial class Settings : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = GenericFunctions.GetRedirectURL(this.Request); - UIConstantStrings.SettingsPageQueryString = Request.Url.Query; // Stores the query string in a variable and used the variable for redirection as a fix for code analyzer warning. - if (!string.IsNullOrWhiteSpace(Request.Url.Query)) - { - redirectURL = string.Concat(redirectURL, UIConstantStrings.SettingsPageQueryString); - } - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForSettings, ConstantStrings.ConstantFileForSettings); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.designer.cs deleted file mode 100644 index 9038e15d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/Settings.aspx.designer.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - - - public partial class Settings - { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx deleted file mode 100644 index 26b59c9b..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadFile.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.UploadFile" %> diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.cs deleted file mode 100644 index 68170c70..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.cs +++ /dev/null @@ -1,374 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-shpate -// Created : 13-01-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of UploadFile.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Entity; - using Microsoft.Legal.MatterCenter.Utility; - using Microsoft.SharePoint.Client; - using System; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Reflection; - using System.Text.RegularExpressions; - using System.Web; - #endregion - - /// - /// Provides functionality to upload file. - /// - public partial class UploadFile : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - string requestValidationTokens = Request.Headers["RequestValidationToken"]; - if (ServiceUtility.ValidateRequestToken(requestValidationTokens)) - { - string result = this.UploadFileToSharePoint(this.Request); - Response.Write(Microsoft.Security.Application.Encoder.HtmlEncode(result)); - } - } - - /// - /// Uploads the file to SharePoint. - /// - /// Web request object - protected string UploadFileToSharePoint(HttpRequest request) - { - HttpFileCollection fileCollection = Request.Files; - Regex regEx = new Regex("[*?|\\\t/:\"\"'<>#{}%~&]"); - string sharePointAppToken = Request.Form["SPAppToken"]; - string refreshToken = Request.Form["RefreshToken"]; - string clientUrl = Request.Form["ClientUrl"]; - string folderName = Request.Form["FolderName"]; - string documentLibraryName = Request.Form["DocumentLibraryName"]; - string originalName = string.Empty; - bool allowContentCheck = Convert.ToBoolean(Request.Form["AllowContentCheck"], CultureInfo.InvariantCulture); - bool continueUpload = true; - Int16 isOverwrite = 3; - IList listResponse = new List(); - string response = string.Empty; - bool environment = Convert.ToBoolean(UIConstantStrings.IsDeployedOnAzure, CultureInfo.InvariantCulture); - try - { - if (!environment || ((!string.IsNullOrWhiteSpace(sharePointAppToken) || !string.IsNullOrWhiteSpace(refreshToken)) && !string.IsNullOrWhiteSpace(clientUrl) && !string.IsNullOrWhiteSpace(folderName))) - { - for (int fileCounter = 0; fileCounter < fileCollection.Count; fileCounter++) - { - if (!Int16.TryParse(Request.Form["Overwrite" + fileCounter], out isOverwrite)) - { - isOverwrite = 3; - } - HttpPostedFile upload = fileCollection[fileCounter]; - //// Added condition to check if upload.FileName returns the complete path or just the file name - string fileName = originalName = upload.FileName; - ContentCheckDetails contentCheck = new ContentCheckDetails(upload.FileName, upload.InputStream.Length); - string fileExtension = System.IO.Path.GetExtension(upload.FileName).Trim(); - continueUpload = true; - if (-1 < fileName.IndexOf('\\')) - { - fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1); - } - else if (-1 < fileName.IndexOf('/')) - { - fileName = fileName.Substring(fileName.LastIndexOf('/') + 1); - } - if (null != upload.InputStream && 0 == upload.InputStream.Length) - { - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.ErrorEmptyFile, ConstantStrings.DOLLAR, fileName)); - } - else - { - if (regEx.IsMatch(fileName)) - { - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", UIConstantStrings.ErrorInvalidCharacter, ConstantStrings.DOLLAR, fileName)); - } - else - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(sharePointAppToken, new Uri(clientUrl), refreshToken, Request)) - { - string folder = folderName.Substring(folderName.LastIndexOf(ConstantStrings.ForwardSlash, StringComparison.OrdinalIgnoreCase) + 1); - if (2 == isOverwrite) //If User presses "Perform content check" option in overwrite Popup - { - continueUpload = false; - response = PerformContentCheck(folderName, listResponse, response, upload, clientContext); - } - else if (3 == isOverwrite) //If user presses "Cancel upload" option in overwrite popup or file is being uploaded for the first time - { - continueUpload = CheckDuplicateDocument(clientContext, folderName, documentLibraryName, listResponse, fileName, contentCheck, allowContentCheck); - } - else if (1 == isOverwrite) //If User presses "Append date to file name and save" option in overwrite Popup - { - string fileNameWithoutExt = System.IO.Path.GetFileNameWithoutExtension(fileName); - string timeStampSuffix = DateTime.Now.ToString(UIConstantStrings.TimeStampFormat, CultureInfo.InvariantCulture).Replace(":", "_"); - fileName = fileNameWithoutExt + "_" + timeStampSuffix + fileExtension; - } - if (continueUpload) - { - listResponse = SetDocumentProperties(request, refreshToken, upload, fileExtension, originalName, listResponse, folderName, fileName, clientContext, folder, documentLibraryName); - } - } - } - } - } - foreach (var item in listResponse) - { - response += string.Concat(item, ConstantStrings.DOLLAR, ConstantStrings.Pipe, ConstantStrings.DOLLAR); - } - } - else - { - response = UIConstantStrings.MessageNoInputs; - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - response = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", exception.Message, ConstantStrings.DOLLAR, documentLibraryName); - } - return response; - } - - /// - /// Continue the upload functionality with setting of properties - /// - /// Current Http request object - /// Refresh token - /// Flag to determine on-line or on-premise deployment - /// Object for current file - /// Extension of current file - /// Original name of the file - /// List of responses - /// Path of the folder - /// Name of the file - /// SP client context - /// Name of the folder - /// Name of the document library - /// list of all the responses being sent - private static IList SetDocumentProperties(HttpRequest request, string refreshToken, HttpPostedFile upload, string fileExtension, string originalName, IList listResponse, string folderName, string fileName, ClientContext clientContext, string folder, string documentLibraryName) - { - Dictionary mailProperties = ContinueUpload(request, refreshToken, upload, fileExtension); - //setting original name property for attachment - if (string.IsNullOrWhiteSpace(mailProperties[ConstantStrings.MailOriginalName])) - { - mailProperties[ConstantStrings.MailOriginalName] = originalName; - } - return listResponse = listResponse.Concat(UploadDocument(folderName, upload, fileName, mailProperties, clientContext, folder, documentLibraryName)).ToList(); - } - - /// - /// checks for duplicate document to upload - /// - /// Path of the folder - /// Name of the document library - /// List of responses - /// Name of the file. - /// Content check object - /// SP client context - /// Name of the folder - /// true if duplicate document found - private static bool CheckDuplicateDocument(ClientContext clientContext, string folderName, string documentLibraryName, IList listResponse, string fileName, ContentCheckDetails contentCheck, bool allowContentCheck) - { - bool continueUpload = true; - DuplicateDocument duplicateDocument = ServiceUtility.DocumentExists(clientContext, contentCheck, documentLibraryName, folderName, false); - if (duplicateDocument.DocumentExists) - { - continueUpload = false; - string documentPath = string.Concat(UIConstantStrings.SiteURL, folderName, ConstantStrings.ForwardSlash, fileName); - string duplicateMessage = (allowContentCheck && duplicateDocument.HasPotentialDuplicate) ? ConstantStrings.FilePotentialDuplicateMessage : ConstantStrings.FileAlreadyExistMessage; - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", string.Format(CultureInfo.InvariantCulture, duplicateMessage, fileName, documentPath), ConstantStrings.SymbolAt, Convert.ToString(duplicateDocument.HasPotentialDuplicate, CultureInfo.InvariantCulture))); - } - return continueUpload; - } - - /// - /// Performs content check on stream level - /// - /// Path of the folder - /// List of responses - /// Response object - /// HttpPostedFile object - /// SP client context - /// result string of content check operation - private static string PerformContentCheck(string folderName, IList listResponse, string response, HttpPostedFile upload, ClientContext clientContext) - { - using (MemoryStream targetStream = new MemoryStream()) - { - Stream sourceStream = upload.InputStream; - try - { - byte[] buffer = new byte[sourceStream.Length + 1]; - int read = 0; - while ((read = sourceStream.Read(buffer, 0, buffer.Length)) > 0) - { - targetStream.Write(buffer, 0, read); - } - string serverFileUrl = folderName + ConstantStrings.ForwardSlash + upload.FileName; - if (ServiceUtility.PerformContentCheck(clientContext, targetStream, serverFileUrl)) - { - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.FoundIdenticalContent, ConstantStrings.Pipe, ConstantStrings.TRUE)); - } - else - { - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.FoundNonIdenticalContent, ConstantStrings.Pipe, ConstantStrings.FALSE)); - } - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - response = string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", ConstantStrings.ContentCheckFailed, ConstantStrings.Pipe, ConstantStrings.TRUE); - } - finally - { - sourceStream.Dispose(); - } - } - return response; - } - - /// - /// Method to be called if Overwrite flag is true - /// - /// Web request object - /// The refresh token for Client Context - /// Flag to determine if deployed on Azure - /// File parameters - /// Name of the file to be uploaded - /// Extension of the file being uploaded - /// Dictionary object having the key-value pair or mail properties - private static Dictionary ContinueUpload(HttpRequest request, string refreshToken, HttpPostedFile upload, string fileExtension) - { - Dictionary mailProperties = new Dictionary - { - { ConstantStrings.MailSenderKey, string.Empty }, - { ConstantStrings.MailReceiverKey, string.Empty }, - { ConstantStrings.MailReceivedDateKey, string.Empty }, - { ConstantStrings.MailCCAddressKey, string.Empty }, - { ConstantStrings.MailAttachmentKey, string.Empty }, - { ConstantStrings.MailSearchEmailSubject, string.Empty }, - { ConstantStrings.MailSearchEmailFromMailboxKey, string.Empty }, - { ConstantStrings.MailFileExtensionKey, fileExtension }, - { ConstantStrings.MailImportanceKey, string.Empty}, - { ConstantStrings.MailConversationIdKey, string.Empty}, - { ConstantStrings.MailConversationTopicKey, string.Empty}, - { ConstantStrings.MailSentDateKey, string.Empty}, - { ConstantStrings.MailHasAttachmentsKey, string.Empty}, - { ConstantStrings.MailSensitivityKey, string.Empty }, - { ConstantStrings.MailCategoriesKey, string.Empty }, - { ConstantStrings.MailOriginalName, string.Empty} - }; - if (string.Equals(fileExtension, ConstantStrings.EmailFileExtension, StringComparison.OrdinalIgnoreCase)) - { - using (ClientContext clientContext = ServiceUtility.GetClientContext(null, new Uri(UIConstantStrings.CentralRepository), refreshToken, request)) - { - Users currentUserDetail = UIUtility.GetLoggedInUserDetails(clientContext); - mailProperties[ConstantStrings.MailSearchEmailFromMailboxKey] = currentUserDetail.Name; - Stream fileStream = upload.InputStream; - mailProperties = MailMessageParser.GetMailFileProperties(fileStream, mailProperties); // Reading properties only for .eml file - } - } - return mailProperties; - } - - /// - /// Uploads document to SharePoint Library. - /// - /// Relative path of folder - /// File parameters - /// Name of the file being uploaded - /// Dictionary object having the key-value pair or mail properties - /// Client context object for SharePoint - /// Target folder for the upload operation - /// Name of the document library no which upload operation is being performed - /// - /// list of all the responses being sent - /// - internal static IList UploadDocument(string folderPath, HttpPostedFile upload, string fileName, Dictionary mailProperties, ClientContext clientContext, string folderName, string documentLibraryName) - { - IList listResponse = new List(); - bool isUploadSuccessful = false; - try - { - Web web = clientContext.Web; - var uploadFile = new FileCreationInformation(); - using (var stream = upload.InputStream) - { - stream.Seek(0, SeekOrigin.Begin); - uploadFile.ContentStream = stream; - uploadFile.Url = fileName; - uploadFile.Overwrite = true; - using (clientContext) - { - isUploadSuccessful = DocumentUpload(folderPath, listResponse, clientContext, documentLibraryName, web, folderName, uploadFile); - } - } - if (isUploadSuccessful) - { - ServiceUtility.SetUploadItemProperties(clientContext, web, documentLibraryName, fileName, folderPath, mailProperties); - } - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", fileName, ConstantStrings.COLON, folderName)); - } - catch (Exception exception) - { - Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", exception.Message, ConstantStrings.DOLLAR, documentLibraryName)); - } - return listResponse; - } - - /// - /// Upload helper function for uploading documents to SharePoint library. - /// - /// Folder path of Document Library - /// SharePoint list response - /// Client context object for connection between SP & client - /// Name of document library in which upload is to be done - /// Object of site - /// Target folder name where file needs to be uploaded. - /// Object having file creation information - /// It returns true if upload is successful else false - private static bool DocumentUpload(string folderPath, IList listResponse, ClientContext clientContext, string documentLibraryName, Web web, string folderName, FileCreationInformation uploadFile) - { - bool isUploadSuccessful = false; - using (clientContext) - { - if (UIUtility.FolderExists(folderPath, clientContext, documentLibraryName)) - { - Folder destionationFolder = clientContext.Web.GetFolderByServerRelativeUrl(folderPath); - clientContext.Load(destionationFolder); - clientContext.ExecuteQuery(); - Microsoft.SharePoint.Client.File fileToUpload = destionationFolder.Files.Add(uploadFile); - destionationFolder.Update(); - web.Update(); - clientContext.Load(fileToUpload); - clientContext.ExecuteQuery(); - isUploadSuccessful = true; - } - else - { - listResponse.Add(string.Format(CultureInfo.InvariantCulture, "{0}{1}{1}{1}{2}", - string.Format(CultureInfo.InvariantCulture, ConstantStrings.FolderStructureModified, folderName), - ConstantStrings.DOLLAR, folderName)); - } - } - return isUploadSuccessful; - } - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.designer.cs deleted file mode 100644 index dfab7f32..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/UploadFile.aspx.designer.cs +++ /dev/null @@ -1,14 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - public partial class UploadFile { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx deleted file mode 100644 index 2f01872d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx +++ /dev/null @@ -1,207 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage/MatterCenterMaster.Master" CodeBehind="WebDashboard.aspx.cs" Inherits="Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages.WebDashboard" %> - - - Matter Center Beta Web Dashboard - - - - - - - - - -
-
- - Matter Center - -
-
-
-
-
-
-
-
-
-
- Close -
-
-
-
- -
Send to My OneDrive for Business
-
-
-
Email as attachment
-
-
-
Email as link
-
-
-
-
-
-
- -
-
-
    -
-
- Loading... -
-
-
-
-
-
-
- -
-
-
- Close -
-
-
- -
-
-
-
- info -
- You can also drag and drop files from your desktop. -
-
-
-
- - -
-
-
- My matters - (0) -
-
- All matters - (0) -
- -
- Pinned matters - (0) -
- - -
-
-
-
- My documents - (0) -
-
- All documents - (0) -
-
- Pinned documents - (0) -
-
-
-
-
-
-
- -
-
-
-
- - - Mail Cart - -   - (0) - - -
-
-
Sort by:
- - Sort By -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.cs deleted file mode 100644 index 5dacd04f..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.cs +++ /dev/null @@ -1,70 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-shpate -// Created : 14-03-2015 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// This file contains code behind of WebDashboard.aspx page. -// *********************************************************************** -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - #region using - using Microsoft.Legal.MatterCenter.Utility; - using System; - using System.Reflection; - #endregion - - /// - /// Provides web dashboard functionalities. - /// - public partial class WebDashboard : System.Web.UI.Page - { - /// - /// Handles the Load event of the Page control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Page_Load(object sender, EventArgs e) - { - try - { - string redirectURL = this.GetRedirectURL(); - GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForWebDashboard, ConstantStrings.ConstantFileForWebDashboard); - } - catch (Exception exception) - { - string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response)); - } - } - - /// - /// Gets the redirect URL. - /// - /// - /// redirect URL - /// - private string GetRedirectURL() - { - string redirectURL = string.Empty; - string result = string.Empty; - try - { - redirectURL = string.Concat(UIConstantStrings.AppRedirectURL, ConstantStrings.QUESTION, ConstantStrings.ClientId, ConstantStrings.OperatorEqual, UIConstantStrings.ClientID, ConstantStrings.OperatorAmpersand, ConstantStrings.RedirectUrl, ConstantStrings.OperatorEqual, Request.Url.AbsoluteUri.Replace(ConstantStrings.HTTP + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash, ConstantStrings.HTTPS + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash), ConstantStrings.QUESTION, ConstantStrings.StandardToken); - if (!string.IsNullOrWhiteSpace(Request.Url.Query) && !Request.Url.Query.ToUpperInvariant().Contains("?SECTION=")) // Not to clear query string if Section is present - { - redirectURL = string.Concat(UIConstantStrings.AppRedirectURL, ConstantStrings.QUESTION, ConstantStrings.ClientId, ConstantStrings.OperatorEqual, UIConstantStrings.ClientID, ConstantStrings.OperatorAmpersand, ConstantStrings.RedirectUrl, ConstantStrings.OperatorEqual, Request.Url.AbsoluteUri.Replace(ConstantStrings.HTTP + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash, ConstantStrings.HTTPS + ConstantStrings.COLON + ConstantStrings.ForwardSlash + ConstantStrings.ForwardSlash).Replace(Request.Url.Query, string.Empty), ConstantStrings.QUESTION, ConstantStrings.StandardToken); - } - result = redirectURL; - } - catch (Exception exception) - { - result = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName); - } - return result; - } - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.designer.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.designer.cs deleted file mode 100644 index 0a21ac74..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Pages/WebDashboard.aspx.designer.cs +++ /dev/null @@ -1,14 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Legal.MatterCenter.SharePointAppWeb.Pages -{ - public partial class WebDashboard { - } -} diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/AssemblyInfo.cs b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/AssemblyInfo.cs deleted file mode 100644 index a4343f96..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,50 +0,0 @@ -// *********************************************************************** -// Assembly : Microsoft.Legal.MatterCenter.SharePointAppWeb -// Author : v-akdigh -// Created : 05-16-2014 -// -// *********************************************************************** -// -// Copyright (c) . All rights reserved. -// -// -// *********************************************************************** -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.Legal.MatterCenter.SharePointAppWeb")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.Legal.MatterCenter.SharePointAppWeb")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("997ea775-693b-46fe-8706-4c3664698b4c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("")] \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/PU.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/PU.pubxml deleted file mode 100644 index 8b90e8f0..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/PU.pubxml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - FileSystem - Release - Any CPU - - True - False - D:\Projects\Matter Center\Main\Microsoft.Legal.MatterCenter\Deployment\Web Publish - True - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - FTP.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - FTP.pubxml deleted file mode 100644 index 4f758796..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - FTP.pubxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - FTP - Release - Any CPU - http://matteruatsite.azurewebsites.net - True - False - ftp://waws-prod-bay-015.ftp.azurewebsites.windows.net - False - True - site/wwwroot - matteruatsite\$matteruatsite - <_SavePWD>True - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - Web Deploy.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - Web Deploy.pubxml deleted file mode 100644 index 71eb6b6f..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite - Web Deploy.pubxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MSDeploy - Release - Any CPU - http://matteruatsite.azurewebsites.net - True - False - matteruatsite.scm.azurewebsites.net:443 - matteruatsite - - False - WMSVC - False - $matteruatsite - <_SavePWD>True - <_DestinationType>AzureWebSite - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite.pubxml deleted file mode 100644 index 4eb5a549..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/matteruatsite.pubxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MSDeploy - Release - Any CPU - http://matteruatsite.azurewebsites.net - True - False - matteruatsite.scm.azurewebsites.net:443 - matteruatsite - - False - WMSVC - True - $matteruatsite - <_SavePWD>True - <_DestinationType>AzureWebSite - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/sunnysite.pubxml b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/sunnysite.pubxml deleted file mode 100644 index d8a28a2d..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Properties/PublishProfiles/sunnysite.pubxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MSDeploy - Release - Any CPU - http://sunnysite.azurewebsites.net - True - False - sunnysite.scm.azurewebsites.net:443 - sunnysite - - True - WMSVC - False - $sunnysite - <_SavePWD>True - <_DestinationType>AzureWebSite - - \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/AdvancedSearch.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/AdvancedSearch.js deleted file mode 100644 index 36bc1ff8..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/AdvancedSearch.js +++ /dev/null @@ -1,958 +0,0 @@ -/// JS3057,JS3058,JS2074,JS2076,JS3092,JS3054,JS2005,JS3056,JS2073,JS2024,JS2026,JS2032,JS2064,JS3116 - -var oGridConfig = - { - itemsPerPage: oWebDashboardConstants.ItemsPerPage, - nGridPageNumber: 1, - nPinnedGridPageNumber: 1, - nGridTotalResults: 0, - nPinnedGridTotalResults: 0, - nCheckedRowCount: 0, - isMatterView: true, - isTileView: false, - isMatterViewLoaded: false, - isPinnedViewLoaded: false, - arrGridData: [], - arrRecentData: [], - arrSelectedGridData: [], - arrPinnedData: [], - arrPinnedTemp: [], - arrUnpinnedTemp: [], - arrCheckedOutDoc: [], - currentView: 0, // 0: SearchResults, 1: PinnedView, 2: RecentView - inWebDashboard: true, - prevBrowserWidth: 0, - bLoadPinnedData: false, - nGridWidth: 0, - nCurrentGridWidth: 0, - nPreviousGridWidth: 0, - nWidthDiff: 30, - nAllMatterCount: 0, - nAllDocumentCount: 0, - bPageLoad: false, - sSection: "?section=" - }; - -var oSearchGlobal = { - siteURL: oGlobalConstants.Central_Repository_Url, - serviceDMSURL: oGlobalConstants.Search_Service_Url, - refinerHTMLTemplate: "
", - selectAllNone: "", - noRecordRow: "
No records found
", - refinerOkButton: "
Ok
", - refinerClientOkButton: "
Ok
", - refinerCancelButton: "
Cancel
", - regularRefiner: new RegExp("#RefinerValue#", "g"), - regularRefinerType: new RegExp("#SearchType#", "g"), - regularNoRefinerRow: new RegExp("#noRefinerVisible#", "g"), - regularRefinerCount: new RegExp("#CountValue#", "g"), - regularRefinerClientURL: new RegExp("#RefinerClientURL#", "g"), - searchOption: 1, - oDataArray: [], - oFileArray: [], - oUpload: [], - sClientName: "", - sClientSiteUrl: "", - bIsTenantCall: false, - pinnedMatterDataPassed: [], - pinnedDocumentDataPassed: [] -}; - -function closeAllPopupExcept(divClass, event) { - "use strict"; - switch (divClass) { - case "matterPopup": - $(".filterPanel").hide(); - break; - case "matterFolderWindow": $(".matterPopup").hide(); - $(".matterPopup .matterPopupData").find(":nth-child(10), :nth-child(11)").addClass("hide"); - $(".filterPanel").hide(); - break; - case "filterPanel": $(".matterPopup").hide(); - $(".matterPopup .matterPopupData").find(":nth-child(10), :nth-child(11)").addClass("hide"); - break; - default: break; - } - if (divClass !== "filterSearchAdvance" && divClass !== "refinerClient" && divClass !== "refinerPG" && divClass !== "refinerAOL" && divClass !== "ui-datepicker" && (event && event.target && event.target.className !== "ui-corner-all")) { - $(".filterSearchAdvance").hide(); - } - if ("sdBannerPanelItem" !== divClass && "sdBannerPanel" !== divClass && "sdBannerDD" !== divClass && "sdBannerText" !== divClass && "sdBannerDropdown" !== divClass) { - $(".sdBannerPanel").addClass("hide"); - } - if (divClass !== "refinerClient") { - $(".refinerClient").hide(); - } - if ("filterAutoComplete" !== divClass) { - $(".filterAutoComplete").addClass("hide"); - } - if ("switchApp" !== divClass) { - $(".switchApp").hide(); - } - if ("navDiv" !== divClass) { - $(".switchTab").css("display", "none"); - } - if ("quickLinksMenuItems" !== divClass) { - $(".quickLinksMenuItems").css("display", "none"); - } - - if (event && "undefined" !== typeof event.stopPropagation) { - divClass && event && event.stopPropagation(); - } -} - -commonFunction.onClientSuccess = function (refiners) { - "use strict"; - var refinerClientHTML = "
"; - var oClients = JSON.parse(refiners); - if (!oClients.code) { - var clientsList = oClients.ClientTerms; - - $.each(clientsList, function (iIterator, oClient) { - refinerClientHTML = refinerClientHTML + oSearchGlobal.refinerHTMLTemplate.replace(oSearchGlobal.regularRefiner, oClient.Name).replace(oSearchGlobal.regularRefinerClientURL, oClient.Url); - if ("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl && oSearchGlobal.sClientSiteUrl.toLowerCase() === oClient.Url.toLowerCase()) { - $(".refinerClientsText").attr({ "value": oClient.Name, "data-totalcount": 1, "data-selectedcount": 1, "disabled": "disabled" }); - $(".refinerClientDD").unbind("click").attr("disabled", "disabled"); - } - }); - if (refinerClientHTML) { - refinerClientHTML = oSearchGlobal.selectAllNone + refinerClientHTML + "
" + oSearchGlobal.noRecordRow.replace(oSearchGlobal.regularNoRefinerRow, "") + oSearchGlobal.refinerClientOkButton.replace(oSearchGlobal.regularRefinerType, "Clients") + oSearchGlobal.refinerCancelButton; - } else { - refinerClientHTML = oSearchGlobal.noRecordRow.replace(oSearchGlobal.regularNoRefinerRow, " noRefinersVisible"); - - } - $(".refinerClient").html(refinerClientHTML); - $(".refinerClientsText").attr("data-totalcount", $(".filterSearchClients input[type='checkbox']").length); - $(".refinerClientsText").attr("data-selectedcount", 0); - } else { - showCommonErrorPopUp(oClients.code); - } -}; - -commonFunction.refinerClientOkClick = function (refinerId) { - "use strict"; - var sSelectedText = "", sSelectedTextVal = ""; - $(refinerId + " .filterSearchRefinerText").attr("data-selectedcount", $(refinerId + " input:checked").length); - $(refinerId + " input:checked").each(function () { - if (sSelectedTextVal) { - sSelectedText = sSelectedText + "$|$" + $(this).val(); - sSelectedTextVal = sSelectedTextVal + ", " + $(this).val(); //// Applied the fix for proper separator - } else { - sSelectedText = $(this).val(); - sSelectedTextVal = $(this).val(); - } - }); - $(refinerId + " .filterSearchRefinerText").attr("data-selected", sSelectedText); - $(refinerId + " .filterSearchRefinerText").val(sSelectedTextVal); - commonFunction.closeAllFilterExcept("filterSearchAdvance"); -}; - -function setRelevantIcon(event) { - "use strict"; - // Check the item in the pinned item list and check whether this item is present in the results list. - // For this we compare the document's path/ URL to ensure the documents are the same. - // If yes, set the items icon to unpin. - // If no, set the items icon to pin. - if (oGridConfig.arrPinnedData && oGridConfig.arrGridData) { - var nPinnedCount = 0, nPinnedLength = oGridConfig.arrPinnedData.length, nCount = 0, nLength = oGridConfig.arrGridData.length, sPathPropertyName, oPinnedItem, - oGridContainer = 2 === oGridConfig.currentView ? oGridConfig.isMatterView ? "recentMatters" : "RecentDocumentContainer" : "grid"; - // Handle 0 scenario - if (nPinnedLength === 0) { - for (nCount = nLength - 1; nCount >= 0; nCount--) { - sPathPropertyName = oGridConfig.isMatterView ? "MatterUrl" : "DocumentUrl"; - oPinnedItem = $("#" + oGridContainer + " img[data-rowindex=" + nCount + "]"); - if (oPinnedItem[0]) { - oPinnedItem.attr("src", "../Images/pin-666.png"); - oPinnedItem.attr("onclick", "pinElement(" + nCount + ", this, event)"); - oPinnedItem.attr("title", "pin"); - oPinnedItem.attr("alt", ""); - oPinnedItem.removeAttr("class"); - oPinnedItem.addClass("pinIcon"); - } - } - } else { - for (nPinnedCount = nPinnedLength - 1; nPinnedCount >= 0; nPinnedCount--) { - for (nCount = nLength - 1; nCount >= 0; nCount--) { - sPathPropertyName = oGridConfig.isMatterView ? "MatterUrl" : "DocumentUrl"; - var sCurrentPath = "", sDataItem = oGridConfig.arrGridData[nCount]; - if (sDataItem && sDataItem.Path) { - if (oGridConfig.isMatterView) { - sCurrentPath = sDataItem.Path.toLowerCase(); - } else { - sCurrentPath = decodeURIComponent(trimEndChar($.trim(sDataItem.Path), "/").toLowerCase()); - } - } - oPinnedItem = $("#" + oGridContainer + " img[data-rowindex=" + nCount + "]"); - if (oGridConfig.arrPinnedData[nPinnedCount][sPathPropertyName] && oGridConfig.arrPinnedData[nPinnedCount][sPathPropertyName].toLowerCase() === sCurrentPath) { - if (oPinnedItem[0]) { - oPinnedItem.attr("src", "../Images/unpin-666.png"); - oPinnedItem.attr("onclick", "unPinElement('',this," + nPinnedCount + ", event)"); - oPinnedItem.attr("title", "unpin"); - oPinnedItem.attr("alt", ""); - oPinnedItem.removeAttr("class"); - oPinnedItem.addClass("unPinIcon"); - } - } else if (oPinnedItem.attr("class") === "pinIcon" || oPinnedItem.attr("class") === "pinnedLoading floatContentLeft") { - oPinnedItem.attr("src", "../Images/pin-666.png"); - oPinnedItem.attr("onclick", "pinElement(" + nCount + ", this, event)"); - oPinnedItem.attr("title", "pin"); - oPinnedItem.attr("alt", ""); - oPinnedItem.removeAttr("class"); - oPinnedItem.addClass("pinIcon"); - } - } - } - } - } -} - -function beforeAdvanceSearch() { - "use strict"; - // Hide the Pinned Matter grid and hide recent matter grid - $("#pinnedGrid, #RecentDocumentContainer, #recentMatters").hide(); - // show the All Results Grid - $("#grid").show(); - // Remove the previous Active tab - $(".active").removeClass("active"); - // Set the Active Tab - $("#DisplayFindMattersResults .allSearch").addClass("active"); - $("#DisplaySearchDocumentsResults .allSearch").addClass("active"); - // Show Loading Image - var sGridName = oGridConfig.isMatterView ? "Matters" : "Documents"; - $("#grid").html("

\"Loading...\"

Please wait while the " + sGridName + " load.

"); -} - -function onSearchSuccess(oFinalResult, event) { - "use strict"; - var nCurrentBrowserWidth = getWidth(); - if ($(".allSearch").hasClass("active")) { - $(".allSearch").show(); - if (850 >= nCurrentBrowserWidth) { - $(".mySearch, .pinnedSearch").not(".active").hide(); - } - } else { - $(".mySearch").show(); - if (850 >= nCurrentBrowserWidth) { - $(".allSearch, .pinnedSearch").not(".active").hide(); - } - } - $(".filterAutoComplete").addClass("hide"); - if (oFinalResult && oFinalResult.Result && (-1 !== oFinalResult.Result.indexOf("$|$") || "undefined" !== typeof oFinalResult.Result.split("$|$"))) { - var arrResultParts = oFinalResult.Result.split("$|$"), - oResultData = {}, - nCountData = {}, - oRefinementData = {}, - arrColumnNames = [], arrGridHeaders = [], sAltRowColorValue = "rgb(255, 255, 255)", sCountHeaderID = "", sColumnID = ""; - oGridConfig.nCheckedRowCount = 0; - oSearchGlobal.oUpload = []; - if (arrResultParts[0]) { - // Replacing any occurrence of \\\" with blank string, as encoding will convert \" to "e; and decoding the same will return " only this will break JSON.parse, thus ensuring JSON.parse will not break in such scenario - oResultData = JSON.parse(arrResultParts[0].replace(new RegExp('\\\\\\"', "g"), "")); // Result Data - } - if (arrResultParts[1]) { - nCountData = JSON.parse(arrResultParts[1]); // Count Data - oGridConfig.nGridTotalResults = nCountData; - } - if (arrResultParts[2]) { - oRefinementData = JSON.parse(arrResultParts[2]); // Filter Data - } - var nCount = 0, nLength = oResultData.length, arrResults = []; - if (nLength && 0 < nLength && 0 < nCountData) { - oGridConfig.isMatterViewLoaded = true; - oGridConfig.bLoadPinnedData = false; - oGridConfig.arrGridData = oResultData; - for (nCount = 0; nCount < nLength; nCount++) { - // for upload functionality - if (oResultData[nCount] && oResultData[nCount].IsReadOnlyUser) { - if (oGridConfig.isMatterView) { - oSearchGlobal.oUpload.push(""); - } else if (oGridConfig.isTileView) { - oSearchGlobal.oUpload.push(""); - } - } else { - if (oGridConfig.isMatterView) { - oSearchGlobal.oUpload.push(""); - } else if (oGridConfig.isTileView) { - oSearchGlobal.oUpload.push(""); - } - } - } - - var arrColumnJSON = oGrid.generateGridViewJSON(); - var arrHeaders = (oCommonObject.isMatterView) ? oWebDashboardConstants.MatterHeaderName.split(";") : oWebDashboardConstants.DocumentHeaderName.split(";"); - itemsCountsToBeDisplayed(); - var GridConfig = { - container: oFinalResult.oParam.container, - data: oResultData, - gridName: "Search Result", - gridHeader: arrHeaders, - columnNames: arrColumnJSON, - sortby: "", - sortorder: "", - sortType: String, - initialsortorder: "", - retainpageonsort: false, - maxRows: oGridConfig.itemsPerPage, - viewrecords: true, - pagination: true, - altRowColor: sAltRowColorValue, - cellSpacing: 0 - }; - // Update the specific result count - sCountHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults"; - if ("RecentDocumentContainer" === GridConfig.container || "recentMatters" === GridConfig.container) { - sColumnID = "mySearch"; - oGridConfig.arrRecentData = oGridConfig.arrGridData; - } else { - sColumnID = "allSearch"; - } - var oMatterCount = $("#" + sCountHeaderID + " ." + sColumnID + " .ResultNumbers"); - if (oMatterCount[0]) { - oMatterCount.html(" (" + oGridConfig.nGridTotalResults + ")"); - } - - $("#" + oFinalResult.oParam.container).html("
"); - // Set the Pin or unpin icon - new oGrid.JsonGrid(GridConfig); - if ($(".pinnedSearch").hasClass("active")) { - oGridConfig.currentView = 1; - } else if ($(".mySearch").hasClass("active")) { - oGridConfig.currentView = 2; - } else { - oGridConfig.currentView = 0; - } - if (oGridConfig.bPageLoad) { - (getGridViewWidth) ? getGridViewWidth() : ""; - } - if ("allSearch" === sColumnID) { - (oGridConfig.bPageLoad) ? oGridConfig.isMatterView ? oGridConfig.nAllMatterCount = oGridConfig.nGridTotalResults : oGridConfig.nAllDocumentCount = oGridConfig.nGridTotalResults : ""; - (getGridViewWidth) ? getGridViewWidth() : ""; - } - var sSelectedTab = getCurrentSelectedTab(); - $(sSelectedTab).css("maxWidth", oGridConfig.nGridWidth); - $(sSelectedTab).css("width", 0); - if (oGridConfig.isMatterViewLoaded && oGridConfig.isPinnedViewLoaded) { - setRelevantIcon(event); - } - } else { - oGridConfig.arrGridData.length = 0; - sCountHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults" - , sColumnID = ""; - if ("RecentDocumentContainer" === oFinalResult.oParam.container || "recentMatters" === oFinalResult.oParam.container) { - sColumnID = "mySearch"; - } else { - sColumnID = "allSearch"; - } - if (0 === nLength || 0 === nCountData) { - gridFailure(oFinalResult, oWebDashboardConstants.NoResults_Message, "." + sColumnID); - } else { - var oErrorPopUpData = JSON.parse(oFinalResult.Result); - showCommonErrorPopUp(oErrorPopUpData.code); - } - } - $("#grid .uploadImg").attr("style", ""); - } else { - oGridConfig.arrGridData.length = 0; - showCommonErrorPopUp(oResult); - }; - createResponsiveGrid(); -} - -function onSearchFailure(oFinalResult) { - "use strict"; - showCommonErrorPopUp(oFinalResult); -} - -function gridFailure(oResult, sMessage, sColumnHeaderToUpdate) { - "use strict"; - var oContainer = $("#" + oResult.oParam.container), sCountHeaderID = ""; - if (oContainer[0]) { - oContainer.html("
" + sMessage + "
"); - } - // Update the count to 0 - sCountHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults"; - var oMatterCount = $("#" + sCountHeaderID + " " + sColumnHeaderToUpdate + " .ResultNumbers"); - if (oMatterCount[0]) { - oMatterCount.html(" (0)"); - } -} - -function advancedSearch(sContainer, event) { - "use strict"; - var sMethodName = oGridConfig.isMatterView ? "FindMatter" : "FindDocument"; - oGridConfig.isMatterView ? $(".filterSearchText").attr({ "placeholder": "Search by matter name, matter ID, or keyword", "title": "Search by matter name, matter ID, or keyword" }) : $(".filterSearchText").attr({ "placeholder": "Search by document name, document ID, or keyword", "title": "Search by document name, document ID, or keyword" }); - var sRefinerString = oGridConfig.isMatterView ? oGlobalConstants.Matter_ID : oGlobalConstants.Document_ID; - oGridConfig.currentView = "RecentDocumentContainer" === sContainer || "recentMatters" === sContainer ? 2 : 0; - oSearchGlobal.clientDataLoaded = true; - var sDeployUrl = oGlobalConstants.Central_Repository_Url; - oCommonObject.isMatterView = oGridConfig.isMatterView; - oSearchGlobal.searchOption = 0; - if (1 === oGridConfig.nGridPageNumber && !oCommonObject.bCalledForSort) { - oCommonObject.sSearchedKeyword = $(".filterSearchText").val().trim(); - var FilterDetails = oSearchGlobal.oFilterData = oCommonObject.getSearchData(event); - if ("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) { - if ("" === FilterDetails.ClientsList[0]) { - FilterDetails.ClientsList = []; - } - FilterDetails.ClientsList.push(oSearchGlobal.sClientSiteUrl); - } - oCommonObject.sFilterDetails = FilterDetails; - } - oCommonObject.bCalledForSort = false; - var sSearchTerm = oSearchGlobal.sSearchTerm = oCommonObject.sSearchedKeyword !== "" ? oCommonObject.formatSearchText(oCommonObject.sSearchedKeyword, sRefinerString) : ""; - var SortDetails = getSortData(); - itemsCountsToBeDisplayed(); - var SearchDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sDeployUrl }, "searchObject": { "PageNumber": oGridConfig.nGridPageNumber, "ItemsPerPage": oGridConfig.itemsPerPage, "SearchTerm": sSearchTerm, "Filters": oCommonObject.sFilterDetails, "Sort": SortDetails } }; - var oParam = { "container": "grid", "isPage": 1, "pageNumber": 1 }; - oCommonObject.callSearchService(sMethodName, SearchDetails, onSearchSuccess, onSearchFailure, beforeAdvanceSearch, oParam); - commonFunction.closeAllFilterExcept("", event); - return false; -} - -function requestPinnedMatter(container) { - "use strict"; - var pinnedMatterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url } }; - var oParam = { "container": container }; - oCommonObject.callSearchService("FindUserPinnedMatter", pinnedMatterDetails, onPinnedItemSuccess, onPinnedItemFailure, pinnedMatterBeforeSend, oParam); -} - -function requestPinnedDocument(container) { - "use strict"; - var pinnedMatterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url } }; - var oParam = { "container": container }; - oCommonObject.callSearchService("FindUserPinnedDocument", pinnedMatterDetails, onPinnedItemSuccess, onPinnedItemFailure, pinnedMatterBeforeSend, oParam); -} - -function onPinnedItemSuccess(oFinalResult, event) { - "use strict"; - var sErrorPopUpDetails; - oGridConfig.bLoadPinnedData = true; - oGridConfig.isMatterView ? oSearchGlobal.pinnedMatterDataPassed = oFinalResult : oSearchGlobal.pinnedDocumentDataPassed = oFinalResult; - if (oFinalResult && oFinalResult.Result && (-1 !== oFinalResult.Result.indexOf("$|$") || "undefined" !== typeof oFinalResult.Result.split("$|$"))) { - var sImgShow = "", - sImgHide = "", - arrResultParts = oFinalResult.Result.split("$|$"), - oResultData = {}, - nCountData = {}, - arrClientPinnedData = [], - oRefinementData = {}, - sResultClientUrl = "", - arrColumnNames = [], arrGridHeaders = [], sAltRowColorValue = "rgb(255, 255, 255)", sCountHeaderID = ""; - oGridConfig.nCheckedRowCount = 0; - oSearchGlobal.oUpload = []; - if (arrResultParts[0]) { - oResultData = JSON.parse(arrResultParts[0]); // Result Data - } - if (arrResultParts[2]) { - oRefinementData = JSON.parse(arrResultParts[2]); // Filter Data - } - var nCount = 0, nLength = oResultData.length, arrResults = [], oTemp, arrHideUpload = []; - if (nLength > 0) { - oGridConfig.isPinnedViewLoaded = true; - nCountData = 0; - for (nCount = 0; nCount < nLength; nCount++) { - if (oResultData[nCount]) { - sResultClientUrl = oGridConfig.isMatterView ? oResultData[nCount].MatterClientUrl : oResultData[nCount].DocumentClientUrl; - sCountHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults"; - if (oSearchGlobal.sClientSiteUrl && sResultClientUrl && sResultClientUrl.toLowerCase() !== oSearchGlobal.sClientSiteUrl.toLowerCase()) { - continue; - } - ++nCountData; - arrClientPinnedData.push(oResultData[nCount]); - // For Upload security functionality - if (oResultData[nCount].HideUpload) { - if ("false" === oResultData[nCount].HideUpload.toLowerCase()) { - arrHideUpload.push(false); - } else { - arrHideUpload.push(true); - } - } - } - } - - // Update the specific result count - if ("" !== oSearchGlobal.sClientSiteUrl && "" !== oSearchGlobal.sClientName) { - oGridConfig.nPinnedGridTotalResults = nCountData; - oGridConfig.arrPinnedData = arrClientPinnedData; - } else if (arrResultParts[1]) { - oGridConfig.nPinnedGridTotalResults = JSON.parse(arrResultParts[1]); // Count Data - oGridConfig.arrPinnedData = oResultData; - } - var oMatterCount = $("#" + sCountHeaderID + " .pinnedSearch .ResultNumbers"); - if (oMatterCount[0]) { - oMatterCount.html(" (" + oGridConfig.nPinnedGridTotalResults + ")"); - } - - if (0 === nCountData) { - oGridConfig.arrPinnedData.length = 0; - gridFailure(oFinalResult, oWebDashboardConstants.NoResults_Message, ".pinnedSearch"); - return; - } - - if (oGridConfig.isTileView) { - arrColumnNames = [{ name: "Matter Name", width: 206, id: "Matter Name", align: "left", trimOnOverflow: false, formatter: "createTile" }]; - arrGridHeaders = [""]; - sAltRowColorValue = "rgb(255, 255, 255)"; - - } else { - var arrColumnJSON = oGrid.generateGridViewJSON(); - var arrHeaders = (oCommonObject.isMatterView) ? oWebDashboardConstants.MatterHeaderName.split(";") : oWebDashboardConstants.DocumentHeaderName.split(";"); - } - itemsCountsToBeDisplayed(); - var GridConfig = { - container: oFinalResult.oParam.container, - data: oGridConfig.arrPinnedData, - gridName: "Search Result", - gridHeader: arrHeaders, - columnNames: arrColumnJSON, - sortby: "", - sortorder: "", - sortType: String, - initialsortorder: "", - retainpageonsort: false, - maxRows: oGridConfig.itemsPerPage, - viewrecords: true, - pagination: true, - altRowColor: sAltRowColorValue, - cellSpacing: 0 - }; - $("#" + oFinalResult.oParam.container).html("
"); - var iPinnedLength = arrHideUpload.length; - for (var bHide in arrHideUpload) { - if (arrHideUpload[bHide]) { - oSearchGlobal.oUpload.push(sImgHide); - } else { - oSearchGlobal.oUpload.push(sImgShow); - } - } - - new oGrid.JsonGrid(GridConfig); - if ($(".pinnedSearch").hasClass("active")) { - oGridConfig.currentView = 1; - } else if ($(".mySearch").hasClass("active")) { - oGridConfig.currentView = 2; - } else { - oGridConfig.currentView = 0; - } - var sSelectedTab = getCurrentSelectedTab(); - var sSelectedValue = $(".sdBannerText").attr("data-value"); - if (!oGridConfig.isMatterView) { - // call sorting for all pinned result - if (sSelectedValue.length) { - sortPinDocument("pinnedGrid_Grid", sSelectedValue); - } - } else { - // call sorting for all pinned result - if (sSelectedValue.length) { - sortPinMatter("pinnedGrid_Grid", sSelectedValue); - } - } - if (1 === oGridConfig.currentView) { - getGridViewWidth(); - createResponsiveGrid(); - $(sSelectedTab).css("maxWidth", oGridConfig.nGridWidth); - $(sSelectedTab).css("width", 0); - } - // Set the Pin or unpin icon - if (oGridConfig.isMatterViewLoaded && oGridConfig.isPinnedViewLoaded) { - setRelevantIcon(event); - } - } else { - sErrorPopUpDetails = JSON.parse(oFinalResult.Result); - if ("0" === sErrorPopUpDetails.code) { - oGridConfig.arrPinnedData.length = 0; - oGridConfig.isMatterView ? gridFailure(oFinalResult, oWebDashboardConstants.NoPinnedMatters, ".pinnedSearch") : gridFailure(oFinalResult, oWebDashboardConstants.NoPinnedDocuments, ".pinnedSearch"); - // In case of removal of all pinned items, we need to update the result grid - setRelevantIcon(event); - } else { - showCommonErrorPopUp(sErrorPopUpDetails.code); - } - } - // hide upload icon on matter tile and also on the matter pop up of pinned matters - var $CurrWebPinnedMatter = $("#pinnedGrid .uploadImg"); - $.each($CurrWebPinnedMatter, function (iIterator) { - if (arrHideUpload[iIterator]) { - $(this).addClass("hideUpload"); - } else { - $(this).attr({ "onclick": "uploadElement(" + iIterator + ", event)", "src": "../Images/upload-666.png", "alt": "upload" }).removeClass("hideUpload"); - if (oGridConfig.isTileView) { - $(this).attr("style", ""); - } - } - - }); - } else { - oGridConfig.arrPinnedData.length = 0; - sErrorPopUpDetails = JSON.parse(oFinalResult.Result); - showCommonErrorPopUp(sErrorPopUpDetails.code); - } -} - -function onPinnedItemFailure(oResult) { - "use strict"; - oGridConfig.arrPinnedData.length = 0; - showCommonErrorPopUp(oResult); -} - -function pinnedMatterBeforeSend() { - "use strict"; - var sGridName = oGridConfig.isMatterView ? "Matters" : "Documents"; - $("#pinnedGrid").html("
\"Loading...\"

Please wait while " + sGridName + " load.
"); -} - -// Function to send call to SharePoint, to update iFrame height -function updateIframeHeight(iHeight) { - "use strict"; - var iFrameURL = oGlobalConstants.Site_Url; - iHeight = (iHeight) ? !isNaN(iHeight) ? iHeight + "px" : iHeight : ($(".LeftContent").height() + 230) + "px"; // Adding 230px to incorporate the height of footer - window.top.parent.postMessage(iHeight, iFrameURL); -} - -// Function to send call to SharePoint, to update scroll to top -function scrollIframeTop() { - "use strict"; - var iFrameURL = oGlobalConstants.Site_Url; - var message = "scrolltop"; - window.top.parent.postMessage(message, iFrameURL); -} - -// Function to send call to SharePoint, to update the Query string based upon current view -function updateQueryString() { - "use strict"; - var sSectionValue = oGridConfig.isMatterView ? "1" : "2"; - var message = oGridConfig.sSection + sSectionValue; - window.top.parent.postMessage(message, oGlobalConstants.Site_Url); -} - -function getPinUnpinData(nElementIndex, oThisElement) { - "use strict"; - var oPinnedItem = oGridConfig.arrGridData[nElementIndex], oParameters = {}, $Element = $(oThisElement).parent().parent().siblings().find(".uploadImg"); - var bHideUpload = true; - if ($Element) { - var uploadImage = $Element.attr("src"); - if (uploadImage) { - bHideUpload = false; - } - } - if (oPinnedItem) { - if (oGridConfig.isMatterView) { - oParameters = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, - "RefreshToken": oSharePointContext.RefreshToken - }, - "client": { - "Url": oGlobalConstants.Central_Repository_Url - }, - "matterData": { - "MatterClient": oPinnedItem[oGlobalConstants.Client_Name], - "MatterName": oPinnedItem[oGlobalConstants.Matter_Name], - "MatterDescription": oPinnedItem.Description, - "MatterCreatedDate": oPinnedItem[oGlobalConstants.Open_Date], - "MatterUrl": oPinnedItem.Path, - "MatterPracticeGroup": oPinnedItem[oGlobalConstants.Practice_Group], - "MatterAreaOfLaw": oPinnedItem[oGlobalConstants.Area_Of_Law], - "MatterSubAreaOfLaw": oPinnedItem[oGlobalConstants.Sub_Area_Of_Law], - "MatterClientUrl": oPinnedItem.SiteName, - "HideUpload": bHideUpload, - "MatterID": oPinnedItem[oGlobalConstants.Matter_ID], - "MatterClientId": oPinnedItem[oGlobalConstants.Client_ID], - "MatterResponsibleAttorney": oPinnedItem[oGlobalConstants.Responsible_Attorney], - "MatterModifiedDate": oPinnedItem[oGlobalConstants.Last_Modified_Time], - "MatterGuid": (null !== oPinnedItem[oGlobalConstants.Matter_GUID]) ? oPinnedItem[oGlobalConstants.Matter_GUID] : oPinnedItem[oGlobalConstants.Matter_Name] - } - }; - } else { - var sFileName = oGridConfig.isMatterView ? oPinnedItem.Title : extractTitle(oPinnedItem.FileName); - var sDocumentName = sFileName && sFileName !== "" ? sFileName : "NA", // Document Name - sDocumentVersion = oPinnedItem.UIVersionStringOWSTEXT && oPinnedItem.UIVersionStringOWSTEXT !== "" ? oPinnedItem.UIVersionStringOWSTEXT : "NA", - sDocumentClientName = oPinnedItem[oGlobalConstants.Document_Client_Name] && oPinnedItem[oGlobalConstants.Document_Client_Name] !== "" ? oPinnedItem[oGlobalConstants.Document_Client_Name] : "NA", // Client Name - sDocumentClientId = oPinnedItem[oGlobalConstants.Document_Client_ID] && oPinnedItem[oGlobalConstants.Document_Client_ID] !== "" ? oPinnedItem[oGlobalConstants.Document_Client_ID] : "NA", - sDocumentClientUrl = oPinnedItem.SPWebUrl && oPinnedItem.SPWebUrl !== "" ? decodeURIComponent(oPinnedItem.SPWebUrl) : "NA", - sDocumentCreatedDate = oPinnedItem.Created && oPinnedItem.Created !== "" ? oPinnedItem.Created : "NA", // Open Date - sDocumentMatter = oPinnedItem[oGlobalConstants.Document_Matter_Name] && oPinnedItem[oGlobalConstants.Document_Matter_Name] !== "" ? oPinnedItem[oGlobalConstants.Document_Matter_Name] : "NA", // Matter Name - sDocumentMatterId = oPinnedItem[oGlobalConstants.Document_Matter_ID] && oPinnedItem[oGlobalConstants.Document_Matter_ID] !== "" ? oPinnedItem[oGlobalConstants.Document_Matter_ID] : "NA", - sDocumentDateModified = oPinnedItem[oGlobalConstants.Document_Last_Modified_Time] && oPinnedItem[oGlobalConstants.Document_Last_Modified_Time] !== "" ? oPinnedItem[oGlobalConstants.Document_Last_Modified_Time] : "NA", // Date Modified - sDocumentCheckoutUser = oPinnedItem[oGlobalConstants.Managed_Property_Document_CheckOutuser] ? oPinnedItem[oGlobalConstants.Managed_Property_Document_CheckOutuser] : "NA", - sDocumentParentUrl = oPinnedItem.ParentLink ? decodeURIComponent(oPinnedItem.ParentLink.replace(oGlobalConstants.All_Items_Extension, "")) : "NA", - sDocumentMatterUrl = oPinnedItem.SPWebUrl ? decodeURIComponent(oPinnedItem.SPWebUrl) : "NA", - sLibraryName = sDocumentParentUrl.replace(sDocumentMatterUrl, "").split("/"), - sDocumentID = oPinnedItem.dlcDocIdOWSText ? oPinnedItem.dlcDocIdOWSText : "NA", - arrAuthor = oPinnedItem[oGlobalConstants.Author].split(";"), - nIndex, - sDocumentOwner, - sAuthorList = ""; - sLibraryName = 1 < sLibraryName.length ? sLibraryName[1] : ""; - sDocumentMatterUrl = sDocumentMatterUrl + "/" + sLibraryName; - if (arrAuthor.length > 0) { - for (nIndex = 0; nIndex < arrAuthor.length; nIndex++) { - if (arrAuthor[nIndex].indexOf("<") === -1) { - sAuthorList += arrAuthor[nIndex] + ";"; - } - } - } - if (!oGridConfig.isMatterView) { - if (0 < oPinnedItem[oGlobalConstants.Author].search("<")) { - sDocumentOwner = sAuthorList; - } else { - sDocumentOwner = oPinnedItem[oGlobalConstants.Author] && oPinnedItem[oGlobalConstants.Author] !== "" ? oPinnedItem[oGlobalConstants.Author] : "NA"; // Author - } - } - var sDocumentUrl = oPinnedItem.Path && oPinnedItem.Path !== "" ? decodeURIComponent(trimEndChar(oPinnedItem.Path, "/").toLowerCase()) : "NA"; // Path - var sDocumentExtension = oPinnedItem.FileExtension && oPinnedItem.FileExtension !== "" ? oPinnedItem.FileExtension : "NA"; - var sDocumentOWAUrl = trimEndChar(sDocumentUrl, "/"); - var sDocumentSPWebUrl = oPinnedItem.SPWebUrl ? oPinnedItem.SPWebUrl : "NA"; - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentOWAUrl = decodeURIComponent(commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentOWAUrl)); - } - oParameters = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, - "RefreshToken": oSharePointContext.RefreshToken - }, - "client": { - "Url": oGlobalConstants.Central_Repository_Url - }, - "documentData": { - "DocumentName": sDocumentName, - "DocumentVersion": sDocumentVersion, - "DocumentClient": sDocumentClientName, - "DocumentClientId": sDocumentClientId, - "DocumentClientUrl": sDocumentClientUrl, - "DocumentMatter": sDocumentMatter, - "DocumentMatterId": sDocumentMatterId, - "DocumentOwner": sDocumentOwner, - "DocumentUrl": sDocumentUrl, - "DocumentOWAUrl": sDocumentOWAUrl, - "DocumentExtension": sDocumentExtension, - "DocumentCreatedDate": sDocumentCreatedDate, - "DocumentModifiedDate": sDocumentDateModified, - "DocumentCheckoutUser": sDocumentCheckoutUser, - "DocumentMatterUrl": sDocumentMatterUrl, - "DocumentParentUrl": sDocumentParentUrl, - "DocumentID": sDocumentID - } - }; - } - } - return oParameters; -} - -function onCreatePinMatterSuccess(oResultData, event) { - "use strict"; - if ("True" === oResultData.Result) { - // Reload the grid - oGridConfig.isMatterView ? requestPinnedMatter("pinnedGrid") : requestPinnedDocument("pinnedGrid"); - } else { - // Reset if Failure - onCreatePinMatterFailure(oResultData, event); - } -} - -function onCreatePinMatterFailure(oResultData, event) { - "use strict"; - // Reset if Failure - var oPinnedItem = oResultData.oParam.element; - if (oPinnedItem) { - $(oPinnedItem).attr("src", "../Images/pin-666.png"); - $(oPinnedItem).attr("onclick", "pinElement(" + oResultData.oParam.nIndex + ", this, event)"); - $(oPinnedItem).attr("title", "pin"); - $(oPinnedItem).attr("alt", ""); - $(oPinnedItem).removeAttr("class"); - $(oPinnedItem).addClass("pinIcon"); - } - var sErrorPopUpDetails = JSON.parse(oResultData.Result); - showCommonErrorPopUp(sErrorPopUpDetails.code); -} - -function pinElement(nIndex, oThisElement, event) { - "use strict"; - var oPinnedItemParameters = getPinUnpinData(nIndex, oThisElement); - oGridConfig.isMatterView ? oPinnedItemParameters.matterData.MatterCreatedDate = validateDateFormat(oPinnedItemParameters.matterData.MatterCreatedDate) : oPinnedItemParameters.documentData.DocumentCreatedDate = validateDateFormat(oPinnedItemParameters.documentData.DocumentCreatedDate); - commonFunction.closeAllFilterExcept(""); - oGridConfig.arrPinnedTemp.push(oPinnedItemParameters); - var oParam = { "container": "pinnedGrid", "element": event.target, "nIndex": nIndex }; - var sFunctionName = oGridConfig.isMatterView ? "PinMatterForUser" : "PinDocumentForUser"; - oCommonObject.callSearchService(sFunctionName, oPinnedItemParameters, onCreatePinMatterSuccess, onCreatePinMatterFailure, OnBeforePinUnpin, oParam); - event.stopPropagation(); -} - -// Converts and return date to UTC format -function validateDateFormat(sDateToBeProcressed) { - "use strict"; - var oDates = new Date(sDateToBeProcressed); - if (isNaN(oDates)) { - var arrSplitedDate = sDateToBeProcressed.replace(/[-]/g, "/"); - arrSplitedDate = arrSplitedDate.split("/"); - var sFormattedDate = arrSplitedDate[1] + "-" + arrSplitedDate[0] + "-" + arrSplitedDate[2]; - oDates = new Date(sFormattedDate); - } - return oDates.toISOString(); -} - -function OnBeforePinUnpin(oResultData) { - "use strict"; - // Show the loading image for the unpinned item - var oUnpinnedItem = oResultData.oParam.element; - if (oUnpinnedItem) { - $(oUnpinnedItem).attr("class", "pinnedLoading floatContentLeft"); - $(oUnpinnedItem).attr("src", "../Images/WindowsLoadingFast.GIF"); - $(oUnpinnedItem).attr("onclick", "return false;"); - $(oUnpinnedItem).attr("title", "loading..."); - $(oUnpinnedItem).attr("alt", "loading..."); - } -} - -function onUnpinSuccess(oResultData, event) { - "use strict"; - commonFunction.closeAllFilterExcept(""); - if ("True" === oResultData.Result) { - oGridConfig.isMatterView ? requestPinnedMatter("pinnedGrid") : requestPinnedDocument("pinnedGrid"); - } else { - // Reset if Failure - onUnpinFailure(oResultData, event); - } -} - -function onUnpinFailure(oResultData, event) { - "use strict"; - // Reset if Failure - var oUnpinnedItem = oResultData.oParam.element; - if (oUnpinnedItem) { - $(oUnpinnedItem).attr("src", "../Images/unpin-666.png"); - $(oUnpinnedItem).attr("onclick", "unPinElement('',this," + oResultData.oParam.nIndex + ", event)"); - $(oUnpinnedItem).attr("title", "unpin"); - $(oUnpinnedItem).attr("alt", ""); - $(oUnpinnedItem).removeAttr("class"); - $(oUnpinnedItem).addClass("unPinIcon"); - } - var sErrorPopUpDetails = JSON.parse(oResultData.Result); - showCommonErrorPopUp(sErrorPopUpDetails.code); -} - -function unPinElement(container, oItem, nIndex, event) { - "use strict"; - var sParameters = {}, oParam = {}, sFunctionName, sDocumentUrl; - commonFunction.closeAllFilterExcept(""); - if (oGridConfig.isMatterView) { - sFunctionName = "RemovePinnedMatter"; - sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "matterData": { "MatterName": oGridConfig.arrPinnedData[nIndex].MatterUrl } }, oParam = { "container": container, "matterName": oGridConfig.arrPinnedData[nIndex].MatterName, "element": oItem }; - oParam = { "element": oItem, "nIndex": nIndex }; - } else { - sFunctionName = "RemovePinnedDocument"; - sDocumentUrl = decodeURIComponent(trimEndChar($.trim(oGridConfig.arrPinnedData[nIndex].DocumentUrl), "/").toLowerCase()); - sDocumentUrl = oCommonObject.htmlEncode(sDocumentUrl); - sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "documentData": { "DocumentName": oGridConfig.arrPinnedData[nIndex].DocumentUrl, "DocumentVersion": oGridConfig.arrPinnedData[nIndex].DocumentVersion, "DocumentClient": oGridConfig.arrPinnedData[nIndex].DocumentClient, "DocumentClientId": oGridConfig.arrPinnedData[nIndex].DocumentClientId, "DocumentMatter": oGridConfig.arrPinnedData[nIndex].DocumentMatter, "DocumentMatterId": oGridConfig.arrPinnedData[nIndex].DocumentMatterId, "DocumentOwner": oGridConfig.arrPinnedData[nIndex].DocumentOwner, "DocumentUrl": sDocumentUrl, "DocumentOWAUrl": oGridConfig.arrPinnedData[nIndex].DocumentOWAUrl, "DocumentExtension": oGridConfig.arrPinnedData[nIndex].DocumentExtension } }; - oParam = { "element": oItem, "nIndex": nIndex }; - } - oCommonObject.callSearchService(sFunctionName, sParameters, onUnpinSuccess, onUnpinFailure, OnBeforePinUnpin, oParam); - event.stopPropagation(); -} - -$(document).ready(function (event) { - "use strict"; - $.ajax({ - url: "filterpanel.html?ver=25.0.0.0", - success: function (response) { - $(".bannerMatterWorkspace").html($(response).find(".commonBannerWrapper").html()); - $(".matterPopup").html($(response).find(".commonMatterPopup").html()); - $(".documentPopup").html($(response).find(".commonDocumentPopup").html()); - $("#mailBody").html($(response).find("#commonMailBody").html()); - $(".TryAgainLink").attr("href", "javascript:window.top.location.reload()"); - commonFunction.onLoadActions(true); - commonFunction.setOWADocumentExtension(); - $("#filterAdvancedSearch").click(function (e) { - // Reset the Search Results - var oMatterResultNumber = $("#DisplayFindMattersResults .allSearch .ResultNumbers"); - var oDocumentResultNumber = $("#DisplaySearchDocumentsResults .allSearch .ResultNumbers"); - if (oMatterResultNumber[0] && oDocumentResultNumber[0]) { - oMatterResultNumber.html(" (0)"); - oMatterResultNumber.html(" (0)"); - } - // Set the page number back to 1 - oGridConfig.nGridPageNumber = 1; - }); - if (oGridConfig.isMatterView) { - $(".filterSearchPG, .filterSearchAOL").removeClass("hide"); - $(".filterSearchAuthor").addClass("hide"); - } else { - $(".filterSearchPG, .filterSearchAOL").addClass("hide"); - $(".filterSearchAuthor").removeClass("hide"); - } - var sHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults"; - togglePinnedView($("#" + sHeaderID + " .allSearch"), 0); // load All view - togglePinnedView($("#" + sHeaderID + " .pinnedSearch"), 1); // load Pinned view - togglePinnedView($("#" + sHeaderID + " .mySearch"), 2); // load Recent view - $(".sdBannerText").attr("data-result", "2"); // Set Recent view as default view - $(document).off("click", "#searchMatter"); - $(document).off("click", "#searchDocument"); - $("#searchMatter").on("click", function (event) { - if ($(".switchAppRow.selected").text().toLowerCase() !== $(this).attr("data-attr").toLowerCase()) { - toggleView(true); - } - }); - $("#searchDocument").on("click", function () { - if ($(".switchAppRow.selected").text().toLowerCase() !== $(this).attr("data-attr").toLowerCase()) { - toggleView(false); - } - }); - $("#searchMatterTab").on("click", function () { - if ($("#headerFlyout .switchAppRow.selected").text().toLowerCase() !== $(this).attr("data-attr").toLowerCase()) { - toggleView(true); - closeHamburgerMenu(); - } - }); - $("#searchDocumentTab").on("click", function () { - if ($("#headerFlyout .switchAppRow.selected").text().toLowerCase() !== $(this).attr("data-attr").toLowerCase()) { - toggleView(false); - closeHamburgerMenu(); - } - }); - } - }); - jQuery.event.props.push("dataTransfer"); - $(document).click(function () { - commonFunction.closeAllFilterExcept(""); - }); - $("#folderStructure .matterFolderPopupClose").click(function () { - $(".folderStructureContent, .folderStructureTitle .matterFolderName").empty(); - $("#folderStructure").hide(); - }); - $(document).on("click", ".notificationContainer .notification .closeNotification,.notificationContainerForPopup .notification .closeNotification", function () { - $(this).parent().remove(); - }); -}); - -function formatDate(dDate) { - "use strict"; - var oDates = new Date(dDate), months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], date = "", oLocalDate = dDate; - if (isNaN(oDates)) { - var arrSplitedDate = dDate.replace(/[-]/g, "/"); - arrSplitedDate = arrSplitedDate.split("/"); - dDate = arrSplitedDate[1] + "-" + arrSplitedDate[0] + "-" + arrSplitedDate[2]; - oDates = new Date(dDate); - } - if (0 > oLocalDate.indexOf("Z")) { - date += months[parseInt(oDates.getMonth(), 10)] + " "; - date += oDates.getDate() + ", "; - date += oDates.getFullYear(); - } else { - date += months[parseInt(oDates.getUTCMonth(), 10)] + " "; - date += oDates.getUTCDate() + ", "; - date += oDates.getUTCFullYear(); - } - return date; -} - -function hideOpenDate(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sTileContent = - "
" + cellValue + "
"; - return sTileContent; -} - -function hideIsUploadStatus(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sTileContent = - "
" + cellValue + "
"; - return sTileContent; -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/BriefcaseOperations.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/BriefcaseOperations.js deleted file mode 100644 index cca97734..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/BriefcaseOperations.js +++ /dev/null @@ -1,512 +0,0 @@ -/// JS2032,JS2074,JS1003,JS2024,JS2076,JS3058,JS3057,JS3092,JS3056,JS3116 - - -var oGlobalConstants = { - sUpdateDocument: oLegalBriefcaseConstants.Update_Copy_Message, - sCheckOut: oLegalBriefcaseConstants.Checkout_Message, - sUpdateDocumentSuccess: oLegalBriefcaseConstants.Update_Document_Success, - sCheckOutSuccess: oLegalBriefcaseConstants.Checkout_Success, - sCheckOutFailure: oLegalBriefcaseConstants.Checkout_Failure, - sCheckIn: oLegalBriefcaseConstants.CheckIn_Message, - sCheckInSuccess: oLegalBriefcaseConstants.CheckIn_Success, - sGenericSuccess: oLegalBriefcaseConstants.Generic_Success_Message, - sGenericFailure: oLegalBriefcaseConstants.Generic_Failure_Message, - sRelaxMsg: oLegalBriefcaseConstants.Relax_Message, - sUpdateDocumentFailure: oLegalBriefcaseConstants.Update_Document_Failure, - sUpdateDocumentPartial: oLegalBriefcaseConstants.Update_Document_Partial, - sCheckOutPartial: oLegalBriefcaseConstants.CheckOut_Partial_Message, - sAlreadyCheckOut: oLegalBriefcaseConstants.CheckIn_Already_Checkout, - sDetach: oLegalBriefcaseConstants.Detach_Document_Message, - sDetachSuccess: oLegalBriefcaseConstants.Detach_Document_Success, - sDetachFailure: oLegalBriefcaseConstants.Detach_Document_Failure, - sDetachQuestion: oLegalBriefcaseConstants.Detach_Document_Question, - sNotSupported: oLegalBriefcaseConstants.Not_Supported_Message, - sCheckInPartial: oLegalBriefcaseConstants.CheckIn_Partial, - sVersionInfoFailure: oLegalBriefcaseConstants.Version_Info_Failed, - sPartialDetach: oLegalBriefcaseConstants.Detach_Partial, - sGoodNews: oLegalBriefcaseConstants.Good_News_Message, - sUpdateQuestion: oLegalBriefcaseConstants.Update_Document_Question, - sQuestion: oLegalBriefcaseConstants.Question, - sErrorMessage: "Some Error Occurred", - sWrongParameter: "Invalid Parameters are passed!", - sUnSupportedList: "
    ", - iUpdateOperation: 1, - iCheckOutOperation: 2, - iDetachOperation: 3, - iCheckInOperation: 4, - iCurrentOperation: 0, - itemId: null, - listId: null, -}; - -var briefcaseDetails = {}; - -var appInsights; -// Function is used to make service calls -function syncBriefcase(itemId, listId, operationType) { - "use strict"; - itemId = itemId.split(","); - if (itemId && listId) { - var briefcaseDetails = { "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "syncDetails": { "ListId": listId, "ItemId": itemId, "Operation": operationType } }; - oCommonObject.callLegalBriefcase("SyncBriefcase", briefcaseDetails, onSuccess, onFailure, null, null); - } -} - - -// On success function of Sync briefcase -function onSuccess(result) { - "use strict"; - removeLoadingClasses(); - var status = "true"; - var oResult = JSON.parse(result); - if (oResult.Status) { - status = oResult.Status; - if ("object" === typeof (oResult.Status)) { - if (oResult.ErrorMessage && "" !== oResult.ErrorMessage) { - status = "false"; - } else { - status = "true"; - } - } - } - if ("true" === status) { - var bFailed = checkFailed(oResult); - switch (oGlobalConstants.iCurrentOperation) { - case 1: - if (!bFailed) { - displayMessage(oGlobalConstants.sUpdateDocumentSuccess, true); - } else { - displayMessage(oGlobalConstants.sUpdateDocumentPartial, true); - } - break; - case 2: - if (!bFailed) { - displayMessage(oGlobalConstants.sCheckOutSuccess, true); - } else { - displayMessage(oGlobalConstants.sCheckOutPartial, true); - } - break; - case 3: - if (!bFailed) { - displayMessage(oGlobalConstants.sDetachSuccess, true); - } else { - displayMessage(oGlobalConstants.sPartialDetach, true); - } - break; - } - } else { - if (oResult.ErrorMessage && "" !== oResult.ErrorMessage) { - displayMessage(oResult.ErrorMessage, false); - } else { - displayNotSupported(); - } - } -} - -// Failure function of Sync Briefcase -function onFailure(result) { - "use strict"; - switch (oGlobalConstants.iCurrentOperation) { - case 1: - displayMessage(oGlobalConstants.sUpdateDocumentFailure, false); - break; - - case 2: - displayMessage(oGlobalConstants.sCheckOutFailure, false); - break; - - case 3: - displayMessage(oGlobalConstants.sDetachFailure, false); - break; - } -} - - -// Function is used to perform check for multiple files -function checkFailed(oResult) { - "use strict"; - var bFailed = false, iIterator = 0, iLength = oResult.Status.length; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (!oResult.Status[iIterator]) { - bFailed = true; - } - } - return bFailed; -} - - -// Function is used to get version of the files that have been requested for check in by user -function getVersion(itemId, listId, operationType) { - "use strict"; - var arrItemId = itemId.split(","); - if (arrItemId && listId) { - var briefcaseDetails = { "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "syncDetails": { "ListId": listId, "ItemId": arrItemId, "Operation": operationType } }; - oCommonObject.callLegalBriefcase("GetVersion", briefcaseDetails, onVersionSuccess, onVersionFailure, null, null); - } -} - -// Success function of version check -function onVersionSuccess(result) { - "use strict"; - removeLoadingClasses(); - var versionInfo = JSON.parse(result); - if (versionInfo.Status) { - if ("false" !== versionInfo.Status) { - displayVersion(versionInfo); - } else { - displayNotSupported(); - } - } else { - if ("Already Checked Out" === versionInfo.ErrorMessage) { - displayMessage(oGlobalConstants.sAlreadyCheckOut, false); - } else { - displayMessage(versionInfo.ErrorMessage, false); - } - } -} - -// Failure function of version check -function onVersionFailure(result) { - "use strict"; - displayMessage(oGlobalConstants.sVersionInfoFailure, false); -} - - -// Function is used to display version -function displayVersion(oVersionObject) { - "use strict"; - var iIterator = 0, iLength = oVersionObject.RelativeURL.length; - var documentId = oGlobalConstants.itemId; - var arrDocumentId = documentId.split(","); - briefcaseDetails = { "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "briefcaseDetails": [], "versionInfo": null, "comments": null, "retainCheckout": null, "convenienceCopy": null }; - var oBriefCase = { "DocumentId": null, "DocumentUrl": null }; - if (1 === iLength) { - if (oVersionObject.IsMajorVersion[0] && oVersionObject.IsMinorVersion[0]) { - var sMinorVersion = oVersionObject.CurrentMajorVersion[0] + "." + (parseInt(oVersionObject.CurrentMinorVersion[0], 10) + 1); - var sMajorVersion = (parseInt((oVersionObject.CurrentMajorVersion[0]), 10) + 1) + ".0"; - if (1 <= parseInt(oVersionObject.CurrentMinorVersion[0], 10)) { - var sOverwriteVersion = oVersionObject.CurrentMajorVersion[0] + "." + (parseInt(oVersionObject.CurrentMinorVersion[0], 10)); - $(".OverwriteVersion").text(sOverwriteVersion + " Overwrite the current minor version"); - } else { - $($(".CheckInOptions")[2]).hide(); - $(".OverwriteVersion").hide(); - } - $(".MinorVersion").text(sMinorVersion + " Minor version (draft)"); - $(".MajorVersion").text(sMajorVersion + " Major version (publish)"); - } else { - $(".VersionDetails").hide(); - } - oBriefCase.DocumentId = arrDocumentId[0]; - oBriefCase.DocumentUrl = oVersionObject.RelativeURL[0]; - briefcaseDetails.briefcaseDetails.push(oBriefCase); - } else { - var iCount = 0, iMinorVersionCount = 0; - for (iIterator = 0; iIterator < iLength; iIterator++) { - briefcaseDetails.briefcaseDetails.push({ "DocumentId": arrDocumentId[iIterator], "DocumentUrl": oVersionObject.RelativeURL[iIterator] }); - oBriefCase.DocumentId = null; - oBriefCase.DocumentUrl = null; - if (oVersionObject.IsMajorVersion[iIterator] && oVersionObject.IsMinorVersion[iIterator]) { - iCount++; - } - if (1 <= parseInt(oVersionObject.CurrentMinorVersion[iIterator], 10)) { - iMinorVersionCount++; - } - } - if (!(iCount === iLength)) { - $(".VersionDetails").hide(); - } else { - if (iMinorVersionCount !== iLength) { - $($(".CheckInOptions")[2]).hide(); - } - } - } - $(".loadingImage").hide(); - $(".Container").hide(); - $(".VersionDiv").show(); -} - - -// Function is used to check in document -function checkInDocument() { - "use strict"; - briefcaseDetails.versionInfo = $("input[name=confirmVersion]:checked").val(); - if (!(briefcaseDetails.versionInfo)) { - briefcaseDetails.versionInfo = 0; - } - briefcaseDetails.comments = $("#CheckInComments").val(); - briefcaseDetails.retainCheckout = ($("input[name=confirm]:checked").val() === "true"); - briefcaseDetails.convenienceCopy = ($("input[name=confirmConvenience]:checked").val() === "true"); - oCommonObject.callLegalBriefcase("SendToMatter", briefcaseDetails, onCheckInSuccess, onCheckInFailure, null, null); - displayLoading(oGlobalConstants.sCheckIn, true); -} - -// Function called on Check in document success -function onCheckInSuccess(result) { - "use strict"; - removeLoadingClasses(); - var oResponse = JSON.parse(result); - if (oResponse.ErrorMessage) { - displayMessage(oResponse.ErrorMessage, false); - } else { - var iIterator = 0, iLength = oResponse.Status.length, bDisplayErrorMessage = false, oListChunk = ""; - - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (!oResponse.Status[iIterator]) { - bDisplayErrorMessage = true; - } - } - if (bDisplayErrorMessage) { - displayNotSupported(); - } else { - displayMessage(oGlobalConstants.sCheckInSuccess, true); - } - } -} - -// Function called on check in document failure -function onCheckInFailure(result) { - "use strict"; - displayMessage(oGlobalConstants.sErrorMessage, false); -} - - - -// Function is used to retrieve parameter from the URL -function getParameterByName(name) { - "use strict"; - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -} - -// Function is used to global parameters like Item Id, List Id and Item URL -function setGlobalParameters() { - "use strict"; - oGlobalConstants.itemId = getParameterByName("ItemID"); - if (!oGlobalConstants.itemId) { - oGlobalConstants.itemId = getParameterByName("SPListItemId"); - } - oGlobalConstants.itemUrl = getParameterByName("ItemURL"); - oGlobalConstants.listId = decodeURIComponent(getParameterByName("ListId")); - if (!oGlobalConstants.listId) { - oGlobalConstants.listId = getParameterByName("SPListId"); - } - oGlobalConstants.listId = oGlobalConstants.listId.replace("{", "").replace("}", ""); -} - -// Function is used to check type of operation requested by the user -function checkOperation() { - "use strict"; - setGlobalParameters(); - var operation = getParameterByName("Operation"); - - switch (operation) { - case "DMSCheckIn": - oGlobalConstants.iCurrentOperation = oGlobalConstants.iCheckInOperation; - displayLoading(oGlobalConstants.sCheckIn, true); - getVersion(oGlobalConstants.itemId, oGlobalConstants.listId, oGlobalConstants.iCheckInOperation); - break; - case "DMSCheckOut": - oGlobalConstants.iCurrentOperation = oGlobalConstants.iCheckOutOperation; - syncBriefcase(oGlobalConstants.itemId, oGlobalConstants.listId, oGlobalConstants.iCheckOutOperation); - break; - case "DetachFromDMS": - oGlobalConstants.iCurrentOperation = oGlobalConstants.iDetachOperation; - displayLoading(oGlobalConstants.sDetach, false); - syncBriefcase(oGlobalConstants.itemId, oGlobalConstants.listId, oGlobalConstants.iDetachOperation); - break; - case "UpdateCopy": - oGlobalConstants.iCurrentOperation = oGlobalConstants.iUpdateOperation; - displayLoading(oGlobalConstants.sUpdateDocument, false); - syncBriefcase(oGlobalConstants.itemId, oGlobalConstants.listId, oGlobalConstants.iUpdateOperation); - break; - default: - displayMessage(oGlobalConstants.sWrongParameter, false); - break; - } -} - - -// Function is used to get response for check in functionality -function getResponse() { - "use strict"; - var bAnswer = false; - var sResponse = $("input[name=confirm]:checked").val(); - if ("Yes" === sResponse) { - bAnswer = true; - } - return bAnswer; -} - - -// Function is used to display loading on the UI -function displayLoading(sMsg, bIsVersion) { - "use strict"; - $(".BigMessage").text(oGlobalConstants.sRelaxMsg); - $(".BigMessage").addClass("LoadingBigMessage"); - $(".Question").text("" + sMsg); - $(".Question").addClass("LoadingQuestion"); - $(".Response").hide(); - $(".loadingImage").show(); - if (bIsVersion) { - $(".VersionDiv").hide(); - $(".Container").show(); - } else { - $(".ButtonContainer").hide(); - } -} - -// Function to remove the classes added to div while displaying loading popup -function removeLoadingClasses() { - "use strict"; - $(".BigMessage").removeClass("LoadingBigMessage"); - $(".Question").removeClass("LoadingQuestion"); -} - -// Function is used to display message on the UI -function displayMessage(sMsg, bSuccess) { - "use strict"; - if (bSuccess) { - if (2 === oGlobalConstants.iCurrentOperation) { - $(".BigMessage").text(oGlobalConstants.sGoodNews); - } else { - $(".BigMessage").text(oGlobalConstants.sGenericSuccess); - } - } else { - $(".BigMessage").text(oGlobalConstants.sGenericFailure); - } - $(".BigMessage").addClass("LoadingBigMessage"); - $(".Question").text("" + sMsg); - $(".Question").addClass("LoadingQuestion"); - $(".loadingImage").hide(); - $(".ButtonContainer").hide(); -} - -// Function is used to make call for performing check for normal documents -function checkNormalDocuments(operationType) { - "use strict"; - setGlobalParameters(); - oGlobalConstants.iCurrentOperation = operationType; - var itemId = oGlobalConstants.itemId.split(","); - var listId = oGlobalConstants.listId; - if (itemId && listId) { - var briefcaseDetails = { "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "syncDetails": { "ListId": listId, "ItemId": itemId, "Operation": operationType } }; - oCommonObject.callLegalBriefcase("CheckNormalDocuments", briefcaseDetails, onCheckSuccess, onCheckFailure, null, null); - } -} - -// Function called on success of check normal documents function -function onCheckSuccess(result) { - "use strict"; - removeLoadingClasses(); - var bResult = JSON.parse(result); - if (bResult) { - displayQuestion(); - } else { - displayNotSupported(); - } -} - - -// Function called on failure of check normal documents function -function onCheckFailure(result) { - "use strict"; - displayMessage(oGlobalConstants.sErrorMessage, false); -} - - -// Document ready function -$(document).ready(function () { - "use strict"; - var operation = getParameterByName("Operation"); - if (operation) { - var sBigMessage = "", sQuestion = "", bIsQuestion = true, bIsSubmitButton = false, bCallCheckOperation = true, bDisplayLoading = true, bIsContainer = true; - switch (operation) { - case "DMSCheckIn": - bIsContainer = false; - break; - case "DMSCheckOut": - sBigMessage = oGlobalConstants.sRelaxMsg; - sQuestion = oGlobalConstants.sCheckOut; - break; - case "DetachFromDMS": - displayLoading(oGlobalConstants.sCheckIn, false); - $(".Container").show(); - checkNormalDocuments(oGlobalConstants.iDetachOperation); - return; - case "UpdateCopy": - displayLoading(oGlobalConstants.sCheckIn, false); - $(".Container").show(); - checkNormalDocuments(oGlobalConstants.iUpdateOperation); - return; - } - if (bIsContainer) { - $(".BigMessage").html("" + sBigMessage); - $(".Question").html("" + sQuestion); - $(".BigMessage").addClass("LoadingBigMessage"); - $(".Question").addClass("LoadingQuestion"); - if (bIsSubmitButton) { - $(".ButtonContainer").show(); - } - if (bDisplayLoading) { - $(".loadingImage").show(); - } - $(".Container").show(); - if (bCallCheckOperation) { - checkOperation(); - } - } else { - $(".VersionDiv").show(); - checkOperation(); - } - } -}); - -// Function is used to display question information on popup for Detach and Update functionality -function displayQuestion() { - "use strict"; - $(".loadingImage").hide(); - if (1 === oGlobalConstants.iCurrentOperation) { - $(".BigMessage").html("" + oGlobalConstants.sUpdateQuestion); - } else if (3 === oGlobalConstants.iCurrentOperation) { - $(".BigMessage").html("" + oGlobalConstants.sDetachQuestion); - } - $(".Question").html("" + oGlobalConstants.sQuestion); - $(".ButtonContainer").show(); - $(".Container").show(); -} - - -// Function is used to display not supported message -function displayNotSupported() { - "use strict"; - $(".BigMessage").html(oGlobalConstants.sNotSupported); - $(".Question").hide(); - $(".loadingImage").hide(); - $(".NotSupportedButton").show(); -} - -// Function is used to toggle display of Convenience copy option -function toggleConvenienceOption() { - "use strict"; - "true" === $("input[name=confirm]:checked").val() ? $("#ConvenienceCopy").hide() : $("#ConvenienceCopy").show(); -} - -// Function is used to close popup -function closePopup() { - "use strict"; - closeParentDialog(true); -} - - -// Function is used to close popup dialog -function closeParentDialog(refresh) { - "use strict"; - var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : "undefined"); - if (refresh) { - target.postMessage("CloseCustomActionDialogRefresh", "*"); - } else { - target.postMessage("CloseCustomActionDialogNoRefresh", "*"); - } -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Common.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Common.js deleted file mode 100644 index 8f13b3b1..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Common.js +++ /dev/null @@ -1,3147 +0,0 @@ -/// JS1003,JS2076,JS2032,JS2064,JS2074,JS2024,JS2026,JS2005,JS3085,JS3116,JS3092,JS3057,JS3058,JS3056 -/* Common file to hold all the common JavaScript functions */ - -var oServiceGlobal = { - oAjaxRequest: null -}; - -var oCommonObject = (function () { - "use strict"; - var commonConstants = { - sProvisioningServiceLocation: oGlobalConstants.Matter_Provision_Service_Url, //// URL for dev site (Development purpose) - sSearchServiceLocation: oGlobalConstants.Search_Service_Url, //// URL for dev site (Development purpose) - sLegalBriefcaseLocation: oGlobalConstants.Legal_Briefcase_Service_Url, - sServiceLocation: "", - oUsers: [], //// Array which will holds the JSON response of users's request - oSiteUser: [], //// Array which will hold all the set of valid resolved users - isMatterView: true, - iCurrentGridViewData: 2, //// Represents current data that grid view is holding on page load (All Matters/Documents: 1, My Matters/Documents: 2, Recent Matters/Documents: 3, Pinned Matters/Documents: 4) - userPinnedData: [], - pinnedData: [], - pinnedFilterData: [], - arrUniqueRefinerData: [], - isServiceCallComplete: true, - sCurrentPage: oGlobalConstants.Home_page, - iColumnDataTotalResults: 0, - iFilterFlyoutPageNumber: 1, - iTypingTimer: 0,////timer identifier - isSearchText: 0, - isAllRowSelected: false, - isFilterFlyoutVisible: 0, - oHeaderFilterType: [], - oSortDetails: { - ByProperty: "", - Direction: 0 - }, - arrCurrentRefiner: [], - valueSeperator: "; ", - bHideAutoComplete: false, - iDocumentDataCounter: 0, - sSearchedKeyword: "", - sFilterDetails: "", - bCalledForSort: false, - sDocumentFullName: "", - /* Wrapper function to call specified method of the service with specified parameters, success and failure functions */ - callService: function (sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam) { - var sWebMethodUrl = commonConstants.sServiceLocation + sWebMethodName - , sData = JSON.stringify(oParameters); - oServiceGlobal.oAjaxRequest = $.ajax({ - type: "POST", - url: sWebMethodUrl, - data: sData, - contentType: "application/json; charset=utf-8", - headers: { "RequestValidationToken": oMasterGlobal.Tokens }, // Get the request validation token from the master page - success: function (result) { - if ("function" === typeof (onSuccess)) { - if (oParam) { - var oFinalResult = { "Result": result, "oParam": oParam }; - onSuccess(oFinalResult); - } else { - onSuccess(result); - } - }; - }, - beforeSend: function (result) { - commonConstants.logAppInsight(sWebMethodName); - if ("function" === typeof (onBeforeSend)) { - if (oParam) { - var oFinalResult = { "Result": result, "oParam": oParam }; - onBeforeSend(oFinalResult); - } else { - onBeforeSend(result); - } - } - }, - error: function (result) { - if ("function" === typeof (onFailure)) { - if (oParam) { - var oFinalResult = { "Result": result, "oParam": oParam }; - onFailure(oFinalResult); - } else { - onFailure(result); - } - } - } - }); - }, - - /* Function to log to app insight */ - logAppInsight: function (eventName) { - if (appInsights) { - switch (eventName) { - case "PinDocumentForUser": - eventName = oGlobalConstants.Pin_Document; - break; - case "RemovePinnedDocument": - eventName = oGlobalConstants.Unpin_Document; - break; - case "PinMatterForUser": - eventName = oGlobalConstants.Pin_Matter; - break; - case "RemovePinnedMatter": - eventName = oGlobalConstants.Unpin_Matter; - break; - case "SendToBriefcase": - eventName = oGlobalConstants.Send_to_OneDrive; - break; - case "UploadMail", "UploadAttachment": - eventName = oGlobalConstants.Mail_Attachment_Upload; - break; - case "CreateMatter": - eventName = oGlobalConstants.Create_Matter; - break; - default: - eventName = ""; - break; - } - if (eventName) { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + eventName, true); - } - } - }, - highlightTerm: function (sResult, sTerm) { - if (sResult && sTerm && "" !== sResult && "" !== sTerm) { - var termTemplate = "" + sTerm + "", - escapeChars = ["(", ")", "+"]; - //// Replace the term with the highlighted version - // This will match all instances of the corresponding term, irrespective of case - escapeChars.forEach(function (char) { sTerm = sTerm.replace(char, "\\" + char); }); - var sTermRegex = new RegExp(sTerm, "ig"); - sResult = sResult.replace(sTermRegex, termTemplate); - } - return sResult; - }, - formatSearchText: function (sSearchTerm, sRefinerString) { - // Search Matters - var sRefinerName, sClientRefiner; - if (oGlobalConstants.Matter_ID === sRefinerString) { - sRefinerName = oGlobalConstants.Matter_Name; - sClientRefiner = oGlobalConstants.Client_Name; - } else { - sRefinerName = oGlobalConstants.File_Name; - sClientRefiner = oGlobalConstants.Document_Client_Name; - } - // Format is Title (MatterID) - if (-1 !== sSearchTerm.indexOf("(")) { - // Separate the title from the ID - var sTitle, sMatterID; - // Check if Document ID exist for the Document - if (commonConstants.sDocumentFullName && null !== commonConstants.sDocumentFullName && "" !== commonConstants.sDocumentFullName) { - sSearchTerm = commonConstants.sDocumentFullName; - } - - if ("null" !== oCommonObject.sDocID) { - sTitle = sSearchTerm.substring(0, sSearchTerm.lastIndexOf("(")); // To take full document name in the case that document name contains parenthesis e.g. 'xyz (2)' - sMatterID = sSearchTerm.substring(sSearchTerm.lastIndexOf("(")); - } else { - sTitle = sSearchTerm; // If no document name exist then assign the sTitle only to sSearchTerm - } - - // Check if the string is in the correct format, otherwise do not format - if (sTitle) { - sTitle = sTitle.trim(); // Removal of White Space - if (sTitle && sMatterID) { - sMatterID = sMatterID.replace(/([()])/g, "").trim(); // Removal of all brackets from the ID - sSearchTerm = "(" + sRefinerName + ":\"" + sTitle + "\" AND " + sRefinerString + ":\"" + sMatterID + "\")"; - } else { - sSearchTerm = "(" + sRefinerName + ":\"" + sTitle + "\")"; // Set search term if document id doesn't exist for particular document - } - } - } else { - if (-1 !== sSearchTerm.indexOf(":")) { - var arrTerm = sSearchTerm.split(":"), sClientID = "", sMatterID = "", sClientName = "", sMatterName = "", sManagedProperty = "", sModifiedDate = "", sCreatedDate = ""; - if (arrTerm.length && 2 === arrTerm.length && arrTerm[0] && arrTerm[1]) { - // Check for the Existence of ClientID: Search Term - if (oGlobalConstants.Client_Custom_Properties_Id.toLowerCase() === arrTerm[0].toLowerCase()) { - sClientID = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Matter_Client_Custom_Properties_Id : oGlobalConstants.Document_Client_ID; - sSearchTerm = "(" + sPropertyName + ":" + sClientID + "*)"; // Replace ClientID with MatterClientID alias - } else if (oGlobalConstants.Matter_ID_Alias.toLowerCase() === arrTerm[0].toLowerCase()) { - sMatterID = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Matter_ID : oGlobalConstants.Document_Matter_ID; - sSearchTerm = "(" + sPropertyName + ":" + sMatterID + "*)"; // Replace MatterID with respective managed property - } else if (oGlobalConstants.Client_Name_Search_Term.toLowerCase() === arrTerm[0].toLowerCase()) { - sClientName = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Client_Name : oGlobalConstants.Document_Client_Name; - sSearchTerm = "(" + sPropertyName + ":" + sClientName + "*)"; // Replace ClientName with respective managed property - } else if (oGlobalConstants.Matter_Name_Search_Term.toLowerCase() === arrTerm[0].toLowerCase()) { - sMatterName = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Matter_Name : oGlobalConstants.Document_Matter_Name; - sSearchTerm = "(" + sPropertyName + ":" + sMatterName + "*)"; // Replace MatterName with respective managed property - } else if (oGlobalConstants.Document_Last_Modified_Time.toLowerCase() === arrTerm[0].toLowerCase() || oGlobalConstants.Last_Modified_Time.toLowerCase() === arrTerm[0].toLowerCase()) { - sModifiedDate = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Last_Modified_Time : oGlobalConstants.Document_Last_Modified_Time; - sSearchTerm = "(" + sPropertyName + ":" + sModifiedDate + ")"; // Replace Modified date with respective managed property without * sign - - } else if (oGlobalConstants.Created_Date.toLowerCase() === arrTerm[0].toLowerCase() || oGlobalConstants.Open_Date.toLowerCase() === arrTerm[0].toLowerCase()) { - sCreatedDate = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = oCommonObject.isMatterView ? oGlobalConstants.Open_Date : oGlobalConstants.Created_Date; - sSearchTerm = "(" + sPropertyName + ":" + sCreatedDate + ")"; // Replace Created Date with respective managed property without * sign - - } else { // Managed properties search even if full text is not typed - sManagedProperty = arrTerm[1].trim(); // Removal of White Space - var sPropertyName = arrTerm[0].trim(); // Removal of White Space - sSearchTerm = "(" + sPropertyName + ":\"" + sManagedProperty + "*\")"; - } - } - } else { - if (!sSearchTerm || sSearchTerm.length <= 0) { - sSearchTerm = "*"; - } else { - sSearchTerm = "\"" + sSearchTerm + "*\""; - } - if ((oGridConfig && !oGridConfig.isMatterView && oCommonObject.bHideAutoComplete) || (!oGridConfig.inWebDashboard && !oCommonObject.isMatterView)) { - sSearchTerm = "(" + sSearchTerm + " OR " + sRefinerName + ":" + sSearchTerm + " OR " + sRefinerString + ":" + sSearchTerm + " OR " + sClientRefiner + ":" + sSearchTerm + ")"; // Adding search term to support free text search - } else { - sSearchTerm = "(" + sRefinerName + ":" + sSearchTerm + " OR " + sRefinerString + ":" + sSearchTerm + " OR " + sClientRefiner + ":" + sSearchTerm + ")"; - } - } - } - return sSearchTerm; - }, - spClientCall: function (FilterDetails) { - if (oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) { - if ("" === FilterDetails.ClientsList[0]) { - FilterDetails.ClientsList = []; - } - FilterDetails.ClientsList.push(oSearchGlobal.sClientSiteUrl); - } - }, - getRecentDocuments: function (container, pageNumber, isPage, source, event) { - var sSearchTerm = $(".filterSearchText").val() && $(".filterSearchText").val() !== "" ? oCommonObject.formatSearchText($(".filterSearchText").val().trim(), oGlobalConstants.Document_ID) : "", FilterDetails; - if (source) { - FilterDetails = oSearchGlobal.oFilterData; - sSearchTerm = oSearchGlobal.sSearchTerm; - } else { - FilterDetails = oCommonObject.getSearchData(event); - } - - commonConstants.spClientCall(FilterDetails); - // Get the current users data always - FilterDetails.FilterByMe = 1; - var oSortDetails = getSortData(); - - var oItemPerPage = null, sFunBeforeSearch = null, sFunOnSuccess = null, sFunOnFailure = null, oParam = null; - if (oGridConfig.inWebDashboard) { - // WebDashboard - itemsCountsToBeDisplayed(); - oItemPerPage = oGridConfig.itemsPerPage; - sFunOnSuccess = onSearchSuccess; - sFunOnFailure = onSearchFailure; - oParam = { "container": container, "isPage": isPage, "pageNumber": pageNumber, "itemsPerPage": oSearchGlobal.itemsPerPage }; - } else { - // FindDocument - oItemPerPage = oSearchGlobal.itemsPerPage; - sFunOnSuccess = onSuccess; - sFunOnFailure = onFailure; - oParam = { "container": container, "isPage": isPage, "pageNumber": pageNumber }; - } - var SearchDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oCommonObject.getDeployedUrl() }, "searchObject": { "PageNumber": pageNumber, "ItemsPerPage": oItemPerPage, "SearchTerm": sSearchTerm, "Filters": FilterDetails, "Sort": oSortDetails } }; - oCommonObject.callSearchService("FindDocument", SearchDetails, sFunOnSuccess, sFunOnFailure, beforeSearch, oParam); - }, - getRecentMatters: function (container, pageNumber, isPage, source, event) { - var ofilterSearchText = $(".filterSearchText").val(); - var sSearchTerm = ofilterSearchText && ofilterSearchText !== "" ? ofilterSearchText : "", FilterDetails, oFilterDetails = { ClientsList: [], PGList: "", AOLList: "", FromDate: "", ToDate: "" }, oParam, SearchDetails; - oSearchGlobal.clientDataLoaded = false; - if (source) { - FilterDetails = oSearchGlobal.oFilterData; - sSearchTerm = oSearchGlobal.sSearchTerm; - } else { - FilterDetails = oCommonObject.getSearchData(event); - } - - commonConstants.spClientCall(FilterDetails); - if (FilterDetails.ClientsList.length && !FilterDetails.ClientsList[0]) { - FilterDetails.ClientsList = oFilterDetails.ClientsList.join(",").split(","); - } - FilterDetails.FilterByMe = 1; // Get the current users data always - var oSortDetails = getSortData(); - var oItemPerPage = null, sFunBeforeSearch = null; - if (oGridConfig.inWebDashboard) { // FindMatter - itemsCountsToBeDisplayed(); - oItemPerPage = oGridConfig.itemsPerPage; - sFunBeforeSearch = beforeSearch; - } else { // WebDashboard - oItemPerPage = oSearchGlobal.itemsPerPage; - sFunBeforeSearch = beforeRequestMatter; - } - - oParam = { - "container": container, "tileContainer": "tileContainer", "pageNumber": pageNumber, "itemsPerPage": oSearchGlobal.itemsPerPage, "fromPagination": true - }; - - SearchDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oCommonObject.getDeployedUrl() }, "searchObject": { "PageNumber": pageNumber, "ItemsPerPage": oItemPerPage, "SearchTerm": sSearchTerm, "Filters": FilterDetails, "Sort": oSortDetails }, "isDocument": false - }; - oCommonObject.callSearchService("FindMatter", SearchDetails, onSearchSuccess, onSearchFailure, sFunBeforeSearch, oParam); - }, - // Function to get URL on which app is deployed - getDeployedUrl: function () { - return oGlobalConstants.Central_Repository_Url; - }, - // Function to get the appSwitcher from Master Page to Current Page - getAppSwitcher: function (sAppName) { - var oCommonAppSwitch = $(".commonAppSwitch"), oLocalAppSwicther = $(".appSwitch"); - if (oCommonAppSwitch && oLocalAppSwicther) { - var appSwitcherHTML = oCommonAppSwitch.html(); - if (appSwitcherHTML) { - oLocalAppSwicther.html(appSwitcherHTML); - oCommonAppSwitch.empty(); - oLocalAppSwicther.find(".appSwitcherName") ? oLocalAppSwicther.find(".appSwitcherName span").text(sAppName) : ""; - } - } - }, - // Encode special HTML characters, so text is safe when building HTML dynamically - renderAsText: function renderAsText(text) { - var renderedText = ""; - if ("string" === typeof text) { - // Search for HTML special characters, convert to HTML entities - renderedText = $("
    ").text(text).html(); - } - return renderedText; - - }, - // Function to get all refiners data - getSearchData: function getSearchData(event) { - var sSearchTerm, sClientSelection, sPGSelection, sAOLSelection, fromDate, toDate, boolIsDateValid, sAuthor; - - // Get the Search Term if Any. - // Get the Client Name from the selected Value if Any. - - sSearchTerm = $(".filterSearchText").val() && $(".filterSearchText").val() !== "" ? oCommonObject.formatSearchText($(".filterSearchText").val().trim(), oGlobalConstants.Document_ID) : ""; - sClientSelection = ($(".filterSearchRefinerText.refinerClientsText").attr("data-selected") && $(".filterSearchRefinerText.refinerClientsText").attr("data-selected") !== "" ? $(".filterSearchRefinerText.refinerClientsText").attr("data-selected") : "").split("$|$"); - - fromDate = $("#refinerFromText").val(); - toDate = $("#refinerToText").val(); - - boolIsDateValid = oCommonObject.checkDateValid(fromDate, toDate); - if (!boolIsDateValid) { - $("#refinerDateError").show(); - } else { - $("#refinerDateError").hide(); - - var oFilterPanelDetails = oGridConfig.isMatterView ? { ClientsList: [], PGList: [""], AOLList: [""], FromDate: "", ToDate: "", FilterByMe: "" } : { - ClientsList: [], FromDate: "", ToDate: "", DocumentAuthor: "", FilterByMe: "" - }; - if (oGridConfig.isMatterView) { - var oPGList = $(".filterSearchRefinerText.refinerPGText").attr("data-selected"), - AOLList = $(".filterSearchRefinerText.refinerAOLText").attr("data-selected"); - oFilterPanelDetails.PGList = (oPGList && oPGList !== "" ? oPGList : "").split("$|$"); - oFilterPanelDetails.AOLList = (AOLList && AOLList !== "" ? AOLList : "").split("$|$"); - } else { - sAuthor = $("#txtDocumentAuthor").val(); - sAuthor = trimEndChar(sAuthor.trim(), ";"); - oFilterPanelDetails.DocumentAuthor = sAuthor; - } - // Append time to "From" part of date if not null - if ($.trim(fromDate)) { - fromDate += oGlobalConstants.From_Date_Append_Time; - } - // Append time to "To" part of date if not null - if ($.trim(toDate)) { - toDate += oGlobalConstants.To_Date_Append_Time; - } - oFilterPanelDetails.ClientsList = sClientSelection; - oFilterPanelDetails.FromDate = fromDate; - oFilterPanelDetails.ToDate = toDate; - oFilterPanelDetails.FilterByMe = oSearchGlobal.searchOption; - closeAllPopupExcept("filterAutoComplete", event); - return oFilterPanelDetails; - } - }, - - //// Function to check type of the app based on URL - getParameterByName: function (sParamterName) { - sParamterName = sParamterName.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var oRegex = new RegExp("[\\?&]" + sParamterName + "=([^&#]*)", "i"), - oResults = oRegex.exec(location.search); - return oResults === null ? "" : decodeURIComponent(oResults[1].replace(/\+/g, " ")); - }, - - // Function to validate to date and from date - checkDateValid: function checkDateValid(fromDateText, toDateText) { - if (fromDateText && toDateText) { - var fromDate = new Date(fromDateText.replace(/-/g, "/")); - var toDate = new Date(toDateText.replace(/-/g, "/")); - if (fromDate <= toDate) { - return true; - } else { - return false; - } - } else { - return true; - } - }, - //// Extract file title from file name. E.g. input: "abc.txt", Output: "abc" - ExtractFileTitle: function ExtractFileName(fileNameWithExtn) { - var nExtnPosition = fileNameWithExtn ? fileNameWithExtn.lastIndexOf(".") : fileNameWithExtn; - return -1 < nExtnPosition && fileNameWithExtn ? fileNameWithExtn.substring(0, nExtnPosition) : fileNameWithExtn; - }, - // App Insight Event tracking function - logEvent: function (eventName) { - if (appInsights && eventName) { - appInsights.trackEvent(eventName); - } - }, - // Update CSS for success notification - updateNotificationPosition: function () { - "use strict"; - var oSuccessNotification = $(".successNotification"); - var oNotificationContainer = oGridConfig.inWebDashboard ? $(".notificationContainerForMailPopup") : $(".notificationContainerForPopup"); - if (oNotificationContainer.children().length && oSuccessNotification.length) { - oSuccessNotification.remove(); - } - }, - - // Display Success notification - showNotification: function (sMsg, resultClass) { - "use strict"; - // Check if success notification is not present; then only display notification - var oNotificationContainer = oGridConfig.inWebDashboard ? $(".notificationContainerForMailPopup") : $(".notificationContainerForPopup"); - var nIsSuccessNotificationPresent = $(".successNotification").length; - if (!nIsSuccessNotificationPresent) { - var sContent = ""; - sContent = "
    " + sMsg + "x
    "; - if (0 === oNotificationContainer.children().length) { // Increase height only when overwrite notification is not present - $(".mailContainer").height($(".mailContainer").height() + 30); // Adjusting the height of the popup, post removing notification - } - $(".mailContainer").prepend(sContent); - oCommonObject.updateNotificationPosition(); - } - }, - - // Function to overwrite local files - localOverWriteDocument: function (oDocument) { - var $askForOverwrite = $(".askForOverwrite"), - overWriteYes = $askForOverwrite.find("#overWriteYes")[0], - overWriteNo = $askForOverwrite.find("#overWriteNo")[0], - overWriteAppend = $askForOverwrite.find("#overWriteAppend")[0], - overWriteContentCheck = $askForOverwrite.find("#contentCheck")[0]; - - if ("undefined" !== typeof overWriteYes) { - overWriteYes.disabled = true; - } - if ("undefined" !== typeof overWriteNo) { - overWriteNo.disabled = true; - } - if ("undefined" !== typeof overWriteAppend) { - overWriteAppend.disabled = true; - } - if ("undefined" !== typeof overWriteContentCheck) { - overWriteContentCheck.disabled = true; - } - - if ("overWriteNo" === $(oDocument).attr("id")) { - if ("undefined" !== typeof overWriteYes) { - overWriteYes.disabled = false; - } - if ("undefined" !== typeof overWriteNo) { - overWriteNo.disabled = false; - } - if ("undefined" !== typeof overWriteAppend) { - overWriteAppend.disabled = false; - } - if ("undefined" !== typeof overWriteContentCheck) { - overWriteContentCheck.disabled = false; - } - oUploadGlobal.sNotificationMsg && (oUploadGlobal.sNotificationMsg = ""); - $(oDocument).parents(".notification").remove(); - } - - var sOperation = $(oDocument).attr("data-operation"); - - if ("contentCheck" === sOperation) { - oSearchGlobal.files = [oUploadGlobal.arrFiles[oUploadGlobal.arrFiles.length - 1]]; - } else { - if (oGridConfig.inWebDashboard) { - oSearchGlobal.oFileArray = [oUploadGlobal.arrFiles.pop()]; - } else { - oSearchGlobal.files = [oUploadGlobal.arrFiles.pop()]; - } - } - - var nOperation = ""; - if ("ignore" !== sOperation) { - switch (sOperation) { - case "overwrite": - nOperation = "0"; - break; - case "append": - nOperation = "1"; - break; - case "contentCheck": - nOperation = "2"; - break; - case "cancelContentCheck": - nOperation = "3"; - break; - } - uploadFile(oUploadGlobal.sClientRelativeUrl, oUploadGlobal.sFolderUrl, nOperation); - } - if (0 < $(".notification").length) { - if ("undefined" !== typeof overWriteYes) { - overWriteYes.disabled = false; - } - if ("undefined" !== typeof overWriteNo) { - overWriteNo.disabled = false; - } - if ("undefined" !== typeof overWriteAppend) { - overWriteAppend.disabled = false; - } - if ("undefined" !== typeof overWriteContentCheck) { - overWriteContentCheck.disabled = false; - } - $(oDocument).parents(".notification").remove(); - } - //// Dynamically decrease the height of the popup - oCommonObject.updateUploadPopupHeight(false); - oCommonObject.updateNotificationPosition(); - }, - - // Function to configure time stamp - overwriteConfiguration: function (fileName) { - // Update the content as per the logic. - var selectedOverwriteConfiguration = oGlobalConstants.Overwrite_Config_Property.trim().toLocaleUpperCase(), - fileExtension = fileName.trim().substring(fileName.trim().lastIndexOf(".") + 1), - bAppendEnabled = false; - - switch (selectedOverwriteConfiguration) { - case "BOTH": - bAppendEnabled = true; - break; - case "DOCUMENT ONLY": - bAppendEnabled = "eml" === fileExtension || "msg" === fileExtension ? false : true; - break; - default: - bAppendEnabled = "eml" === fileExtension || "msg" === fileExtension ? true : false; - break; - } - return bAppendEnabled; - }, - // Increase and decrease the mail cart popup container - updateUploadPopupHeight: function (increaseHeight) { - var oNotificationContainer = oGridConfig.inWebDashboard ? $(".mailContainer >.notificationContainerForMailPopup") : $(".notificationContainerForPopup"), - mailContainer = $(".mailContainer"), - overWriteNotification = $(".notification.warningNotification"); - if (increaseHeight) { - // Dynamically increase the height of the popup - if (!overWriteNotification.length) { - oNotificationContainer.css("height", oNotificationContainer.height() + 80); - oGridConfig.inWebDashboard ? mailContainer.css({ "height": mailContainer.height() + 80 }).addClass("placePopupWithHeight") : mailContainer.css("height", mailContainer.height() + 68); - } - } else { - // Dynamically decrease the height of the popup - if (!overWriteNotification.length || (0 === overWriteNotification.length && !$('oNotificationContainer[style*="height"]').length && !$('mailContainer[style*="height"]').length)) { - oNotificationContainer.css("height", ""); - oGridConfig.inWebDashboard ? mailContainer.css({ "height": "" }).addClass("placePopup") : mailContainer.css("height", ""); - } - } - }, - // Function to bind the jQuery UI auto-complete to the jQuery object of passed selector - bindAutocomplete: function (sSelector, bIsMultiUser) { - var $AutoComplete = $(sSelector); - if ($AutoComplete) { - $AutoComplete.autocomplete({ - minLength: oGlobalConstants.Minlength_For_PeoplePicker, //// Minimum length of string for which the service request will be sent to fetch the users - source: function (request, response) { - var $SelectedObject = $(sSelector); //// Need to get the jQuery object again as on typing, the $AutoComplete object is out of scope - var sSearchTerm = (bIsMultiUser) ? $.trim($(request.term.split(";")).last()[0]) : $.trim(request.term); //// If multi-user text box, extract the last term for filtering - $(".ui-autocomplete").hide(); - var matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": oGlobalConstants.Central_Repository_Url - }, "searchObject": { - "SearchTerm": sSearchTerm - } - }; - if (sSearchTerm) { //// If user has entered something apart from white space - $.ajax({ - type: "POST", - url: oGlobalConstants.Matter_Provision_Service_Url + "GetUsers", - data: JSON.stringify(matterDetails), - contentType: "application/json; charset=utf-8", - headers: { - "RequestValidationToken": oMasterGlobal.Tokens - }, - success: function (result) { - commonConstants.oUsers = JSON.parse(result); - /* Store valid site users in array for further use */ - $.each(commonConstants.oUsers, function (key, item) { - item.Email && commonConstants.oSiteUser.push(item.Email); - }); - if (!commonConstants.oUsers.code) { - var sConflictIdentified = "undefined" !== typeof (oMatterProvisionObject) ? oMatterProvisionObject.sConflictScenario() : "undefined" !== typeof (oManagePermissionsOnMatter) ? oManagePermissionsOnMatter.sConflictScenario() : "False"; - /* Generate the JSON object that will be passed to the auto complete function */ - var arrUsers = $.map(commonConstants.oUsers, function (item) { - if ("True" === sConflictIdentified) { - if ("User" === item.EntityType) { - return { - label: item.Name, - Email: item.Email, - OriginalEmail: item.EntityData.Email - }; - } - } else { - return { - label: item.Name, - Email: item.Email, - OriginalEmail: item.EntityData.Email - }; - } - }); - if (!arrUsers.length) { - var arrToPush = []; - arrToPush.label = oGlobalConstants.People_Picker_No_Results; - arrToPush.Email = ""; - arrUsers.push(arrToPush); - } - response(arrUsers); - } else { - if (!(oMatterProvisionObject) || (commonConstants.oUsers.code && "string" === typeof commonConstants.oUsers.code && (-1 < commonConstants.oUsers.code.indexOf("#|#")))) { - showCommonErrorPopUp(commonConstants.oUsers.code); - } else { - oMatterProvisionObject && oMatterProvisionObject.showErrorNotification(sSelector, commonConstants.oUsers.value); - } - } - $SelectedObject.removeClass("ui-autocomplete-loading"); //// Remove the loading image explicitly once done with auto complete operations - }, - error: function (result) { - return false; - } - }); - } else { - $SelectedObject.removeClass("ui-autocomplete-loading"); //// Remove the loading image explicitly once done with auto complete operations - } - }, - focus: function (event, ui) { - //// prevent value inserted on focus - return false; - }, - select: function (event, ui) { - if (ui && ui.item && !($.trim(ui.item.Email))) { - return false; - } - $(event.target).attr("data-resolved", "1"); - if (bIsMultiUser) { - var terms = $.trim(this.value) ? $.trim(this.value).split(";") : []; - //// remove the current input - terms.pop(); - //// add the selected item - terms.push(ui.item.value + " (" + ui.item.OriginalEmail + ")"); - //// add placeholder to get the semicolon-and-space at the end - terms.push(""); - terms = $.map(terms, function (item) { - return ($.trim(item)); - }); - this.value = terms.join("; "); - return false; - } else if (sSelector === "#txtConflictCheckBy") { - this.value = ui.item.value + " (" + ui.item.OriginalEmail + ");"; - return false; - } - } - }).data("uiAutocomplete")._renderItem = function (ul, item) { - var sUserTitle, sTooltip; - // Check if there is a user to be returned then assign title else for no record results keep it empty - if (item.OriginalEmail) { - sUserTitle = item.title; - sTooltip = item.OriginalEmail; - } else { - sUserTitle = ""; - sTooltip = ""; - } - return $("
  • ") - .append("" + item.label + "") - .appendTo(ul); - }; - } - }, - - getUserName: function (sUserEmails, bIsName) { - "use strict"; - var arrUserNames = [], sEmail = "", oEmailRegex = new RegExp(oGlobalConstants.Email_Validation_Regex); - if (sUserEmails && null !== sUserEmails && "" !== sUserEmails) { - arrUserNames = sUserEmails.split(";"); - for (var iIterator = 0; iIterator < arrUserNames.length - 1; iIterator++) { - if (arrUserNames[iIterator] && null !== arrUserNames[iIterator] && "" !== arrUserNames[iIterator]) { - if (-1 !== arrUserNames[iIterator].lastIndexOf("(")) { - sEmail = $.trim(arrUserNames[iIterator].substring(arrUserNames[iIterator].lastIndexOf("(") + 1, arrUserNames[iIterator].lastIndexOf(")"))); - if (oEmailRegex.test(sEmail)) { - arrUserNames[iIterator] = bIsName ? $.trim(arrUserNames[iIterator].substring(0, arrUserNames[iIterator].lastIndexOf("("))) : sEmail; - } - } - } - } - } - return arrUserNames; - }, - - // Function to get current width of the window - getWidth: function () { - var nWidth = 0; - if (self.innerHeight) { - nWidth = self.innerWidth; - } else if (document.documentElement && document.documentElement.clientHeight) { - nWidth = document.documentElement.clientWidth; - } else if (document.body) { - nWidth = document.body.clientWidth; - } - return nWidth; - }, - /* Function to update the URL of go to Matter Sites ECB action */ - checkMatterLandingURLSuccess: function (result) { - //// Handle the true and false responses for the Matter Landing page - if (result && result.Result && result.oParam) { - - //// Show the go to Matter Sites action and remove the chunk for loading image - var oGoToMatterSitesElement = result.oParam.currentECBMenuContainer.find(".gotoMatterSites"); - var gotoOneNoteOption = result.oParam.currentECBMenuContainer.find(".gotoOneNote"); - result.oParam.currentECBMenuContainer.find(".ms-ContextualMenu-item").removeClass("hide"); - var anchorElement = document.createElement("a"); //// Dummy element to get the host name and protocol properties - anchorElement.href = result.oParam.clientUrl; //// Set the HREF attribute of dummy element to client URL - $(".mattersiteloading").addClass("hide"); - - var oSplitResults = result.Result.split("$|$"); - if (2 === oSplitResults.length) { - var oOneNoteResult = oSplitResults[0].split("$#$") - , oMatterLandingPageResult = oSplitResults[1].split("$#$") - , sMatterPageLink = result.oParam.matterLibraryURL; // Set the link to the All Items page - if (oOneNoteResult && 2 === oOneNoteResult.length) { - if ("true" === oOneNoteResult[0]) { - if (gotoOneNoteOption && gotoOneNoteOption.length) { - gotoOneNoteOption.attr({ "href": anchorElement.href + "/" + oFindMatterConstants.WOPIFrameURL + anchorElement.protocol + "//" + anchorElement.hostname + oOneNoteResult[1], "target": "_blank" }); - gotoOneNoteOption.removeClass("is-disabled").removeAttr("disabled"); - } - } - } else { - //// If OneNote URL not exist then disabled option - gotoOneNoteOption.addClass("is-disabled").attr("disabled", "disabled"); - gotoOneNoteOption.removeAttr("href"); - gotoOneNoteOption.removeAttr("target"); - } - - - //// Set the link to the Matter Landing page if oMatterLandingPageResult[0] is true - if (oMatterLandingPageResult && 2 === oMatterLandingPageResult.length && (oMatterLandingPageResult[0] && $.parseJSON(oMatterLandingPageResult[0]))) { - sMatterPageLink = anchorElement.protocol + "//" + anchorElement.hostname + oMatterLandingPageResult[1]; - } - - //// Set the hyper link property of go to Matter Sites - oGoToMatterSitesElement.attr({ "data-matterlink": sMatterPageLink, "onclick": "viewMatter(this);" }); - } else { - commonConstants.checkMatterLandingURLFailure(result); //// Set the path to matter library - } - } else { - commonConstants.checkMatterLandingURLFailure(result); //// Set the path to matter library - } - }, - /* Function to set the path of go to Matter Sites to the location of matter landing page */ - checkMatterLandingURLFailure: function (result) { - //// Set the URL to document library - if (result && result.oParam && result.oParam.matterLibraryURL && result.oParam.currentECBMenuContainer) { - result.oParam.currentECBMenuContainer.find(".gotoMatterSites").attr({ "href": result.oParam.matterLibraryURL, "target": "_blank" }); - } - }, - /* Function to check whether the Matter Landing page exists */ - checkMatterLandingURL: function (sClientURL, sOneNoteURL, sMatterLandingPageURL, sMatterLibraryURL, oContextualMenu) { - //// Hide the go to Matter Sites action and display the loading image - oContextualMenu.find(".ms-ContextualMenu-item").addClass("hide"); - $(".mattersiteloading").removeClass("hide"); - - var oCheckMatterLandingParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sClientURL }, requestedUrl: sOneNoteURL, requestedPageUrl: sMatterLandingPageURL } - , oParam = { - "clientUrl": sClientURL, "matterLibraryURL": sMatterLibraryURL, "currentECBMenuContainer": oContextualMenu - }; - - oCommonObject.callSearchService("UrlExists", oCheckMatterLandingParameters, commonConstants.checkMatterLandingURLSuccess, commonConstants.checkMatterLandingURLFailure, null, oParam); - }, - /* Function to update pinned status of the matter */ - updatePinnedStatus: function () { - //// Get the URL of matter - var oMandatoryObject = $(".mandatory"); //// Get all the mandatory columns from the grid view control - var iStartPosition = parseInt(parseInt(oGridViewObject.itemsPerPage, 10) * (parseInt(oGridViewObject.pageNumber, 10) - 1), 10) - , iLengthToTraverse = oMandatoryObject.length * parseInt(oGridViewObject.pageNumber, 10), - arrDataToCompare = $.map(oCommonObject.userPinnedData, function (item) { - return decodeURIComponent(trimEndChar($.trim(item), "/").toLowerCase()); - }); - /* Update the status only for latest data load in the grid view */ - for (var iIterator = iStartPosition; iIterator < iLengthToTraverse ; iIterator++) { - var oCurrentObject = $(oMandatoryObject[iIterator]); //// Get the current mandatory object - var sCurrentPath = oCurrentObject.attr("data-" + oGlobalConstants.Path); //// Get the matter URL - //// Check if matter is already pinned and set the attribute accordingly - if (-1 === $.inArray(decodeURIComponent(trimEndChar($.trim(sCurrentPath), "/").toLowerCase()), arrDataToCompare)) { - oCurrentObject.attr("data-ispinned", "false"); - } else { - oCurrentObject.attr("data-ispinned", "true"); - } - } - }, - /* Function to generate common drop down control */ - generateCommonDropdown: function (sDropdownSelector, sDropdownFields) { - var sDropdownData = []; - sDropdownData = $.trim(sDropdownFields) ? $.trim(sDropdownFields).split(";") : ""; - oDropdownControl.generateDropdownControl("#searchPanelDropdown", sDropdownData); - }, - /* Function to generate common drop down control */ - generateColumnPicker: function (sColumnPickerSelector, sColumnPickerFields) { - var sColumnPickerData = []; - sColumnPickerData = $.trim(sColumnPickerFields) ? $.trim(sColumnPickerFields).split(";") : ""; - oColumnPickerControl.generateColumnPickerControl(sColumnPickerSelector, sColumnPickerData); - }, - /* Function to update configurations and refresh grid view */ - updateAndRefreshGridView: function (oCurrentElement, bIsSearchCall) { - var oPageHeader = $("#gridViewPageHeader"); - if (oPageHeader.length) { - oPageHeader.text(oCurrentElement.text()); //// Set the page header to current selection - //// Set the tool tip of the current section - switch (oCurrentElement.text()) { - case oGlobalConstants.Pinned_Matters_Title: - oPageHeader.attr("title", oGlobalConstants.Pinned_Matters_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.Pinned_Matters_Message); - break; - case oGlobalConstants.All_Matters_Title: - oPageHeader.attr("title", oGlobalConstants.All_Matters_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.All_Matters_Message); - break; - case oGlobalConstants.My_Matters_Title: - oPageHeader.attr("title", oGlobalConstants.My_Matters_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.My_Matters_Message); - break; - case oGlobalConstants.Pinned_Documents_Title: - oPageHeader.attr("title", oGlobalConstants.Pinned_Documents_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.Pinned_Documents_Message); - break; - case oGlobalConstants.All_Documents_Title: - oPageHeader.attr("title", oGlobalConstants.All_Documents_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.All_Documents_Message); - break; - case oGlobalConstants.My_Documents_Title: - oPageHeader.attr("title", oGlobalConstants.My_Documents_Message); - $(".ms-Dropdown-title").attr("title", oGlobalConstants.My_Documents_Message); - break; - } - } - commonConstants.abortRequest(); - commonConstants.clearGridViewContent(); - commonConstants.clearFlyOutFilters(true); //// Clear server side filters - commonConstants.clearClientFlyOutFilters(); //// Clear client side filters - (oCommonObject.isMatterView) ? getPinnedMatters($("#gridView")) : getPinnedDocument($("#gridView")); - if (bIsSearchCall) { - (oCommonObject.isMatterView) ? getSearchMatters($("#gridView"), 0) : getSearchDocuments($("#gridView"), 0); - } - $("#autoCompleteText").focus().blur(); - $("#attachDocuments").addClass("is-disabled"); - }, - - /* Aborts the previously made AJAX call */ - abortRequest: function () { - "use strict"; - if (!oCommonObject.isServiceCallComplete) { - if (oServiceGlobal.oAjaxRequest && 4 !== oServiceGlobal.oAjaxRequest.readyState) { - oServiceGlobal.oAjaxRequest.abort(); - oServiceGlobal.oAjaxRequest = null; - } - } - }, - /* Function to set tool tip of common drop down*/ - updateDropDownToolTip: function () { - var dropDownItem = $(".ms-Dropdown-item"); - $.each(dropDownItem, function (iIterator) { - if ($(dropDownItem[iIterator]).length) { - switch ($(dropDownItem[iIterator]).text()) { - case oGlobalConstants.Pinned_Documents_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.Pinned_Documents_Message); - break; - case oGlobalConstants.All_Documents_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.All_Documents_Message); - break; - case oGlobalConstants.My_Documents_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.My_Documents_Message); - break; - case oGlobalConstants.Pinned_Matters_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.Pinned_Matters_Message); - break; - case oGlobalConstants.All_Matters_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.All_Matters_Message); - break; - case oGlobalConstants.My_Matters_Title: - $(dropDownItem[iIterator]).attr("title", oGlobalConstants.My_Matters_Message); - break; - } - } - }); - }, - /* Function to bind events to common drop down control */ - addDropdownBindings: function () { - /* Functionality of All Matters */ - $(".alldata").on("click", function () { - oCommonObject.isAllRowSelected = false; - $("#autoCompleteText").val(""); - oCommonObject.sSearchedKeyword = ""; - commonConstants.iCurrentGridViewData = 1; //// Set the flag for search data - commonConstants.arrCurrentRefiner.length = 0; //// Remove the current selected filters - commonConstants.updateAndRefreshGridView($(this), true); //// Update the configuration and refresh the grid view - }); - - /* Functionality of My Matters */ - $(".mydata").on("click", function () { - oCommonObject.isAllRowSelected = false; - $("#autoCompleteText").val(""); - oCommonObject.sSearchedKeyword = ""; - commonConstants.iCurrentGridViewData = 2; //// Set the flag for search data - commonConstants.arrCurrentRefiner.length = 0; //// Remove the current selected filters - commonConstants.updateAndRefreshGridView($(this), true); //// Update the configuration and refresh the grid view - }); - - /* Functionality of Recent Matters */ - $(".recentdata").on("click", function () { - oCommonObject.isAllRowSelected = false; - $("#autoCompleteText").val(""); - oCommonObject.sSearchedKeyword = ""; - commonConstants.iCurrentGridViewData = 3; //// Set the flag for search data - commonConstants.arrCurrentRefiner.length = 0; //// Remove the current selected filters - commonConstants.updateAndRefreshGridView($(this), true); //// Update the configuration and refresh the grid view - }); - - /* Functionality of Pinned Matters */ - $(".pinneddata").on("click", function () { - oCommonObject.isAllRowSelected = false; - $("#autoCompleteText").val(""); - oCommonObject.sSearchedKeyword = ""; - commonConstants.iCurrentGridViewData = 4; //// Set the flag for search data - commonConstants.arrCurrentRefiner.length = 0; //// Remove the current selected filters - commonConstants.updateAndRefreshGridView($(this), false); //// Update the configuration and refresh the grid view - }); - - /* Function to remove the extra styles attached by fabric */ - $(".ms-Dropdown").on("click", function () { - $(this).find(".ms-Dropdown-item").removeClass("ms-Dropdown-item--selected"); - }); - - /* Function to open the drop down menu */ - $("#searchPanelDropdown .ms-Dropdown-title").click(function (event) { - commonConstants.closeAllPopupExcept("ms-Dropdown", event); //// Close all pop-ups except App Switcher - }); - - /* Function to open the drop down menu on click of glyph icon */ - $("#glyphIcon .ms-Icon--caretDown").on("click", function (event) { - $(".ms-Dropdown").toggleClass("ms-Dropdown--open"); - commonConstants.closeAllPopupExcept("ms-Dropdown", event); //// Close all pop-ups except App Switcher - event && event.stopPropagation(); - }); - }, - autoCompleteSearch: function () { - if ($(".autoCompletePanel").html()) { - var oSelectedAutoCompleteRow = $(".autoCompleteSelected"); - // Pick document id of the selected document in the row - oCommonObject.sDocID = oSelectedAutoCompleteRow.attr("data-docid"); - // If any suggestion is selected from the auto complete panel set the text in the auto complete text box - if (0 !== oSelectedAutoCompleteRow.length) { - $("#autoCompleteText").val(oSelectedAutoCompleteRow.text()); - $(".autoCompletePanel").empty().addClass("hide"); - } - } - $("#searchIcon").click(); //// Trigger search Icon click to search for Matters/Documents - return false; - }, - /* Function to bind events for auto complete control */ - addAutoCompleteBindings: function () { - var $textField = $(".ms-TextField"); - - /* Bind JS of fabric component */ - $textField.textField(); - - /* Event for Enter event on Chrome*/ - $("#MasterPageForm").on("submit", function (e) { - //// If auto complete panel has some results - oCommonObject.autoCompleteSearch(); - return false; - }); - - /* Event for search text box input, calling auto complete */ - $("#autoCompleteText").on("keyup", function (e) { - commonConstants.bHideAutoComplete = false; - if ($(this).val()) { - if (13 === e.which) { - commonConstants.bHideAutoComplete = true; - oCommonObject.autoCompleteSearch(); - return false; - } - var $autoCompleteRow = $(".autoCompleteRow"); - if ($(".autoCompletePanel").html()) { - // If no suggestion is selected - if (0 === $(".autoCompleteSelected").length) { - if (40 === e.which) { - $($autoCompleteRow[0]).addClass("autoCompleteSelected"); - } - if (38 === e.which) { - $($autoCompleteRow[parseInt($autoCompleteRow.length, 10) - 1]).addClass("autoCompleteSelected"); - } - } else { - // If no suggestion is selected - var position = $autoCompleteRow.filter(".autoCompleteSelected").index(); - $($autoCompleteRow[position]).removeClass("autoCompleteSelected"); - // On key up event - if (40 === e.which) { - // Check to see if selected suggestion is not the last one in list - if (parseInt($autoCompleteRow.length, 10) - 1 !== position) { - position = position + 1; - } else { - $("#autoCompleteText").focus(); - $autoCompleteRow.removeClass("autoCompleteSelected"); - return false; - } - } - // On key down event - if (38 === e.which) { - // Check to see if selected suggestion is not the first one in the list - if (0 !== position) { - position = position - 1; - } else { - $("#autoCompleteText").focus(); - $autoCompleteRow.removeClass("autoCompleteSelected"); - return false; - } - } - $($autoCompleteRow[position]).addClass("autoCompleteSelected"); - } - } - if (40 !== e.which && 38 !== e.which && 13 !== e.which && "" !== $(this).val()) { - commonConstants.getAutoCompleteData(); - } - } else { - commonConstants.bHideAutoComplete = true; - $(".autoCompletePanel").addClass("hide"); - } - }); - - //// Binding on onfocus event on auto complete text box - $(document).on("focus", "#autoCompleteText", function (event) { - $(".autoCompleteRow").removeClass("autoCompleteSelected"); - commonConstants.closeAllPopupExcept("", event); - }); - - // Binding click event on auto complete suggestions - $(document).on("click", ".autoCompleteRow", function (event) { - $("#autoCompleteText").click().val($(this).text()); //// Set the selected text in the auto complete text box - commonConstants.closeAllPopupExcept("", event); //// Close all popups - oCommonObject.sDocID = $(this).attr("data-docid"); - commonConstants.sDocumentFullName = $(this).attr("data-searchterm"); - $("#searchIcon").click(); //// Trigger search Icon click to search for Matters/Documents - event && event.stopPropagation(); - }); - - /* Binding click event on search text box */ - $textField.on("click", function (event) { - $textField.find(".ms-Label").hide(); - $("#autoCompleteText").focus(); - event && event.stopPropagation(); - }); - - /* Function to execute on click of Search Icon */ - $("#searchIcon").on("click", function () { - commonConstants.bHideAutoComplete = true; - if (!$(".ms-Icon--search")[0].disabled) { - oGridViewObject.pageNumber = 1; //// Reset the page number for grid view control - if (4 === oCommonObject.iCurrentGridViewData()) { //// Check the flag for search data if current view is pinned view - commonConstants.iCurrentGridViewData = 1; - $(".searchPanelDropdownOption").removeClass("selectedDropdownOption"); - $(".alldata").addClass("selectedDropdownOption"); - if (oCommonObject.isMatterView) { - $(".ms-Dropdown-title, #gridViewPageHeader").text("All Matters").attr("title", oGlobalConstants.All_Matters_Message); //// Set the drop down title to All Matters - } else { - $(".ms-Dropdown-title, #gridViewPageHeader").text("All Documents").attr("title", oGlobalConstants.All_Documents_Message); //// Set the drop down title to All Matters - } - } - oCommonObject.isAllRowSelected = false; - commonConstants.arrCurrentRefiner.length = 0; //// Remove the current selected filters - commonConstants.clearFlyOutFilters(true); - if (!$("#autoCompleteText").val().trim().length) { - $("#autoCompletePlaceHolder").css("display", "inline"); - } - $("#gridViewContainer").off("scroll").empty(); /// Remove the data from the grid view - $("#loadingImageContainer").removeClass("hide"); //// Hide the loading image of grid view control - oCommonObject.sSearchedKeyword = $("#autoCompleteText").length ? $("#autoCompleteText").val() : ""; - if (oCommonObject.isMatterView) { - //// Get data for Search Matters - getSearchMatters($("#gridView"), 1); - } else { - //// Get data for Search Documents - getSearchDocuments($("#gridView"), 1); - } - } - }); - }, - /* Function to bind events for column picker control */ - addColumnPickerBindings: function () { - var $columnPickerIcon = $("#columnPickerIcon"); - var oContainer = "columnPickerPanel"; - var arrCheckBox = $("#" + oContainer + "").find("input[type='checkbox']"); - var nCheckBoxCount = arrCheckBox.length; - - $columnPickerIcon.on("click", function (event) { - commonConstants.closeAllPopupExcept("columnPickerPanel", event); //// Close all pop-ups except Column Picker - $columnPickerIcon.toggleClass("selected"); - var imageSrc = $columnPickerIcon.hasClass("selected") ? "../Images/Column_Picker_Close.png" : "../Images/Column_Picker_Expand.png"; - $columnPickerIcon.attr("src", imageSrc); - $("#columnPickerPanel").toggle("slide", { direction: "right" }).toggleClass("hide"); - $("#columnPickerStrip").toggleClass("hide"); - event && event.stopPropagation(); - }); - - $(document.body).on("change", "#options-checkbox-unselected", function () { - var iIterator = 0; - var bCurrentItemStatus = $("#options-checkbox-unselected")[0].checked; - oGridViewObject && (oGridViewObject.bDefaultSelectionChanged = true); - //// Starting the iteration from position 2 as Name column is to be selected always and it is present in position 1 - for (iIterator = 2; iIterator <= nCheckBoxCount - 1; iIterator++) { - arrCheckBox[iIterator].checked = this.checked; - commonConstants.toggleColumns(iIterator - 1, bCurrentItemStatus); - } - }); - - $("#" + oContainer).on("click", ".defaultSelection", function (event) { - event.stopPropagation(); - event.preventDefault(); - }); - }, - /* Function to perform column option selection */ - onColumnPickerCheckboxClick: function (iIndex, event) { - if (iIndex) { - oGridViewObject && (oGridViewObject.bDefaultSelectionChanged = true); - var bCurrentItemStatus = $("#options-checkbox-unselected" + iIndex)[0].checked; - var $AllColumnOption = $("#columnOptions").find("#options-checkbox-unselected"); - commonConstants.toggleColumns(iIndex, bCurrentItemStatus); - if ($AllColumnOption[0].checked) { - $AllColumnOption.prop("checked", false); - } - var nSelectedColumnCount = $("#columnOptions").find("input[type='checkbox']:checked").length; - var nTotalColumnCount = $("#columnOptions").find("input[type='checkbox']").length; - if (nTotalColumnCount - 1 === nSelectedColumnCount) { - $AllColumnOption.prop("checked", true); - } - event ? event.stopPropagation() : ""; - } - }, - /* Function to perform grid view item selection */ - onGridViewCheckboxClick: function () { - var $AllGridViewItems = $(".isSelectRowsActive"); - if ($AllGridViewItems && $AllGridViewItems.length && $AllGridViewItems[0].checked) { - $AllGridViewItems.prop("checked", false); - oCommonObject.isAllRowSelected = false; - } - var nSelectedColumnCount = $(".jsonGrid").find(".is-selectedRow").length; - var nTotalColumnCount = $(".gridCell").find("input[type='checkbox']").length; - if (nTotalColumnCount && (nSelectedColumnCount === nTotalColumnCount)) { - $AllGridViewItems.prop("checked", true); - oCommonObject.isAllRowSelected = true; - } - }, - /* Function to show/hide grid view columns based upon user selection */ - toggleColumns: function (iIndex, bCurrentItemStatus) { - var nHeaderOptionMapping = oCommonObject.isMatterView ? iIndex + oFindMatterConstants.GridViewNonDataColumns.split(";").length + 1 : iIndex + oFindDocumentConstants.GridViewNonDataColumns.split(";").length + 1; - if (bCurrentItemStatus) { - $(".dataColumn" + (parseInt(iIndex) + 1)).parent().removeClass("hide"); - $(".jsonGridHeader:nth-child(" + nHeaderOptionMapping + ")").removeClass("hide"); - } else { - $(".dataColumn" + (parseInt(iIndex) + 1)).parent().addClass("hide"); - $(".jsonGridHeader:nth-child(" + nHeaderOptionMapping + ")").addClass("hide"); - } - oGridViewObject.arrUserSelectedColumns = []; - $.each($("#columnOptions").find("input[type='checkbox']:checked").siblings(), function (index, value) { - $(value).text().trim() && oGridViewObject.arrUserSelectedColumns.push($(value).text().trim()); - }); - /* Adjust the caret down icon for last column in the grid view */ - commonConstants.adjustCaretIcon(); - }, - /* Function for failure of auto complete */ - getAutoCompleteDataFailure: function (result) { - oGridViewObject.waitTillDataLoaded = false; - var oResult = JSON.parse(result); - showCommonErrorPopUp(oResult.Result); - }, - /* Function for success of auto complete */ - getAutoCompleteDataSuccess: function (result) { - if (!commonConstants.bHideAutoComplete) { - var splitResults, jsonResponse; - jsonResponse = { - }; - if (-1 !== result.indexOf("$|$")) { - splitResults = result.split("$|$"); - if (splitResults[1] && parseInt(splitResults[1], 10) > 0) { - jsonResponse = JSON.parse(splitResults[0]); - } - } - commonFunction.closeAllFilterExcept("autoCompletePanel"); - oCommonObject.sDocID = "null"; // Stores document id if document id exist for particular document - - var autoContainer = "
    " - , autoCompleteItemContainer = "
    " - , regularSearchTerm = new RegExp("#SearchTerm#", "g") - , regularDocID = new RegExp("#DocID#", "g") - , lineItem - , autoCompleteItemContainerClose = "#SearchTermClose#
    " - , regularSearchTermClose = new RegExp("#SearchTermClose#", "g") - , sTerm = $("#autoCompleteText").length ? $("#autoCompleteText").val() : ""; - - if (jsonResponse && jsonResponse.length) { - for (lineItem in jsonResponse) { - if (jsonResponse.hasOwnProperty(lineItem)) { - /* Differ the implementation based on Search Matters or Search Documents */ - if (oCommonObject.isMatterView) { //// Manipulation for Search Matters - var matterName = jsonResponse[lineItem][oGlobalConstants.Matter_Name]; - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, matterName + " (" + jsonResponse[lineItem][oGlobalConstants.Matter_ID] + ")") + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(matterName + " (" + jsonResponse[lineItem][oGlobalConstants.Matter_ID] + ")", sTerm)); - } else {//// Manipulation for Search Documents - var docName = oCommonObject.ExtractFileTitle(jsonResponse[lineItem][oGlobalConstants.File_Name]); - var docId = jsonResponse[lineItem][oGlobalConstants.Document_ID]; - if (0 < $.trim(docId).length) { - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, jsonResponse[lineItem][oGlobalConstants.File_Name] + " (" + docId + ")").replace(regularDocID, docId) + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(docName + " (" + docId + ")", sTerm)); - } else { - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, jsonResponse[lineItem][oGlobalConstants.File_Name]).replace(regularDocID, docId) + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(docName, sTerm)); - } - } - } - } - $(".autoCompletePanel").removeClass("hide").html(autoContainer); - } else { - //// Display no results in auto complete panel /* Do not remove commented code; kept for future purpose */ - //// autoContainer = autoContainer + "
    " + oGlobalConstants.No_Results_Autocomplete + "
    "; - $(".autoCompletePanel").addClass("hide").empty(); - } - - advanceSearchDropdown(); - } - }, - /* Function to get the auto complete results */ - getAutoCompleteData: function () { - var ofilterSearchText = $("#autoCompleteText").length ? $("#autoCompleteText").val() : "" - , sSearchTerm = "" - , oFilterDetails = {} - , oSortDetails = { ByProperty: "", Direction: 0 } - , oSearchDetails, sRefinerForName, sRefinerForID, sServiceCallName; - - //// Update the refiners and configurations based on Search Matters or Search Documents - if (oCommonObject.isMatterView) { - oFilterDetails = { - ClientsList: [], PGList: "", AOLList: "", FromDate: "", ToDate: "", FilterByMe: 1 - }; - sRefinerForName = oGlobalConstants.Matter_Name; - sRefinerForID = oGlobalConstants.Matter_ID; - sServiceCallName = "FindMatter"; - } else { - oFilterDetails = { - ClientsList: [], FromDate: "", ToDate: "", DocumentAuthor: "", FilterByMe: 1 - }; - sRefinerForName = oGlobalConstants.File_Name; - sRefinerForID = oGlobalConstants.Document_ID; - sServiceCallName = "FindDocument"; - } - - if (2 !== oCommonObject.iCurrentGridViewData()) { //// If All Matters/Documents section (flag is 1) is selected, then set filter by me flag to 0 - oFilterDetails.FilterByMe = 0; - } - - if (2 === oCommonObject.iCurrentGridViewData()) { //// If My Matters/Documents section (flag is 2) is selected, then update the Sort filter - oSortDetails.ByProperty = oCommonObject.isMatterView ? oGlobalConstants.Last_Modified_Time : oGlobalConstants.Document_Last_Modified_Time; - oSortDetails.Direction = 1; - } - - if (ofilterSearchText) { - sSearchTerm = "(" + sRefinerForName + ":" + ofilterSearchText + "* OR " + sRefinerForID + ":" + ofilterSearchText + "*)"; - - oSearchDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oCommonObject.getDeployedUrl() }, "searchObject": { - "PageNumber": "1", "ItemsPerPage": "5", "SearchTerm": sSearchTerm, "Filters": oFilterDetails, "Sort": oSortDetails - } - }; - - oCommonObject.callSearchService(sServiceCallName, oSearchDetails, oCommonObject.getAutoCompleteDataSuccess, oCommonObject.getAutoCompleteDataFailure, null, null); - } else { - $(".autoCompletePanel").addClass("hide").empty(); - } - }, - /* Function to get the source path for the icon */ - getIconSource: function (sExtension) { - var iconSrc = oGlobalConstants.Image_Document_Icon.replace("{0}", sExtension); - iconSrc = (-1 < oGlobalConstants.PNG_Icon_Extensions.indexOf(sExtension)) ? iconSrc.substring(0, oGlobalConstants.Image_Document_Icon.lastIndexOf(".") + 1) + "png" : iconSrc; - return iconSrc; - }, - /* Function to close all pop up */ - closeAllPopupExcept: function (divClass, event) { - var sCurrentItemClass = (event.target && event.target.className) ? event.target.className : "" - , sCurrentItemId = (event.target && event.target.id) ? event.target.id : ""; - - if ("AppMenuFlyout" !== divClass) { - var $AppMenuFlyout = $(".AppMenuFlyout"); - if ($AppMenuFlyout.is(":visible")) { - $AppMenuFlyout.slideUp(); - $(".OpenSwitcher").removeClass("hide"); - $(".MenuCaption").removeClass("hideMenuCaption"); - $(".CloseSwitcher").addClass("hide"); - } - } - if ("ContextualHelpContainer" !== divClass) { - var $ContextualHelpFlyout = $(".ContextualHelpContainer"); - if ($ContextualHelpFlyout.is(":visible")) { - $ContextualHelpFlyout.hide(); - } - } - if ("ms-ContextualMenu" !== divClass) { - $(".ms-ContextualMenu").removeClass("is-open"); - } - if ("errorAttachDocument" !== divClass) { - $(".errorAttachDocument").addClass("hide"); - } - if ("ms-Dropdown" !== divClass) { - var $ViewDropDown = $(".ms-Dropdown"); - if ($ViewDropDown.hasClass("ms-Dropdown--open")) { - $ViewDropDown.removeClass("ms-Dropdown--open"); - } - } - if ("autoCompletePanel" !== divClass) { - $(".autoCompletePanel").addClass("hide"); //// Remove the results from auto complete panel and hide it - } - if ("PersonaFlyout" !== divClass) { - $(".PersonaFlyout").slideUp(); - } - if ("textFlyoutContent" !== divClass) { - $(".flyoutWrapper").css("min-height", 0); - $("#textFlyoutContent").addClass("hide"); - } - if ("dateFlyoutContent" !== divClass) { - $("#dateFlyoutContent").addClass("hide"); - } - if ("columnPickerPanel" !== divClass) { - if (!$("#columnPickerPanel").hasClass("hide")) { - $("#columnPickerIcon").click(); - } - } - if ("InfoFlyout" !== divClass) { - $("#gridViewContainer .InfoFlyout").remove(); - } - }, - /* Function to add bindings for ECB control */ - addECBBindings: function () { - /* Functionality of Pin */ - $(".pin").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - if (oCommonObject.isMatterView) { - //// Pin Matter for User - pinMatter(oGridViewObject.oCurrentMandatory); - } else { - //// Pin Document for User - pinDocument(oGridViewObject.oCurrentMandatory); - } - }); - - /* Functionality of Unpin */ - $(".unpin").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - if (oCommonObject.isMatterView) { - //// Unpin Matter for User - unpinMatter(oGridViewObject.oCurrentMandatory); - } else { - //// Unpin Document for User - unpinDocument(oGridViewObject.oCurrentMandatory); - } - }); - - /* Functionality of Upload */ - $(".upload").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - if (!($(this).attr("disabled"))) { - $(".notification").remove(); - populateFolderHierarchy(oGridViewObject.oCurrentMandatory); - } - }); - - /* Functionality of Go to Matter Sites */ - $(".gotoMatterSites").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Go_To_Matter_Sites, true); - }); - - /* Functionality of Matter Info */ - $(".matterinfo").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Matter_Info, true); - }); - - /* Functionality of Document Info */ - $(".documentinfo").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Document_Info, true); - }); - - /* Functionality of Edit Document */ - $(".editdocument").on("click", function () { - //// Get the mandatory element from where we can get the meta data associated with the matter - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Edit_Document, true); - var sDocumentPath = ""; - if (4 === oCommonObject.iCurrentGridViewData()) { - sDocumentPath = oGridViewObject.oCurrentMandatory.attr("data-documentowaurl"); - } else { - sDocumentPath = getDocumentUrl(oGridViewObject.oCurrentMandatory); - } - commonConstants.openWindow(sDocumentPath, "_blank"); - }); - }, - /* Function to populate data inside filter fly out */ - populateFilterHTML: function (sRefinerName, sFilterFlyoutType, arrRefinerUniqueValues, bScroll) { - - var sResultsChunk = "", oResultsCollection = []; - //// Check the length of arrRefinerUniqueValues if its between 1 to 6 then set the height of the flyout filter accordingly - if (oGlobalConstants.Minimum_Window_Size < window.innerHeight) { - var windowheight = window.innerHeight - parseInt(oGlobalConstants.Space_Above_Filter_Flyout); - if (1 <= arrRefinerUniqueValues.length && 6 >= arrRefinerUniqueValues.length) { - var defaultheight = parseInt(oGlobalConstants.Default_Record_Height) - , defultFilterHeight = parseInt(oGlobalConstants.Default_Flyout_Wrapper_Height) - , iflyoutHeight = defaultheight * (arrRefinerUniqueValues.length ? arrRefinerUniqueValues.length : 1) - , iflyoutWrapperHeight = defultFilterHeight + iflyoutHeight - , ifinalFlyoutHeight = iflyoutWrapperHeight < windowheight ? iflyoutWrapperHeight : windowheight - , ifilterResultHeight = defaultheight + (ifinalFlyoutHeight - defultFilterHeight); - $(".flyoutWrapper").css("min-height", ifinalFlyoutHeight); - $("#filterResultsContainer").css({ "max-height": ifilterResultHeight }); - } - //// Check the length of arrRefinerUniqueValues if its greater than 6 set the flyout height to maximum - if (7 <= arrRefinerUniqueValues.length) { - var ifinalFlyoutHeight = oGlobalConstants.Maximum_Flyout_Height < windowheight ? oGlobalConstants.Maximum_Flyout_Height : windowheight; - $(".flyoutWrapper").css("min-height", ifinalFlyoutHeight); - $("#filterResultsContainer").css({ "max-height": (ifinalFlyoutHeight - parseInt(oGlobalConstants.Minimum_Flyout_Height)) }); - } - } else { - $(".flyoutWrapper").css("min-height", oGlobalConstants.Small_WindowSize_Flyout_Height); - $("#filterResultsContainer").css({ "max-height": oGlobalConstants.Small_WindowSize_Flyout_Container_Height }); - } - //// singleselect: Single select filtering, multiselect: Multi select filtering, date: Filtering for date column - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - sResultsChunk = "
    {1}
    "; - } else if ("multiselect" === sFilterFlyoutType.toLowerCase()) { - sResultsChunk = "
    "; - } - //// Populate the filter fly out with data for refiner - if (0 === arrRefinerUniqueValues.length) { - oResultsCollection.push("
    " + oGlobalConstants.FilterFlyout_NoResult + "
    "); - } else { - $.each(arrRefinerUniqueValues, function (iIndex, sCurrentItem) { - var sCurrentValue = $.trim(sCurrentItem); - /* Commented code kept if there is a requirement to remove extension from filter fly out in future */ - ////if ("undefined" !== typeof (oFindDocumentConstants) && (oFindDocumentConstants.GridViewTitleProperty === result.oParam.refinerValue || oFindDocumentConstants.GridViewPinnedTitleProperty === result.oParam.refinerValue)) { - //// sCurrentValue = extractTitle(sCurrentValue); - ////} - if (sCurrentValue) { - oResultsCollection.push(sResultsChunk.replace(/\{0\}/g, iIndex).replace(/\{1\}/g, sCurrentValue)); - } - }); - } - - //// Add empty elements for having scroll bar - var iUniqueValueLength = oResultsCollection && oResultsCollection.length; - if (10 > iUniqueValueLength && 0 < arrRefinerUniqueValues.length) { - oResultsCollection.push("
    "); - } - - var sResultsCollectionChunk = oResultsCollection.join(""); - $("#filterResultsContainer").html(sResultsCollectionChunk); - if (bScroll) { - var topScroll = $("#filterResultsContainer").scrollTop(); - $("#filterResultsContainer").scrollTop(topScroll - 3); - } - commonConstants.waitTillFilterDataLoaded = false; - commonConstants.bindScrollOnFilterFlyout(); - //// Highlight the selected filters - commonConstants.highlightSelectedFilters(sRefinerName, sFilterFlyoutType); - }, - /* Function to be called before getting data for specific column */ - getColumnDataOnBefore: function (result) { - //// result.oParam.refinerValue will have the name of refiner - var oLoadingChunk = "
    \"Loading...\"
    "; - var oLoadingImage = $("#filterResultsContainer").find(".filterflyoutLoading"); - if (0 === oLoadingImage.length) { - $("#filterResultsContainer").append(oLoadingChunk); - } - }, - /* Failure function to get the data for specific column */ - getColumnDataFailure: function (result) { - commonConstants.waitTillFilterDataLoaded = false; - var oResult = JSON.parse(result); - showCommonErrorPopUp(oResult.Result); - }, - /* Success function to get the data for specific column */ - getColumnDataSuccess: function (result) { - //// result.oParam.refinerValue will have the name of refiner - if (result && $.trim(result.Result)) { - var sData = result.Result.split("$|$") - , bIsPageLoad; - - var searchResults = JSON.parse(sData[0]); - var totalResults = parseInt(sData[1], 10) || 0; - if (!searchResults.code || "0" === searchResults.code) { - //// Pinned matters exists for the current logged in user - if ("undefined" !== typeof sData[1] && totalResults) { - commonConstants.iColumnDataTotalResults = totalResults; - //// Get the data for the refiner i.e. selected column - var oRefinerData = $.map(searchResults, function (sCurrentItem) { - return trimEndChar($.trim(sCurrentItem[result.oParam.refinerValue]), ";"); - }); - var uniqueDataLength = commonConstants.arrUniqueRefinerData.length; - //// Get the unique values from the refiner array - /* Separate out individual entries for multiuser field */ - $.each(oRefinerData, function (iCount, sCurrentValue) { - var arrSplitValues = []; - if ($.trim(sCurrentValue)) { - arrSplitValues = sCurrentValue.split(";"); - } - $.each(arrSplitValues, function (iCurrentCount, sValue) { - var sTrimmedValue = $.trim(sValue); - ($.inArray(sTrimmedValue, commonConstants.arrUniqueRefinerData) === -1) && commonConstants.arrUniqueRefinerData.push(sTrimmedValue); - }); - }); - var bScroll = uniqueDataLength === commonConstants.arrUniqueRefinerData.length; - //// Get specific value for multivalued text - var sCurrentFilterSearchTerm = $(".filterFlyoutSearchText").length ? $(".filterFlyoutSearchText").val() : ""; - if ($.trim(sCurrentFilterSearchTerm)) { - var oSplitSearchTerm = sCurrentFilterSearchTerm.split(";") - , oClientFilteredArray = []; - if (oSplitSearchTerm.length) { - $.each(oSplitSearchTerm, function (sCurrentIndex, sCurrentValue) { - sCurrentValue = $.trim(sCurrentValue).toLowerCase(); - $.each(commonConstants.arrUniqueRefinerData, function (sIndex, sValue) { - var sLowerValue = sValue.toLowerCase(); - if (-1 !== sLowerValue.indexOf(sCurrentValue) && -1 === commonConstants.hasValue(sValue, oClientFilteredArray)) { - oClientFilteredArray.push(sValue); - } - }); - }); - commonConstants.arrUniqueRefinerData = oClientFilteredArray; - } - } - commonConstants.populateFilterHTML(result.oParam.refinerValue, result.oParam.filterFlyoutType, commonConstants.arrUniqueRefinerData, bScroll); - } else { - // No documents exists - sData[1] = 0; - $("#filterResultsContainer").html("
    " + oGlobalConstants.FilterFlyout_NoResult + "
    "); - } - } else { - showCommonErrorPopUp(searchResults.code); - } - } - }, - hasValue: function (sValue, oFilterArray) { - var nIndex = -1; - var result = nIndex; - $.each(oFilterArray, function (index, value) { - if (result === nIndex && value.toLowerCase() === sValue.toLowerCase()) { - result = index; - } - }); - return result; - }, - /* Function to get the data for specific column */ - getColumnData: function (sRefinerValue, sFilterFlyoutType, sFilterSearchTerm) { - "use strict"; - var currentView = oCommonObject.isMatterView ? oGlobalConstants.Matter_ID : oGlobalConstants.Document_ID; - sFilterSearchTerm = sFilterSearchTerm + oCommonObject.formatSearchText(oCommonObject.sSearchedKeyword, currentView); - var oFilterDetails = { - ClientsList: [], PGList: "", AOLList: "", FromDate: "", ToDate: "", DocumentAuthor: [], FilterByMe: 1 - }; - var oParam = { "refinerValue": sRefinerValue, "filterFlyoutType": sFilterFlyoutType } - , oSortDetails = { ByProperty: sRefinerValue, Direction: 0 } //// Used for server side sorting - , oSearchDetails; - - if (1 === oCommonObject.iCurrentGridViewData()) { //// If All Matters section (flag is 1) is selected, then set filter by me flag to 0 - oFilterDetails.FilterByMe = 0; - } - - //// Add the column filters in the filter object - $.extend(oFilterDetails, oCommonObject.oFlyoutFilters()); - - var oCurrentFilter = jQuery.extend(true, {}, oFilterDetails); //// This is used so as not to update the current Filter - - //// Remove the current filter based on the refiner added - oCurrentFilter = commonConstants.updateFlyoutFilters(sRefinerValue, sFilterFlyoutType, true, oCurrentFilter, null); - - var sServiceCallName = (oCommonObject.isMatterView) ? "FindMatter" : "FindDocument"; - oSearchDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": oCommonObject.getDeployedUrl() - }, "searchObject": { - "PageNumber": commonConstants.iFilterFlyoutPageNumber, "ItemsPerPage": oGlobalConstants.FilterFlyoutItemsPerCall, "SearchTerm": sFilterSearchTerm, "Filters": oCurrentFilter, "Sort": oSortDetails - } - }; - oCommonObject.callSearchService(sServiceCallName, oSearchDetails, commonConstants.getColumnDataSuccess, commonConstants.getColumnDataFailure, commonConstants.getColumnDataOnBefore, oParam); - }, - /* Function to format the date which is required by KQL */ - formatDateForKQL: function (sCurrentDate) { - if ($.trim(sCurrentDate)) { - sCurrentDate = $.datepicker.formatDate("yy-mm-dd", new Date(sCurrentDate)); //// yy-mm-dd is the required format for KQL to work, hence this will not come from resource file - } else { - sCurrentDate = ""; - } - return sCurrentDate; - }, - flyoutSearchClick: function () { - oCommonObject.isAllRowSelected = false; - oCommonObject.iFilterFlyoutPageNumber(); //// Reset the page number of filter fly out to 1 - $("#filterResultsContainer").empty(); - oCommonObject.isSearchText = 0; - var oFilterFlyOut = $("#textFlyoutContent"); - if (oFilterFlyOut.length) { - var sRefinerName = oFilterFlyOut.attr("data-refinername") - , sFilterFlyoutType = oFilterFlyOut.attr("data-filterflyouttype"); - if (4 === oCommonObject.iCurrentGridViewData()) { - var sCurrentFilterText = $(".filterFlyoutSearchText").val().toLowerCase(); //// Current text in search panel - oGridViewObject.filterData; /// unfiltered data from the filter fly out - var arrFilteredData = []; - $.each(oGridViewObject.filterData, function (iCount, sCurrentValue) { - if (-1 < sCurrentValue.toLowerCase().indexOf(sCurrentFilterText)) { - arrFilteredData.push(sCurrentValue); - } - oCommonObject.populateFilterHTML(sRefinerName, sFilterFlyoutType, arrFilteredData); - }); - } else { - if ($.trim(sRefinerName) && $.trim(sFilterFlyoutType)) { - oCommonObject.arrUniqueRefinerData().length = 0; //// Refresh the array of values for filter fly out - var sFilterSearchTerm = oCommonObject.formatFilterSearchTerm(sRefinerName); - commonConstants.getColumnData(sRefinerName, sFilterFlyoutType, sFilterSearchTerm); - } - } - } - }, - /* Function to bind events to filter fly out */ - addFilterFlyoutBindings: function () { - //// Function to clear selected filters from fly out - $("#dateFlyoutContent .clearFilterText, #textFlyoutContent .clearFilterText").on("click", function () { - $("#textFlyoutContent, #dateFlyoutContent").addClass("hide"); //// Hide the filter fly out - var oThisObject = $(this) - , sCurrentFlyOutType = oThisObject && oThisObject.attr("data-clearfiltertype") - , oFilterFlyOut - , oGridRow = {}; - if (4 === oCommonObject.iCurrentGridViewData()) { - if ("text" === sCurrentFlyOutType) { - if (!oCommonObject.isMatterView) { - delete oPinnedFlyoutFilters.oSearchDocumentFilters[$("#textFlyoutContent").attr("data-refinername")]; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - } else { - delete oPinnedFlyoutFilters.oSearchMatterFilters[$("#textFlyoutContent").attr("data-refinername")]; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - } - } else if ("date" === sCurrentFlyOutType) { - if (!oCommonObject.isMatterView) { - delete oPinnedFlyoutFilters.oSearchDocumentFilters[$("#dateFlyoutContent").attr("data-refinername")]; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - } else { - delete oPinnedFlyoutFilters.oSearchMatterFilters[$("#dateFlyoutContent").attr("data-refinername")]; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - } - } - oGridRow = $(".GridRow, .GridRowAlternate"); - oGridView.highlightGridViewRow(oGridRow, false); - $("#attachDocuments").addClass("is-disabled"); - } else { - if ("text" === sCurrentFlyOutType) { - oFilterFlyOut = $("#textFlyoutContent"); - } else if ("date" === sCurrentFlyOutType) { - oFilterFlyOut = $("#dateFlyoutContent"); - } - if (oFilterFlyOut.length) { - var sRefinerName = oFilterFlyOut.attr("data-refinername") - , sFilterFlyoutType = oFilterFlyOut.attr("data-filterflyouttype"); - commonConstants.updateFlyoutFilters(sRefinerName, sFilterFlyoutType, true, oFlyoutFilters, oThisObject); - } - /* Pop out the value of current refiner */ - commonConstants.arrCurrentRefiner = $.grep(commonConstants.arrCurrentRefiner, function (sCurrentValue) { - return sCurrentValue !== sRefinerName; - }); - commonConstants.clearGridViewContent(); - (oCommonObject.isMatterView) ? getSearchMatters($("#gridView"), 1) : getSearchDocuments($("#gridView"), 1); - } - }); - - //// Function to perform a search inside filter fly out - $("#filterSearchIcon .ms-Icon--search").off().on("click", function (event) { - commonConstants.flyoutSearchClick(); - event && event.stopPropagation(); - }); - - //// Function to search in text box on click of enter - $(".filterFlyoutSearchText").off().on("keyup", function (event) { - if (13 === event.keyCode) {//// If enter key is pressed - commonConstants.flyoutSearchClick(); - } else { - var doneTypingInterval = 1000; ////time in ms, 1 second - ////On keyup, start the countdown - var nSearchTextLength = $(".filterFlyoutSearchText").val().trim().length; - if (3 <= nSearchTextLength) { - clearTimeout(commonConstants.iTypingTimer); - commonConstants.iTypingTimer = setTimeout(commonConstants.flyoutSearchClick, doneTypingInterval); - } - } - - }); - - //// Function to search on click of values in filter fly out - $(document).on("click", ".filterValueLabels", function (event) { - if ((4 === oCommonObject.iCurrentGridViewData()) || (event && event.target && event.target.className.indexOf("filterValueCheckbox") < 0)) { //// If click is not triggered by fabric component - var oFilterFlyOut = $("#textFlyoutContent") - , oThisObject = $(this); - if (oFilterFlyOut.length && oThisObject.length) { - var sRefinerName = oFilterFlyOut.attr("data-refinername") - , sFilterFlyoutType = oFilterFlyOut.attr("data-filterflyouttype"); - if (-1 === $.inArray(sRefinerName, commonConstants.arrCurrentRefiner)) { - commonConstants.arrCurrentRefiner.push(sRefinerName); - } - if ($.trim(sRefinerName) && $.trim(sFilterFlyoutType)) { - if (oCommonObject.isMatterView) { - ////#region Search Matters - if (4 === oCommonObject.iCurrentGridViewData()) { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindMatterConstants.GridViewPinnedTitleProperty: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterName = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - case oFindMatterConstants.FilterRefinerPinnedClientName: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterClient = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - case oFindMatterConstants.FilterRefinerPinnedSubAreaofLaw: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterSubAreaOfLaw = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - case oFindMatterConstants.FilterRefinerPinnedResponsibleAttorney: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterResponsibleAttorney = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - } - } - } else { - commonConstants.updateFlyoutFilters(sRefinerName, sFilterFlyoutType, false, null, oThisObject); - commonConstants.clearGridViewContent(); - getSearchMatters($("#gridView"), 1); - } - ////#endregion - } else { - ////#region Search Documents - if (4 === oCommonObject.iCurrentGridViewData()) { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindDocumentConstants.GridViewPinnedTitleProperty: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentName = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - case oFindDocumentConstants.FilterRefinerPinnedDocumentClient: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentClient = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - case oFindDocumentConstants.FilterRefinerPinnedAuthor: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentOwner = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - case oFindDocumentConstants.FilterRefinerPinnedCheckOutUser: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCheckoutUser = oThisObject.find("span").attr("title"); - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - - } - } - $("#attachDocuments").addClass("is-disabled"); - } else { - commonConstants.updateFlyoutFilters(sRefinerName, sFilterFlyoutType, false, null, oThisObject); - commonConstants.clearGridViewContent(); - getSearchDocuments($("#gridView"), 1); - } - //// #endregion - } - } - } - } - }); - - $(document).on("click", ".filterFlyoutText", function (event) { - event && event.stopPropagation(); - }); - - //// Function to perform operation on click of search field in filter fly out - $("#filterSearchBarHolder .filterFlyoutSearchText, #filterSearchBarHolder #filterTextPlaceHolder").on("click", function (event) { - $("#filterTextPlaceHolder").hide(); - event && event.stopPropagation(); - }); - - var $textField = $("#textFlyoutContent .ms-TextField"); - /* Bind JS of fabric component */ - $textField.textField(); /* Binding click event on search text box */ - }, - /* Function to format search term entered in the search box inside filter fly out */ - formatFilterSearchTerm: function (sRefinerName) { - var ofilterSearchText = $(".filterFlyoutSearchText").length ? $(".filterFlyoutSearchText").val() : "" - , sSearchQueryTerm = ""; - if ($.trim(ofilterSearchText)) { - sSearchQueryTerm = sRefinerName + ":" + ofilterSearchText + "*"; - } - return sSearchQueryTerm; - }, - /* Function to filter data in pinned section */ - filterData: function (filter, bflag, sRefinerName) { - var results = [], flag = true; - $.each(oCommonObject.pinnedData, function (key, value) { - $.each(filter, function (key, val) { - flag = true; - if (key != null && !(bflag && key === sRefinerName)) { - if ((!oCommonObject.isMatterView && (key === oFindDocumentConstants.FilterRefinerPinnedModifiedDate || key === oFindDocumentConstants.FilterRefinerPinnedCreatedDate)) || ((oCommonObject.isMatterView && (key === oFindMatterConstants.FilterRefinerPinnedCreatedDate || key === oFindMatterConstants.FilterRefinerPinnedModifiedDate)))) { - var sFromDate = (filter[key].sFromDate !== "") ? new Date(filter[key].sFromDate) : null; - var sToDate = (filter[key].sToDate !== "") ? new Date(filter[key].sToDate) : null; - var columnDate = new Date(value[key]); - if (sFromDate && sToDate) { - if (!(columnDate > sFromDate && columnDate < sToDate)) { - flag = false; - return false; - } - } else if (sFromDate && !sToDate) { - if (columnDate < sFromDate) { - flag = false; - return false; - } - } else if (!sFromDate && sToDate) { - if (columnDate > sToDate) { - flag = false; - return false; - } - } - } else { - if (-1 === value[key].indexOf(val)) { - flag = false; - return false; - } - } - } - }); - if (bflag) { - var arrSplitValues = []; - if ($.trim(value[sRefinerName])) { - arrSplitValues = value[sRefinerName] && value[sRefinerName].split(";"); - } - $.each(arrSplitValues, function (iCurrentCount, sValue) { - var sTrimmedValue = $.trim(sValue); - (flag && $.inArray(sTrimmedValue, oGridViewObject.filterData) === -1) && oGridViewObject.filterData.push(sTrimmedValue); - }); - } else { - flag && results.push(value); - } - - }); - oCommonObject.pinnedFilterData = results; - if (!bflag) { - var bNoResults = false; // Flag to check if there are no results - if (oCommonObject.pinnedFilterData.length === 0) { - oCommonObject.pinnedFilterData.push(oCommonObject.pinnedData[0]); // Add first object to get the structure - bNoResults = true; - } - var gridViewJSON = oGridView.generateGridViewJSON(); - if (gridViewJSON && gridViewJSON.length) { - var arrHeaderData, arrHeaderDataTitle; - if (oCommonObject.isMatterView) { - arrHeaderData = oFindMatterConstants.GridViewHeaderName.split(";"); - arrHeaderDataTitle = oFindMatterConstants.GridViewHeaderNameTitle.split("$|$"); - } else { - arrHeaderData = oFindDocumentConstants.GridViewHeaderName.split(";"); - arrHeaderDataTitle = oFindDocumentConstants.GridViewHeaderNameTitle.split("$|$"); - } - var oHeaderNames = [], oHeaderFilterType = []; - $.each(arrHeaderData, function (iItem, sCurrentValue) { - var oCurrentHeader = sCurrentValue && sCurrentValue.split(","); - oHeaderNames.push(oCurrentHeader[0]); - oCommonObject.oHeaderFilterType.push(oCurrentHeader[1]); - }); - //// Generate the common JSON structure for generating the grid view control - var GridConfig = { - container: "gridViewContainer", - data: results, - gridName: "Grid View", - gridHeader: oHeaderNames, - gridHeaderTitle: arrHeaderDataTitle, - columnNames: gridViewJSON, - sortby: "", - sortorder: "asc", - sortType: String, - initialsortorder: "", - retainpageonsort: false, - maxRows: oGridViewObject.itemsPerPage, - viewrecords: true, - pagination: false, - altRowColor: "white", - cellSpacing: 0 - }; - $("#gridViewContainer").empty(); - new oGrid.JsonGrid(GridConfig); - oGridView.bindECB(); - oGridView.addGridViewControlBindings(); - oCommonObject.configureOnLoadView(); //// Display the columns as per selection using column picker - //// Display the filter icon on the column header - var oFilteredKeys = { - }; - if (oCommonObject.isMatterView) { // Show filter for matters - oFilteredKeys = Object.keys(oPinnedFlyoutFilters.oSearchMatterFilters); - } else { // Show filter for documents - oFilteredKeys = Object.keys(oPinnedFlyoutFilters.oSearchDocumentFilters); - } - $.each(oFilteredKeys, function (sCurrentIndex, sCurrentValue) { - $(".jsonGridHeader[id=" + sCurrentValue + "]").find(".ms-Icon--filter").removeClass("hide"); - }); - } - if (bNoResults) { // Check if no results to show generic message - oCommonObject.pinnedFilterData.pop(); // Remove dummy element - oGrid.gridObject[0].data.pop(); // Remove dummy element - $("#gridViewContainer_Grid tbody tr").removeClass("hide").addClass("invisible"); - $("#gridViewContainer_Grid tbody").append(oGlobalConstants.No_Results_Message); - } - } - }, - /* Function to clear the fly out filters when search using advance search */ - clearFlyOutFilters: function (bIsAdvanceSearchCall) { - if (bIsAdvanceSearchCall) { //// Clear all the filters applied on grid view - if (oFlyoutFilters && oFlyoutFilters.DateFilters) { - oFlyoutFilters.Name = ""; - oFlyoutFilters.ClientName = ""; - oFlyoutFilters.DateFilters.ModifiedFromDate = ""; - oFlyoutFilters.DateFilters.ModifiedToDate = ""; - oFlyoutFilters.DateFilters.CreatedFromDate = ""; - oFlyoutFilters.DateFilters.CreatedToDate = ""; - oFlyoutFilters.DateFilters.OpenDateFrom = ""; - oFlyoutFilters.DateFilters.OpenDateTo = ""; - oFlyoutFilters.ResponsibleAttorneys = []; - oFlyoutFilters.SubareaOfLaw = ""; - oFlyoutFilters.DocumentCheckoutUsers = []; - oFlyoutFilters.DocumentAuthor = []; - } - } - }, - /* Function to clear the content of grid view */ - clearGridViewContent: function () { - oGridViewObject.pageNumber = 1; //// Reset the page number for grid view control - $("#gridViewContainer").off("scroll").empty(); //// Unbind the scroll event on the grid view and Remove the data from the grid view - $("#loadingImageContainer").removeClass("hide"); //// Hide the loading image of grid view control - }, - /* Function to configure on load view for grid view control */ - configureOnLoadView: function () { - //// This function will need to be modified in future, when user selection persistence will be implemented - var arrListHeaders = oCommonObject.isMatterView ? commonConstants.getArrayDifference(oFindMatterConstants.GridViewHeaderName.split(";"), oFindMatterConstants.GridViewNonDataColumns.split(";")) : commonConstants.getArrayDifference(oFindDocumentConstants.GridViewHeaderName.split(";"), oFindDocumentConstants.GridViewNonDataColumns.split(";")); - var nListHeaderCount = arrListHeaders.length; - var sCheckBoxSelector = "#options-checkbox-unselected"; - var arrDefaultColumns = []; - var nNonDataColumns = oCommonObject.isMatterView ? oFindMatterConstants.GridViewNonDataColumns.split(";").length : oFindDocumentConstants.GridViewNonDataColumns.split(";").length; - var nHeaderOptionMapping = 0, iIterator = 0; - if (oGridViewObject && !oGridViewObject.bDefaultSelectionChanged) { - arrDefaultColumns = oCommonObject.isMatterView ? oFindMatterConstants.GridViewDefaultColumns.split(";") : oFindDocumentConstants.GridViewDefaultColumns.split(";"); - for (iIterator = 1; iIterator <= nListHeaderCount - 1; iIterator++) { - if (-1 === $.inArray(arrListHeaders[iIterator], arrDefaultColumns)) { - nHeaderOptionMapping = iIterator + nNonDataColumns + 1; - $(".dataColumn" + (parseInt(iIterator) + 1)).parent().addClass("hide"); - $(".jsonGridHeader:nth-child(" + nHeaderOptionMapping + ")").addClass("hide"); - $(sCheckBoxSelector + iIterator).length ? $(sCheckBoxSelector + iIterator)[0].checked = false : ""; - $(sCheckBoxSelector).length ? $(sCheckBoxSelector)[0].checked = false : ""; - } else { - $(sCheckBoxSelector + iIterator).length ? $(sCheckBoxSelector + iIterator)[0].checked = true : ""; - } - } - } else if (oGridViewObject && oGridViewObject.bDefaultSelectionChanged && 0 < oGridViewObject.arrUserSelectedColumns.length) { - arrDefaultColumns = oGridViewObject.arrUserSelectedColumns; - for (iIterator = 1; iIterator <= nListHeaderCount - 1; iIterator++) { - if (-1 === $.inArray(arrListHeaders[iIterator].split(",")[0], arrDefaultColumns)) { - nHeaderOptionMapping = iIterator + nNonDataColumns + 1; - $(".dataColumn" + (parseInt(iIterator) + 1)).parent().addClass("hide"); - $(".jsonGridHeader:nth-child(" + nHeaderOptionMapping + ")").addClass("hide"); - $(sCheckBoxSelector + iIterator).length ? $(sCheckBoxSelector + iIterator)[0].checked = false : ""; - $(sCheckBoxSelector).length ? $(sCheckBoxSelector)[0].checked = false : ""; - } else { - $(sCheckBoxSelector + iIterator).length ? $(sCheckBoxSelector + iIterator)[0].checked = true : ""; - } - } - var nSelectedColumnCount = $("#columnOptions").find("input[type='checkbox']:checked").length; - var nTotalColumnCount = $("#columnOptions").find("input[type='checkbox']").length; - if (nTotalColumnCount - 1 === nSelectedColumnCount) { - $("#columnOptions").find("#options-checkbox-unselected").prop("checked", true); - } - } else { - for (var colIndex = 2; colIndex <= nListHeaderCount; colIndex++) { - if (0 < $(".dataColumn" + colIndex).length && $(".dataColumn" + colIndex).parent().hasClass("hide")) { - $(".dataColumn" + colIndex).parent().each(function () { $(this).addClass("hide"); }); - } - } - } - commonConstants.adjustCaretIcon(); - }, - /* Function to get the difference between two arrays */ - getArrayDifference: function (firstArray, secondArray) { - return $.grep(firstArray, function (item) { - return 0 > $.inArray(item, secondArray); - }); - }, - /* Function to update fly out filters */ - updateFlyoutFilters: function (sRefinerName, sFilterFlyoutType, bClearCurrentFilter, oFilterDetails, oThisObject) { - if ("date" === sFilterFlyoutType) { - if (sRefinerName === oGlobalConstants.Last_Modified_Time || sRefinerName === oGlobalConstants.Document_Last_Modified_Time) { - oFlyoutFilters.DateFilters.ModifiedFromDate = ""; - oFlyoutFilters.DateFilters.ModifiedToDate = ""; - } else if (oCommonObject.isMatterView && sRefinerName === oFindMatterConstants.FilterRefinerOpenDate) { - oFlyoutFilters.DateFilters.OpenDateFrom = ""; - oFlyoutFilters.DateFilters.OpenDateTo = ""; - } else if (!oCommonObject.isMatterView && sRefinerName === oFindDocumentConstants.FilterRefinerCreated) { - oFlyoutFilters.DateFilters.CreatedFromDate = ""; - oFlyoutFilters.DateFilters.CreatedToDate = ""; - } - return oFilterDetails; - } else { - if (oCommonObject.isMatterView) { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindMatterConstants.GridViewTitleProperty: //// Matter - if (bClearCurrentFilter) { - oFilterDetails.Name = ""; - } else { - oFlyoutFilters.Name = oThisObject.text(); - } - break; - case oFindMatterConstants.FilterRefinerClientName: //// Client - if (bClearCurrentFilter) { - oFilterDetails.ClientName = ""; - } else { - oFlyoutFilters.ClientName = oThisObject.text(); - } - break; - case oFindMatterConstants.FilterRefinerSubAreaofLaw: //// Sub area of law - if (bClearCurrentFilter) { - oFilterDetails.SubareaOfLaw = ""; - } else { - oFlyoutFilters.SubareaOfLaw = oThisObject.text(); - } - break; - case oFindMatterConstants.FilterRefinerResponsibleAttorney: //// Responsible Attorney - if (bClearCurrentFilter) { - oFilterDetails.ResponsibleAttorneys = ""; - } else { - oFlyoutFilters.ResponsibleAttorneys = oThisObject.text(); - } - break; - } - } - } else { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindDocumentConstants.GridViewTitleProperty: //// Document - if (bClearCurrentFilter) { - oFilterDetails.Name = ""; - } else { - oFlyoutFilters.Name = oThisObject.text(); - } - break; - case oFindDocumentConstants.FilterRefinerDocumentClient: //// Client - if (bClearCurrentFilter) { - oFilterDetails.ClientName = ""; - } else { - oFlyoutFilters.ClientName = oThisObject.text(); - } - break; - case oFindDocumentConstants.FilterRefinerAuthor: //// Author - if (bClearCurrentFilter) { - oFilterDetails.DocumentAuthor = ""; - } else { - oFlyoutFilters.DocumentAuthor = oThisObject.text(); - } - break; - case oFindDocumentConstants.FilterRefinerCheckOutUser: //// Check out user - if (bClearCurrentFilter) { - oFilterDetails.DocumentCheckoutUsers = ""; - } else { - oFlyoutFilters.DocumentCheckoutUsers = oThisObject.text(); - } - break; - } - } - } - } - return oFilterDetails; - }, - /* Function to filter grid view on date filters */ - filterGridViewOnDate: function (sFromDate, sToDate) { - var sRefinerName = $("#dateFlyoutContent").attr("data-refinername") - , sFilterFlyoutType = $("#dateFlyoutContent").attr("data-filterflyouttype"); - if (4 === oCommonObject.iCurrentGridViewData()) { - if (oCommonObject.isMatterView) { - switch (sRefinerName) { - case oFindMatterConstants.FilterRefinerPinnedModifiedDate: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate = { - }; - oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate.sFromDate = sFromDate; - oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate.sToDate = sToDate; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - case oFindMatterConstants.FilterRefinerPinnedCreatedDate: - oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate = { - }; - oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate.sFromDate = sFromDate; - oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate.sToDate = sToDate; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchMatterFilters, false, sRefinerName); - break; - } - } else { - switch (sRefinerName) { - case oFindDocumentConstants.FilterRefinerPinnedModifiedDate: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate = { - }; - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate.sFromDate = sFromDate; - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate.sToDate = sToDate; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - case oFindDocumentConstants.FilterRefinerPinnedCreatedDate: - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate = { - }; - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate.sFromDate = sFromDate; - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate.sToDate = sToDate; - commonConstants.filterData(oPinnedFlyoutFilters.oSearchDocumentFilters, false, sRefinerName); - break; - } - } - } else { - // Append time to "from" part of date if not null - if ($.trim(sFromDate)) { - sFromDate += oGlobalConstants.From_Date_Append_Time; - } - // Append time to "To" part of date if not null - if ($.trim(sToDate)) { - sToDate += oGlobalConstants.To_Date_Append_Time; - } - if (sRefinerName === oGlobalConstants.Last_Modified_Time || sRefinerName === oGlobalConstants.Document_Last_Modified_Time) { - oFlyoutFilters.DateFilters.ModifiedFromDate = sFromDate; - oFlyoutFilters.DateFilters.ModifiedToDate = sToDate; - - } else if (oCommonObject.isMatterView && sRefinerName === oFindMatterConstants.FilterRefinerOpenDate) { - oFlyoutFilters.DateFilters.OpenDateFrom = sFromDate; - oFlyoutFilters.DateFilters.OpenDateTo = sToDate; - } else if (!oCommonObject.isMatterView && sRefinerName === oFindDocumentConstants.FilterRefinerCreated) { - oFlyoutFilters.DateFilters.CreatedFromDate = sFromDate; - oFlyoutFilters.DateFilters.CreatedToDate = sToDate; - } - if (-1 === $.inArray(sRefinerName, commonConstants.arrCurrentRefiner)) { - commonConstants.arrCurrentRefiner.push(sRefinerName); - } - commonConstants.clearGridViewContent(); - (oCommonObject.isMatterView) ? getSearchMatters($("#gridView"), 1) : getSearchDocuments($("#gridView"), 1); - } - }, - /* Function to get the current sort details */ - getSortDetails: function (bIsFilterFlyoutCall) { - if (!bIsFilterFlyoutCall) { - if (1 === oCommonObject.iCurrentGridViewData()) { //// If All Matters/Documents section (flag is 1) is selected, then update the Sort filter - oCommonObject.oSortDetails().ByProperty = (oCommonObject.isMatterView) ? oFindMatterConstants.GridViewTitleProperty : oFindDocumentConstants.GridViewTitleProperty; - oCommonObject.oSortDetails().Direction = 0; - } else if (2 === oCommonObject.iCurrentGridViewData()) { //// If My Matters/Documents section (flag is 2) is selected, then update the Sort filter - oCommonObject.oSortDetails().ByProperty = oCommonObject.isMatterView ? oGlobalConstants.Last_Modified_Time : oGlobalConstants.Document_Last_Modified_Time; - oCommonObject.oSortDetails().Direction = 1; - } else { - oCommonObject.oSortDetails().ByProperty = ""; - oCommonObject.oSortDetails().Direction = 0; - } - } - }, - /* Function to update the positioning of the sort arrow based on the sort applied */ - updateSortingNotification: function () { - var oCurrentSortObject = oCommonObject.oSortDetails(); - if ($.trim(oCurrentSortObject.ByProperty)) { - //// Update the sorting notification in grid view header - var oCurrentHeader = $(".jsonGridHeader[id=" + oCurrentSortObject.ByProperty + "]"); - if (oCurrentSortObject.Direction) { //// Descending sort applied - oCurrentHeader.find(".sort").html("↓").removeClass("hide"); - } else { //// Ascending sort applied - oCurrentHeader.find(".sort").html("↑").removeClass("hide"); - } - } - //// Update the filter notification in grid view header - $.each(commonConstants.arrCurrentRefiner, function (iCurrentIndex, sCurrentValue) { - $(".jsonGridHeader[id=" + sCurrentValue + "]").find(".ms-Icon--filter").removeClass("hide"); - }); - }, - /* Function to bind scroll event on filter fly out */ - bindScrollOnFilterFlyout: function () { - $("#filterResultsContainer").on("scroll", function (event) { - if (4 !== oCommonObject.iCurrentGridViewData()) { //// no lazy loading for pinned section (flag = 4) - var oFilterObject = $(this); //// Filter Results container object - if (oFilterObject.length) { - var filterBodyVisibleHeight = oFilterObject.height(); - var filterScrollableHeight = oFilterObject.prop("scrollHeight"); - var filterHiddenContentHeight = filterScrollableHeight - filterBodyVisibleHeight; - //// Check if the remaining scrollable area (height of the hidden content - scroll top based upon overall content) is less then the threshold, to make the service call - if (!commonConstants.waitTillFilterDataLoaded && (filterHiddenContentHeight - oFilterObject.scrollTop() <= (oFilterObject.height() - (1 - (oGlobalConstants.FilterLazyLoadingLimit / 100)) * oFilterObject.height()))) { - var iMaxCurrentData = parseInt(oGlobalConstants.FilterFlyoutItemsPerCall) * (commonConstants.iFilterFlyoutPageNumber); - if (commonConstants.iColumnDataTotalResults > iMaxCurrentData) { - var oFilterFlyoutObject = $("#textFlyoutContent"); - if (oFilterFlyoutObject.length) { - var sRefinerName = oFilterFlyoutObject.attr("data-refinername") - , sFilterFlyoutType = oFilterFlyoutObject.attr("data-filterflyouttype") - , sFilterSearchTerm = oCommonObject.formatFilterSearchTerm(sRefinerName); - commonConstants.waitTillFilterDataLoaded = true; //// Throttle the next request till current service request is completed - commonConstants.iFilterFlyoutPageNumber++; - commonConstants.getColumnData(sRefinerName, sFilterFlyoutType, sFilterSearchTerm); - } - } - } - } - } - }); - }, - /* Function to highlight selected filters inside filter fly out */ - highlightSelectedFilters: function (sRefinerName, sFilterFlyoutType) { - if (oCommonObject.isMatterView) { - //// #region Matter View - if (4 === oCommonObject.iCurrentGridViewData()) { - if (oPinnedFlyoutFilters && oPinnedFlyoutFilters.oSearchMatterFilters) { - var oCurrentSearchFilter = oPinnedFlyoutFilters.oSearchMatterFilters; - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindMatterConstants.GridViewPinnedTitleProperty: - if (oCurrentSearchFilter.hasOwnProperty("MatterName")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchMatterFilters.MatterName + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchMatterFilters.MatterName && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchMatterFilters.MatterName); - } - break; - case oFindMatterConstants.FilterRefinerPinnedClientName: - if (oCurrentSearchFilter.hasOwnProperty("MatterClient")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchMatterFilters.MatterClient + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchMatterFilters.MatterClient && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchMatterFilters.MatterClient); - } - break; - case oFindMatterConstants.FilterRefinerPinnedSubAreaofLaw: - if (oCurrentSearchFilter.hasOwnProperty("MatterSubAreaOfLaw")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchMatterFilters.MatterSubAreaOfLaw + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchMatterFilters.MatterSubAreaOfLaw && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchMatterFilters.MatterSubAreaOfLaw); - } - break; - case oFindMatterConstants.FilterRefinerPinnedResponsibleAttorney: - if (oCurrentSearchFilter.hasOwnProperty("MatterResponsibleAttorney")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchMatterFilters.MatterResponsibleAttorney + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchMatterFilters.MatterResponsibleAttorney && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchMatterFilters.MatterResponsibleAttorney); - } - break; - } - } - } - } else { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindMatterConstants.GridViewTitleProperty: //// Matter - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.Name + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.Name && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.Name); - break; - case oFindMatterConstants.FilterRefinerClientName: //// Client - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.ClientName + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.ClientName && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.ClientName); - break; - case oFindMatterConstants.FilterRefinerSubAreaofLaw: //// Sub area of law - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.SubareaOfLaw + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.SubareaOfLaw && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.SubareaOfLaw); - break; - case oFindMatterConstants.FilterRefinerResponsibleAttorney: //// Responsible Attorney - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.ResponsibleAttorneys + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.ResponsibleAttorneys && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.ResponsibleAttorneys); - break; - } - } - } - //// #endregion - } else { - //// #region Document View - if (4 === oCommonObject.iCurrentGridViewData()) { - if (oPinnedFlyoutFilters && oPinnedFlyoutFilters.oSearchDocumentFilters) { - var oCurrentSearchFilter = oPinnedFlyoutFilters.oSearchDocumentFilters; - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindDocumentConstants.GridViewPinnedTitleProperty: - if (oCurrentSearchFilter.hasOwnProperty("DocumentName")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentName + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentName && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentName); - } - break; - case oFindDocumentConstants.FilterRefinerPinnedDocumentClient: - if (oCurrentSearchFilter.hasOwnProperty("DocumentClient")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentClient + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentClient && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentClient); - } - break; - case oFindDocumentConstants.FilterRefinerPinnedAuthor: - if (oCurrentSearchFilter.hasOwnProperty("DocumentOwner")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentOwner + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentOwner && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentOwner); - } - break; - case oFindDocumentConstants.FilterRefinerPinnedCheckOutUser: - if (oCurrentSearchFilter.hasOwnProperty("DocumentCheckoutUser")) { - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCheckoutUser + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCheckoutUser && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCheckoutUser); - } - break; - } - } - } - } else { - if ("singleselect" === sFilterFlyoutType.toLowerCase()) { - switch (sRefinerName) { - case oFindDocumentConstants.GridViewTitleProperty: //// Document - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.Name + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.Name && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.Name); - break; - case oFindDocumentConstants.FilterRefinerDocumentClient: //// Client - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.ClientName + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.ClientName && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.ClientName); - break; - case oFindDocumentConstants.FilterRefinerAuthor: //// Author - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.DocumentAuthor + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.DocumentAuthor && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.DocumentAuthor); - break; - case oFindDocumentConstants.FilterRefinerCheckOutUser: //// CheckOut User - var oCurrentSelectedValue = $(".filterValueLabels").find("span[title='" + oFlyoutFilters.DocumentCheckoutUsers + "']"); - if (oCurrentSelectedValue.length && oCurrentSelectedValue.parent().length) { - oCurrentSelectedValue.parent().addClass("selectedValue"); - } - oFlyoutFilters.DocumentCheckoutUsers && oCommonObject.isSearchText && $(".filterFlyoutSearchText").click().val(oFlyoutFilters.DocumentCheckoutUsers); - break; - } - } - } - ////#endregion - } - }, - /* Function to set the date values in the 'From' and 'To' field */ - setDateFields: function (oFromFilter, oToFilter, sFromFilterValue, sToFilterValue) { - var oCurrentTime = new Date(); - var iIndex = 0; - if ($.trim(sFromFilterValue)) { - // Check if time value is present in the variable - iIndex = sFromFilterValue.indexOf("T"); - if (-1 !== iIndex) { - sFromFilterValue = sFromFilterValue.substring(0, sFromFilterValue.indexOf("T")); - } - var sFromDate = new Date(sFromFilterValue.replace(/-/g, "/")); - oFromFilter.val($.datepicker.formatDate(oGlobalConstants.DatePickerFormat, sFromDate)); - } else { - oFromFilter.val(""); - } - if ($.trim(sToFilterValue)) { - // Check if time value is present in the variable - iIndex = sToFilterValue.indexOf("T"); - if (-1 !== iIndex) { - sToFilterValue = sToFilterValue.substring(0, sToFilterValue.indexOf("T")); - } - var sToDate = new Date(sToFilterValue.replace(/-/g, "/")); - oToFilter.val($.datepicker.formatDate(oGlobalConstants.DatePickerFormat, sToDate)); - } else { - oToFilter.val(""); - } - - // Check if null values are set in date then disable the button - if (!oToFilter.val() && !oFromFilter.val()) { - $("#btnOK").removeClass("activateButton"); - } - //// Set the min and max dates in the date picker control - $("#dateFlyoutContent .filterFlyoutToText").datepicker("option", "minDate", oFromFilter.val()); - $("#dateFlyoutContent .filterFlyoutFromText").datepicker("option", "maxDate", oToFilter.val() || "+0D"); - }, - /* Function to set the date filters */ - setDateFilters: function (sRefinerName, sFilterFlyoutType) { - var oFromDate = $(".filterFlyoutFromText"), oToDate = $(".filterFlyoutToText"); - oCommonObject.isAllRowSelected = false; - if (oFromDate.length && oToDate.length) { - if (4 === oCommonObject.iCurrentGridViewData()) { //// Update the filters for pinned section - if (oCommonObject.isMatterView) { - if (sRefinerName === oFindMatterConstants.FilterRefinerPinnedModifiedDate) { - if (oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate) { - commonConstants.setDateFields(oFromDate, oToDate, oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate.sFromDate, oPinnedFlyoutFilters.oSearchMatterFilters.MatterModifiedDate.sToDate); - } - } else if (sRefinerName === oFindMatterConstants.FilterRefinerPinnedCreatedDate) { - if (oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate) { - commonConstants.setDateFields(oFromDate, oToDate, oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate.sFromDate, oPinnedFlyoutFilters.oSearchMatterFilters.MatterCreatedDate.sToDate); - } - } - } else { - if (sRefinerName === oFindDocumentConstants.FilterRefinerPinnedModifiedDate) { - if (oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate) { - commonConstants.setDateFields(oFromDate, oToDate, oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate.sFromDate, oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentModifiedDate.sToDate); - } - } else if (sRefinerName === oFindDocumentConstants.FilterRefinerPinnedCreatedDate) { - if (oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate) { - commonConstants.setDateFields(oFromDate, oToDate, oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate.sFromDate, oPinnedFlyoutFilters.oSearchDocumentFilters.DocumentCreatedDate.sToDate); - } - } - } - } else { - if (sRefinerName === oGlobalConstants.Last_Modified_Time || sRefinerName === oGlobalConstants.Document_Last_Modified_Time) { - commonConstants.setDateFields(oFromDate, oToDate, oFlyoutFilters.DateFilters.ModifiedFromDate, oFlyoutFilters.DateFilters.ModifiedToDate); - } else if (oCommonObject.isMatterView && sRefinerName === oFindMatterConstants.FilterRefinerOpenDate) { - commonConstants.setDateFields(oFromDate, oToDate, oFlyoutFilters.DateFilters.OpenDateFrom, oFlyoutFilters.DateFilters.OpenDateTo); - } else if (!oCommonObject.isMatterView && sRefinerName === oFindDocumentConstants.FilterRefinerCreated) { - commonConstants.setDateFields(oFromDate, oToDate, oFlyoutFilters.DateFilters.CreatedFromDate, oFlyoutFilters.DateFilters.CreatedToDate); - } - } - } - }, - /* Updates the position of caret icon for last visible column in grid view */ - adjustCaretIcon: function () { - $(".jsonGridHeader .ms-Icon--caretDown").length && $(".jsonGridHeader .ms-Icon--caretDown").removeClass("lastCaretIcon").addClass("firstCaretIcon"); - $(".jsonGridHeader:visible:last .ms-Icon--caretDown").length && $(".jsonGridHeader:visible:last .ms-Icon--caretDown").removeClass("firstCaretIcon").addClass("lastCaretIcon"); - }, - /* Function to move filter fly out inside grid view control */ - moveFilterFlyout: function () { - var sTextFlyoutWrapper = "
    " - , sDateFlyoutWrapper = "
    "; - //// Remove the already present filter fly outs inside grid view - $("#textFlyoutContent, #dateFlyoutContent").remove(); - //// Move both the date and text fly out inside filter fly outs - $("#gridViewContainer").append(sTextFlyoutWrapper); - $("#gridViewContainer").append(sDateFlyoutWrapper); - //// Populate the filter fly outs with the HTML from the original fly outs - $("#textFlyoutContent").html($(".textFlyoutContent").html()); - $("#dateFlyoutContent").html($(".dateFlyoutContent").html()); - //// Hide both the fly outs - $("#textFlyoutContent, #dateFlyoutContent").addClass("hide"); - //// Bind the events on the new filter fly outs - commonConstants.addFilterFlyoutBindings(); - commonConstants.bindDatePickerControl(); - }, - /* Bind the date picker */ - bindDatePickerControl: function () { - $("#dateFlyoutContent .filterFlyoutFromText").datepicker({ - dateFormat: oGlobalConstants.DatePickerFormat, - buttonImage: "../Images/Calendar_30px_X_30px_color_666.png", - buttonImageOnly: true, - showOn: "both", - changeMonth: true, - changeYear: true, - yearRange: oGlobalConstants.DatePickerFromYearRange, - constrainInput: true, - duration: "", - gotoCurrent: true, - maxDate: oGlobalConstants.DatePickerToMaxDate, - onClose: function (selectedDate) { - commonConstants.onCloseEvent(selectedDate, 0); - } - }).datepicker(); - $("#dateFlyoutContent .filterFlyoutToText, #dateFlyoutContent .filterImageToDatePicker").datepicker({ - dateFormat: oGlobalConstants.DatePickerFormat, - buttonImage: "../Images/Calendar_30px_X_30px_color_666.png", - buttonImageOnly: true, - showOn: "both", - changeMonth: true, - changeYear: true, - yearRange: oGlobalConstants.DatePickerToYearRange, - constrainInput: true, - duration: "", - gotoCurrent: true, - maxDate: oGlobalConstants.DatePickerToMaxDate, - onClose: function (selectedDate) { - commonConstants.onCloseEvent(selectedDate, 1); - } - }).datepicker(); - /* Filtering of List according to Modified Date takes place on click of OK button*/ - $("#btnOK").click(function () { - var sFromDate = $(".filterFlyoutFromText").val(); - var sToDate = $(".filterFlyoutToText").val(); - var sFromFormatDate = commonConstants.formatDateForKQL(sFromDate); - var sToFormatDate = commonConstants.formatDateForKQL(sToDate); - if ($.trim(sFromFormatDate) || $.trim(sToFormatDate)) { - commonConstants.filterGridViewOnDate($.trim(sFromFormatDate), $.trim(sToFormatDate)); - $("#btnOK").addClass("activateButton"); - $("#attachDocuments").addClass("is-disabled"); - } else { - $("#btnOK").removeClass("activateButton"); - } - }); - $(".ui-datepicker").click(function (event) { - commonFunction.closeAllFilterExcept("ui-datepicker", event); - event.stopPropagation(); - }); - }, - /* Common Date Picker Function For Applying Limit on Max and Min Dates */ - onCloseEvent: function (selectedDate, limit) { - var sFromDate = $(".filterFlyoutFromText").val(); - var sToDate = $(".filterFlyoutToText").val(); - if (1 === limit) { - $("#dateFlyoutContent .filterFlyoutFromText").datepicker("option", "maxDate", selectedDate); - } else { - $("#dateFlyoutContent .filterFlyoutToText").datepicker("option", "minDate", selectedDate); - } - if (sFromDate.length || sToDate.length) { - $("#btnOK").addClass("activateButton"); - } else { - $("#btnOK").removeClass("activateButton"); - } - }, - /* Update the multi select filters */ - updateMultiSelectServerFilters: function (oThisObject, oCurrentFilter, sRefinerName) { - //// If check box is previously checked then this value will be true - if (oThisObject.find(".filterValueCheckbox").length && !oThisObject.find(".filterValueCheckbox")[0].checked && -1 === $.inArray(oThisObject.text(), oCurrentFilter)) { - oCurrentFilter.push(oThisObject.text()); - } else { - /* Pop out the value of current filter from the list */ - oCurrentFilter = $.grep(oCurrentFilter, function (sCurrentValue) { - return sCurrentValue !== oThisObject.text(); - }); - if (0 === oCurrentFilter.length) { - commonConstants.arrCurrentRefiner = $.grep(commonConstants.arrCurrentRefiner, function (sCurrentValue) { - return sCurrentValue !== sRefinerName; - }); - } - } - return oCurrentFilter; - }, - /* Function to delete all the client filters */ - clearClientFlyOutFilters: function () { - oPinnedFlyoutFilters = { - oSearchMatterFilters: { - }, - oSearchDocumentFilters: { - } - }; - oCommonObject.pinnedFilterData.length = 0; - }, - - // Function to get the notification message to be displayed while performing upload - getNotificationContent: function (sMsg, sContentCheckMsg, sOptionContent) { - "use strict"; - var sMsgTitle = document.createElement("div"); - sMsgTitle.innerHTML = sMsg; - sMsgTitle = $(sMsgTitle).text(); - - var sContentResult = "
    " + sContentCheckMsg + "
    "; - var sContent = ""; - if ("undefined" !== typeof sContentCheckMsg && "" === sContentCheckMsg.trim()) { - sContentResult = "
    " + sContentCheckMsg + "
    "; - } - if (oGridConfig.inWebDashboard) { - sContent = "
    \"Warning
    " + sMsg + "
    " + sContentResult + "
    " + sOptionContent + "
    "; - } else { - sContent = "
    \"Warning
    " + sMsg + "
    " + sContentResult + "
    " + sOptionContent + "
    "; - } - return sContent; - }, - - // Function to continue upload, in case operation failed while getting the content check configuration from list - continueUpload: function () { - "use strict"; - $(".mailContainer .warningnotification").remove(); - oCommonObject.updateUploadPopupHeight(false); - }, - - // Function to display notification, in case operation failed while getting the content check configuration from list - showContentCheckConfigError: function () { - "use strict"; - var sMsg = oGlobalConstants.Upload_Content_Check_Setting_Failed; - var sOptionContent = ""; - var sContent = oCommonObject.getNotificationContent(sMsg, "", sOptionContent); - oCommonObject.updateUploadPopupHeight(true); - (oGridConfig.inWebDashboard) ? $(".notificationContainerForMailPopup").append(sContent) : $(".notificationContainerForPopup").append(sContent); - }, - - // Function to get the content check configuration from the list - getContentCheckConfigurations: function (sMatterUrl) { - "use strict"; - var matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "siteCollectionPath": sMatterUrl - }; - oCommonObject.callProvisioningService("GetDefaultMatterConfigurations", matterDetails, commonConstants.getContentCheckConfigurationSuccess, commonConstants.getContentCheckConfigurationFailure); - }, - - // Function to be called on success while retrieving content check configuration from service - getContentCheckConfigurationSuccess: function (result) { - "use strict"; - if (null != result) { - var matterConfigurations = JSON.parse(result.split("|$|")[0]); - if (matterConfigurations && "undefined" !== typeof matterConfigurations.IsContentCheck) { - oUploadGlobal.bAllowContentCheck = matterConfigurations.IsContentCheck; - } else { - oUploadGlobal.bAllowContentCheck = false; - //// Yellow banner to notify user that content check can not be performed - commonConstants.showContentCheckConfigError(); - } - } - }, - - // Function to be called on failure while retrieving content check configuration from service - getContentCheckConfigurationFailure: function (result) { - "use strict"; - oUploadGlobal.bAllowContentCheck = false; - //// Yellow banner to notify user that content check can not be performed - commonConstants.showContentCheckConfigError(); - }, - - // Function to Abort the content check operation - abortContentCheck: function (isLocalUpload) { - "use strict"; - if ("undefined" !== typeof oUploadGlobal.oXHR) { - oUploadGlobal.oXHR.abort(); - oUploadGlobal.bIsAbortedCC = true; - //// Show other three options on notification bar. - var onClickFunction = (isLocalUpload) ? "oCommonObject.localOverWriteDocument" : "overWriteDocument"; - var sAppendContent = ""; - if (!isLocalUpload) { - $(".uploadDocumentLoading").remove(); - } - if ("undefined" !== oUploadGlobal.bAppendOptionEnabled && oUploadGlobal.bAppendOptionEnabled) { - sAppendContent = ""; - } - var sOptionContent = "" + sAppendContent + ""; - $(".notification").remove(); - var sContent = oCommonObject.getNotificationContent(oUploadGlobal.sNotificationMsg, oGlobalConstants.Content_Check_Abort, sOptionContent); - (oGridConfig.inWebDashboard) ? $(".notificationContainerForMailPopup").append(sContent) : $(".notificationContainerForPopup").append(sContent); - } - }, - - // Function to generate the content check notification message - contentCheckNotification: function (isLocalUpload) { - "use strict"; - //// Clear up existing message and display new message - $(".notification").remove(); - var sMsg = oUploadGlobal.sNotificationMsg; - var sOptions = "
    " + oGlobalConstants.Performing_Content_Check + "
    "; - var sContent = oCommonObject.getNotificationContent(sMsg, "", sOptions); - oCommonObject.updateUploadPopupHeight(true); - (oGridConfig.inWebDashboard) ? $(".notificationContainerForMailPopup").append(sContent) : $(".notificationContainerForPopup").append(sContent); - }, - // Function to enable autocomplete text box and search box - enableSearch: function () { - $(".ms-Icon--search")[0].disabled = false; - $("#autoCompleteText").removeAttr("disabled", "disabled").removeClass("is-disabled"); - }, - disableSearch: function () { - $(".ms-Icon--search")[0].disabled = true; - $("#autoCompleteText").attr("disabled", "disabled").addClass("is-disabled"); - }, - - //// Updates GridView for matters/documents - updateGridView: function () { - (oCommonObject.isMatterView) ? getPinnedMatters($("#gridView")) : getPinnedDocument($("#gridView")); - if (oGridViewObject.isPageLoad) { - (oCommonObject.isMatterView) ? getSearchMatters($("#gridView"), 1) : getSearchDocuments($("#gridView"), 1); - } else { - (oCommonObject.isMatterView) ? getSearchMatters($("#gridView"), 0) : getSearchDocuments($("#gridView"), 0); - oGridViewObject.isPageLoad = 1; - } - }, - /* Function to set attributes to View document landing page button and bind click event */ - updateDocumentLandingAttributes: function ($Element) { - var oViewDocumentLanding = $("#viewDocumentLandingPage"); - if (oViewDocumentLanding && oViewDocumentLanding.length) { - var sClientRelativeURL, sLibraryName, sDocumentMatterUrl; - if (4 === oCommonObject.iCurrentGridViewData() || 1 === oGridConfig.currentView) { - sClientRelativeURL = commonConstants.getClientURL($Element); - } else { - sClientRelativeURL = $Element.attr("data-" + oGlobalConstants.SP_Web_Url); //// This will get correct URL in case of sub-site as well - } - if (sClientRelativeURL) { - oViewDocumentLanding.attr({ "client": sClientRelativeURL.replace(oGlobalConstants.Site_Url, "") }); - //// set the doc id based on service call - } - /* Function to navigate user to document landing page */ - oViewDocumentLanding.off().on("click", function () { - var oCurrentDocument = $(this); - if (oCurrentDocument && oCurrentDocument.length) { - var sClient, sListGUID, sDocumentId, sDocumentLandingURL, sQueryString; - sClient = oCurrentDocument.attr("client"); - sListGUID = oCurrentDocument.attr("listGUID"); - sDocumentId = oCurrentDocument.attr("documentGUID"); - sQueryString = "client=" + encodeURIComponent(sClient) + "&listguid=" + encodeURIComponent(sListGUID) + "&docguid=" + encodeURIComponent(sDocumentId); - sDocumentLandingURL = oGlobalConstants.Central_Repository_Url + oGlobalConstants.DocumentLandingURL + "?" + sQueryString; - if ("undefined" !== typeof oWebDashboardConstants) { - window.open(sDocumentLandingURL, "_parent"); - } else { - commonConstants.openWindow(sDocumentLandingURL, "_blank"); - } - } - }); - } - $("#openDocument").off().on("click", function () { - var sDocumentURL = ""; - sDocumentURL = $(this).attr("data-link"); - if ("undefined" !== typeof oWebDashboardConstants) { - window.open(sDocumentURL, "_parent"); - } else { - commonConstants.openWindow(sDocumentURL, "_blank"); - } - }); - }, - /* Function to execute in case of success while getting document assets */ - getDocumentLandingAssetsSuccess: function (oResult) { - "use strict"; - if (oResult) { - var results = JSON.parse(oResult); - if (!results.code) { - var results = results.value.split("$|$"); - if (results[0] && results[1]) { - var oViewDocumentLanding = $("#viewDocumentLandingPage"); - if (oViewDocumentLanding && oViewDocumentLanding.length) { - oViewDocumentLanding.attr({ "listGUID": results[0], "documentGUID": results[1] }); - } - } else { - $("#viewDocumentLandingPage").off().addClass("disableButton"); - } - - if (oGridConfig.inWebDashboard) { - $("#documentPopupLoading").addClass("hide"); - $(".documentPopupData").removeClass("hide"); - } else { - $("#FlyoutPopupLoading").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find(".ms-Callout-inner").removeClass("hide"); - } - } else { - showCommonErrorPopUp(results.code); - } - } - }, - - /* Function to execute in case of failure while getting document assets */ - getDocumentLandingAssetsFailure: function (oResult) { - "use strict"; - showCommonErrorPopUp(oResult.Result); - }, - - getDocumentLandingAssets: function (oElement) { - "use strict"; - var $Element = $(oElement); - if ($Element.length) { - var sDocumentPath, sClientRelativeURL, sDocumentLibrary, sClient, sClientURL; - if (4 === oCommonObject.iCurrentGridViewData() || 1 === oGridConfig.currentView) { - sDocumentPath = $Element.attr("data-" + oGlobalConstants.GridViewPinnedDocumentUrl); - sClientURL = commonConstants.getClientURL($Element); - } else { - sDocumentPath = trimEndChar($Element.attr("data-" + oGlobalConstants.Path), "/"); - sClientURL = $Element.attr("data-" + oGlobalConstants.SP_Web_Url); //// This will get correct URL in case of sub-site as well - } - if (sClientURL) { - sDocumentPath = sDocumentPath.replace(oGlobalConstants.Site_Url, ""); - sClientRelativeURL = sClientURL.replace(oGlobalConstants.Site_Url, ""); - sClient = new RegExp(sClientRelativeURL, "gi"); - sDocumentLibrary = sClientRelativeURL + "/" + sDocumentPath.replace(sClient, "").split("/")[1]; - } - - //// call service with sDocumentName, sDocumentLibrary and sParentRelativeURL - var oDocumentDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Id": decodeURIComponent(sDocumentPath), "Name": decodeURIComponent(sDocumentLibrary), "Url": decodeURIComponent(sClientURL) - } - }; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Go_To_Document_Landing, true); - oCommonObject.callSearchService("GetDocumentAssets", oDocumentDetails, commonConstants.getDocumentLandingAssetsSuccess, commonConstants.getDocumentLandingAssetsFailure); - } - }, - getClientURL: function (oElement) { - var sClientURL, sLibraryName, sDocumentMatterUrl, sReplaceData; - sDocumentMatterUrl = oElement.attr("data-documentmatterurl"); - if (sDocumentMatterUrl) { - sReplaceData = sDocumentMatterUrl.split("/"); - sLibraryName = sReplaceData[sReplaceData.length - 1]; - sClientURL = sDocumentMatterUrl.replace("/" + sLibraryName, ""); - } - return sClientURL; - }, - - /* Function to check if content is present, otherwise return "NA" */ - renderStringContent: function (sValue) { - sValue = sValue.trim(); - return (sValue) ? sValue : "NA"; - }, - getDecodeURIComponent: function (sValue) { - sValue = decodeURIComponent(trimEndChar($.trim(sValue), "/").toLowerCase()); - return (sValue) ? sValue : ""; - }, - - /* Function to open link according to provided parameter */ - openWindow: function (url, target) { - window.open(url, target, "menubar=yes,toolbar=yes,location=yes,scrollbars=yes,resizable=yes"); - }, - /* Function to set attributes used for upload functionality */ - addUploadAttributes: function (sOriginalName, sMatterGuid) { - if ("undefined" !== typeof sOriginalName && sOriginalName) { - $("#mailContent").attr("data-originalname", sOriginalName.trim()); - } - if ("undefined" !== typeof sMatterGuid && sMatterGuid) { - $("#mailContent").attr("data-matterguid", sMatterGuid.trim()); - } - }, - /* Function to get the name of root folder for matter library */ - getRootFolderForMatter: function (sCurrentFolderName) { - //// Set the folder name once upload is completed - var sMatterGUID = $("#mailContent").attr("data-matterguid"), - sFolderName = ""; - if (sMatterGUID === sCurrentFolderName) { - //// If upload if performed on root folder, display the matter title instead of matter GUID - sFolderName = $("#mailContent").attr("data-originalname"); - } else { - //// else display the returned folder from the service - sFolderName = sCurrentFolderName; - } - return sFolderName; - }, - /* Function to encode html */ - htmlEncode: function (sValue) { - return $("
    ").text(sValue).html(); - } - }; - ////#endregion - - ////#region Filter for advance search - /* JSON object to hold the filters for columns on grid view - Server side */ - var oFlyoutFilters = { - Name: "", - ClientName: "", - DateFilters: { - ModifiedFromDate: "", - ModifiedToDate: "", - CreatedFromDate: "", - CreatedToDate: "", - OpenDateFrom: "", - OpenDateTo: "" - }, - ResponsibleAttorneys: [], - SubareaOfLaw: "", - DocumentCheckoutUsers: [], - DocumentAuthor: [] - }; - /* JSON object to hold the filters for columns on grid view - Client side */ - var oPinnedFlyoutFilters = { - oSearchMatterFilters: { - }, - oSearchDocumentFilters: { - } - }; - ////#endregion - - /* Return the object which will have functions called from external files */ - return { - callProvisioningService: function (sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam) { - commonConstants.sServiceLocation = commonConstants.sProvisioningServiceLocation; - commonConstants.callService(sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam); - }, - callSearchService: function (sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam) { - commonConstants.sServiceLocation = commonConstants.sSearchServiceLocation; - commonConstants.callService(sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam); - }, - callLegalBriefcase: function (sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam) { - commonConstants.sServiceLocation = commonConstants.sLegalBriefcaseLocation; - commonConstants.callService(sWebMethodName, oParameters, onSuccess, onFailure, onBeforeSend, oParam); - }, - highlightTerm: function (sResult, sTerm) { - return commonConstants.highlightTerm(sResult, sTerm); - }, - formatSearchText: function (sSearchTerm, sRefinerString) { - return commonConstants.formatSearchText(sSearchTerm, sRefinerString); - }, - getRecentMatters: function (container, pageNumber, isPage, source) { - return commonConstants.getRecentMatters(container, pageNumber, isPage, source); - }, - getRecentDocuments: function (container, pageNumber, isPage, source, event) { - return commonConstants.getRecentDocuments(container, pageNumber, isPage, source, event); - }, - getDeployedUrl: function () { - return commonConstants.getDeployedUrl(); - }, - getAppSwitcher: function (sAppName) { - return commonConstants.getAppSwitcher(sAppName); - }, - renderAsText: function (text) { - return commonConstants.renderAsText(text); - }, - getSearchData: function (event) { - return commonConstants.getSearchData(event); - }, - getParameterByName: function (sParameterName) { - return commonConstants.getParameterByName(sParameterName); - }, - checkDateValid: function (fromDateText, toDateText) { - return commonConstants.checkDateValid(fromDateText, toDateText); - }, - ExtractFileTitle: function (fileNameWithExtn) { - return commonConstants.ExtractFileTitle(fileNameWithExtn); - }, - logEvent: function (eventName) { - commonConstants.logEvent(eventName); - }, - updateNotificationPosition: function () { - return commonConstants.updateNotificationPosition(); - }, - showNotification: function (sMsg, resultClass) { - return commonConstants.showNotification(sMsg, resultClass); - }, - localOverWriteDocument: function (oDocument) { - return commonConstants.localOverWriteDocument(oDocument); - }, - overwriteConfiguration: function (fileName) { - return commonConstants.overwriteConfiguration(fileName); - }, - updateUploadPopupHeight: function (increaseHeight) { - return commonConstants.updateUploadPopupHeight(increaseHeight); - }, - bindAutocomplete: function (sSelector, bIsMultiUser) { - return commonConstants.bindAutocomplete(sSelector, bIsMultiUser); - }, - getUserName: function (sUserEmails, bIsName) { - return commonConstants.getUserName(sUserEmails, bIsName); - }, - oSiteUser: commonConstants.oSiteUser, - getWidth: function () { - return commonConstants.getWidth(); - }, - bHideAutoComplete: commonConstants.bHideAutoComplete, - isMatterView: commonConstants.isMatterView, - iCurrentGridViewData: function () { - return commonConstants.iCurrentGridViewData; - }, - sCurrentPage: commonConstants.sCurrentPage, - userPinnedData: commonConstants.userPinnedData, - pinnedData: commonConstants.pinnedData, - updatePinnedStatus: function () { - commonConstants.updatePinnedStatus(); - }, - checkMatterLandingURL: function (sClientURL, sOneNoteURL, sMatterLandingPageURL, sMatterLibraryURL, oContextualMenu) { - commonConstants.checkMatterLandingURL(sClientURL, sOneNoteURL, sMatterLandingPageURL, sMatterLibraryURL, oContextualMenu); - }, - generateCommonDropdown: function (sDropdownSelector, sDropdownFields) { - commonConstants.generateCommonDropdown(sDropdownSelector, sDropdownFields); - }, - generateColumnPicker: function (sColumnPickerSelector, sColumnPickerFields) { - commonConstants.generateColumnPicker(sColumnPickerSelector, sColumnPickerFields); - }, - addDropdownBindings: function () { - commonConstants.addDropdownBindings(); - }, - addAutoCompleteBindings: function () { - commonConstants.addAutoCompleteBindings(); - }, - autoCompleteSearch: function () { - commonConstants.autoCompleteSearch(); - }, - addColumnPickerBindings: function () { - commonConstants.addColumnPickerBindings(); - }, - onColumnPickerCheckboxClick: function (iIndex, event) { - commonConstants.onColumnPickerCheckboxClick(iIndex, event); - }, - onGridViewCheckboxClick: function () { - commonConstants.onGridViewCheckboxClick(); - }, - getAutoCompleteDataFailure: function (result) { - commonConstants.getAutoCompleteDataFailure(result); - }, - getAutoCompleteDataSuccess: function (result) { - commonConstants.getAutoCompleteDataSuccess(result); - }, - getAutoCompleteData: function () { - commonConstants.getAutoCompleteData(); - }, - getIconSource: function (sExtension) { - return commonConstants.getIconSource(sExtension); - }, - closeAllPopupExcept: function (divClass, event) { - commonConstants.closeAllPopupExcept(divClass, event); - }, - isServiceCallComplete: commonConstants.isServiceCallComplete, - addECBBindings: function () { - commonConstants.addECBBindings(); - }, - getColumnDataSuccess: function (result) { - commonConstants.getColumnDataSuccess(result); - }, - getColumnDataFailure: function (result) { - commonConstants.getColumnDataFailure(result); - }, - getColumnDataOnBefore: function (result) { - commonConstants.getColumnDataOnBefore(result); - }, - getColumnData: function (sRefinerValue, sFilterFlyoutType, sFilterSearchTerm) { - commonConstants.getColumnData(sRefinerValue, sFilterFlyoutType, sFilterSearchTerm); - }, - addFilterFlyoutBindings: function () { - commonConstants.addFilterFlyoutBindings(); - }, - oHeaderFilterType: commonConstants.oHeaderFilterType, - pinnedFilterData: commonConstants.pinnedFilterData, - arrUniqueRefinerData: function () { - return commonConstants.arrUniqueRefinerData; - }, - populateFilterHTML: function (sRefinerName, sFilterFlyoutType, arrRefinerUniqueValues, bScroll) { - commonConstants.populateFilterHTML(sRefinerName, sFilterFlyoutType, arrRefinerUniqueValues, bScroll); - }, - formatFilterSearchTerm: function (sRefinerName) { - return commonConstants.formatFilterSearchTerm(sRefinerName); - }, - filterData: function (oPinnedFilter, bFlag, sRefinerName) { - commonConstants.filterData(oPinnedFilter, bFlag, sRefinerName); - }, - oFlyoutFilters: function () { - return oFlyoutFilters; - }, - configureOnLoadView: function () { - commonConstants.configureOnLoadView(); - }, - oSortDetails: function () { - return commonConstants.oSortDetails; - }, - clearGridViewContent: function () { - commonConstants.clearGridViewContent(); - }, - getSortDetails: function (bIsFilterFlyoutCall) { - commonConstants.getSortDetails(bIsFilterFlyoutCall); - }, - updateSortingNotification: function () { - commonConstants.updateSortingNotification(); - }, - oPinnedFlyoutFilters: oPinnedFlyoutFilters, - iFilterFlyoutPageNumber: function () { - commonConstants.iFilterFlyoutPageNumber = 1; //// Reset the page number for filter fly out data to 1 - }, - iTypingTimer: commonConstants.iTypingTimer, - isSearchText: commonConstants.isSearchText, - isAllRowSelected: commonConstants.isAllRowSelected, - isFilterFlyoutVisible: commonConstants.isFilterFlyoutVisible, - setDateFilters: function (sRefinerName, sFilterFlyoutType) { - commonConstants.setDateFilters(sRefinerName, sFilterFlyoutType); - }, - highlightSelectedFilters: function (sRefinerName, sFilterFlyoutType) { - commonConstants.highlightSelectedFilters(sRefinerName, sFilterFlyoutType); - }, - adjustCaretIcon: function () { - commonConstants.adjustCaretIcon(); - }, - moveFilterFlyout: function () { - commonConstants.moveFilterFlyout(); - }, - getArrayDifference: function (arrFirstArray, arrSecondArray) { - return commonConstants.getArrayDifference(arrFirstArray, arrSecondArray); - }, - getNotificationContent: function (sMsg, sContentCheckMsg, sOptionContent) { - return commonConstants.getNotificationContent(sMsg, sContentCheckMsg, sOptionContent); - }, - continueUpload: function () { - return commonConstants.continueUpload(); - }, - getContentCheckConfigurations: function (sMatterUrl) { - return commonConstants.getContentCheckConfigurations(sMatterUrl); - }, - abortContentCheck: function (isLocalUpload) { - return commonConstants.abortContentCheck(isLocalUpload); - }, - contentCheckNotification: function (isLocalUpload) { - return commonConstants.contentCheckNotification(isLocalUpload); - }, - enableSearch: function () { - return commonConstants.enableSearch(); - }, - disableSearch: function () { - return commonConstants.disableSearch(); - }, - updateDropDownToolTip: function () { - return commonConstants.updateDropDownToolTip(); - }, - abortRequest: function () { - return commonConstants.abortRequest(); - }, - updateGridView: function () { - return commonConstants.updateGridView(); - }, - updateDocumentLandingAttributes: function ($Element) { - return commonConstants.updateDocumentLandingAttributes($Element); - }, - getDocumentLandingAssets: function ($Element) { - return commonConstants.getDocumentLandingAssets($Element); - }, - renderStringContent: function (sValue) { - return commonConstants.renderStringContent(sValue); - }, - getDecodeURIComponent: function (sValue) { - return commonConstants.getDecodeURIComponent(sValue); - }, - openWindow: function (url, target) { - commonConstants.openWindow(url, target); - }, - sSearchedKeyword: commonConstants.sSearchedKeyword, - bCalledForSort: commonConstants.bCalledForSort, - sFilterDetails: commonConstants.sFilterDetails, - addUploadAttributes: function (sOriginalName, sMatterGuid) { - commonConstants.addUploadAttributes(sOriginalName, sMatterGuid); - }, - getRootFolderForMatter: function (sCurrentFolderName) { - return commonConstants.getRootFolderForMatter(sCurrentFolderName); - }, - htmlEncode: function (sValue) { - return commonConstants.htmlEncode(sValue); - } - }; -})(); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/CommonControls.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/CommonControls.js deleted file mode 100644 index 2e02dc57..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/CommonControls.js +++ /dev/null @@ -1,109 +0,0 @@ -/// JS1003,JS2032,JS2074,JS2076,JS2024,JS3116,JS3085,JS3058,JS3092,JS3057,JS3054,JS2073,JS2005,JS3056 - -//// JavaScript file for configurable components present in Matter Center - -/* Object for drop down control */ -var oDropdownControl = (function () { - "use strict"; - /* Common functions container */ - var commonFunctions = {}; - - /* Function to generate the ECB menu for actions mentioned in the "sCurrentView" parameter */ - commonFunctions.generateDropdownControl = function (sDropdownSelector, arrCurrentView) { - var oDropdownTerms = [] - , sSelectElement = "
    " //// HTML chunk of container for drop down menu - , sOptionElement = "" - , oDropdownContainer = $(sDropdownSelector); - - //// Generate the HTML chunk of items present in the drop down menu - $.each(arrCurrentView, function (iIterator, oCurrentItem) { - var sDropdownItem = $.trim(oCurrentItem) ? $.trim(oCurrentItem).split(",") : ""; //// Separate the action name and class name from current item - if (sDropdownItem) { - var sDropdownClass = sOptionElement.replace("{0}", sDropdownItem[0]); - oDropdownTerms.push(sDropdownClass); - } - }); - - //// Generate the finalized HTML chunk of drop down menu - var sDropDownChunk = sSelectElement.replace("{0}", oDropdownTerms.join("")); - - //// Populate the HTML chunk of ECB menu and bind the JS of fabric component - oDropdownContainer.html(sDropDownChunk).find(".ms-Dropdown").dropdown(); - oDropdownContainer.find(".ms-Dropdown .ms-Dropdown-title").addClass("ms-font-weight-semilight"); - //// Attach class to each drop down element, here we will need to re-iterate as the HTML chunk needs to be ready before attaching class - var oDropDownItems = oDropdownContainer.find(".ms-Dropdown-items .ms-Dropdown-item"); - $.each(arrCurrentView, function (iIterator, oCurrentItem) { - var sDropdownItem = $.trim(oCurrentItem) ? $.trim(oCurrentItem).split(",") : ""; //// Separate the action name and class name from current item - if (2 === sDropdownItem.length) { - if ("mydata" === sDropdownItem[1]) { - $(oDropDownItems[iIterator]).addClass(sDropdownItem[1] + " ms-font-weight-semilight searchPanelDropdownOption selectedDropdownOption"); - } else { - $(oDropDownItems[iIterator]).addClass(sDropdownItem[1] + " ms-font-weight-semilight searchPanelDropdownOption"); - } - } - }); - oCommonObject.updateDropDownToolTip(); - }; - - /* Return the functions which are exposed outside this JS file */ - return { - generateDropdownControl: function (sDropdownSelector, arrCurrentView) { - commonFunctions.generateDropdownControl(sDropdownSelector, arrCurrentView); - } - }; -})(); - -var oColumnPickerControl = (function () { - "use strict"; - /* Common functions container */ - var commonFunctions = {}; - - /* Function to generate the ECB menu for actions mentioned in the "sCurrentView" parameter */ - commonFunctions.generateColumnPickerControl = function (sColumnPickerSelector, arrCurrentView) { - var sColumnPickerChunk = "", tempChunk = ""; - var sCheckBoxChunk = oGlobalConstants.ColumnPickerChunk; - var sAllColumnHeader = sCheckBoxChunk.replace(/\{0}/g, "").replace(/\{1}/g, oGlobalConstants.GridViewAllColumnOption).replace(/\{2}/g, null).replace(/\{3}/g, ""); - sColumnPickerChunk = sAllColumnHeader; - $.each(arrCurrentView, function (iIterator, oCurrentItem) { - tempChunk = sCheckBoxChunk.replace(/\{0}/g, iIterator).replace(/\{1}/g, oCurrentItem).replace(/\{2}/g, iIterator); - sColumnPickerChunk += (0 === iIterator) ? tempChunk.replace(/\{3}/g, "defaultSelection") : tempChunk.replace(/\{3}/g, ""); - }); - $(sColumnPickerSelector).html(sColumnPickerChunk); - $(sColumnPickerSelector).find(".defaultSelection").prop("checked", true); - }; - - /* Return the functions which are exposed outside this JS file */ - return { - generateColumnPickerControl: function (sColumnPickerSelector, arrCurrentView) { - commonFunctions.generateColumnPickerControl(sColumnPickerSelector, arrCurrentView); - } - }; -})(); - -/* Function to hide the common control on resize and click events */ -$(document).on("click", function (event) { - "use strict"; - var sCurrentItemClass = (event.target && event.target.className) ? event.target.className : ""; - var sCurrentItemId = (event.target && event.target.id) ? event.target.id : ""; - if (-1 < sCurrentItemClass.indexOf("columnOptionName") || -1 < sCurrentItemClass.indexOf("ms-ChoiceField-input") || "columnOptions" === sCurrentItemId) { - oCommonObject.closeAllPopupExcept("columnPickerPanel", event); - } else if (-1 < sCurrentItemClass.indexOf("FlyoutContent") || -1 < sCurrentItemClass.indexOf("FlyoutBoxContent") || -1 < sCurrentItemClass.indexOf("flyoutLeftarrow")) { - oCommonObject.closeAllPopupExcept("InfoFlyout", event); - } else { - oCommonObject.closeAllPopupExcept("", event); //// Close all pop-ups - } -}); - -/*Function to stop click event when enter is pressed on Chrome*/ -$(document).on("keypress", function (e) { - "use strict"; - if (e.which === 13) { // Checks for the enter key - e.preventDefault(); // Stops Chrome from triggering the button to be clicked - } -}); - -$(window).on("resize", function (event) { - "use strict"; - $(".ms-Dropdown").removeClass("ms-Dropdown--open"); - $(".autoCompletePanel").empty().addClass("hide"); -}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ECBControl.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ECBControl.js deleted file mode 100644 index 6d65c133..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ECBControl.js +++ /dev/null @@ -1,37 +0,0 @@ -/// JS1003,JS2005,JS2023,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS3054,JS3056,JS3057,JS3058,JS3085,JS3092,JS3116 - -/* Object for ECB Control */ -var oECBControl = (function () { - "use strict"; - /* Common functions container */ - var commonFunctions = {}; - - /* Function to generate the ECB menu for actions mentioned in the "sCurrentView" parameter */ - commonFunctions.generateECBControl = function (arrCurrentView, arrECBTitle) { - var oECBActionsChunk = [] - , sULElement = "
      Loading data...{0}
    " //// HTML chunk of container for ECB menu - , sLIElement = "
  • {1}
  • "; //// HTML chunk of item in ECB menu - - //// Generate the HTML chunk of items present in the ECB menu - $.each(arrCurrentView, function (iCurrentIndex, sCurrentItem) { - var arrActionClass = $.trim(sCurrentItem) ? $.trim(sCurrentItem).split(",") : ""; //// Separate the action name and class name from current item - if (2 === arrActionClass.length) { - var currLIElement = sLIElement.replace("{0}", arrActionClass[1]).replace(/\{1\}/g, arrActionClass[0]).replace("{2}", arrECBTitle[iCurrentIndex]); - oECBActionsChunk.push(currLIElement); - } - }); - - //// Generate the finalized HTML chunk of ECB menu - var sECBActionsChunk = sULElement.replace("{0}", oECBActionsChunk.join("")); - - //// Populate the HTML chunk of ECB menu and bind the JS of fabric component - $("#ECBControl").html(sECBActionsChunk).contextualMenu(); - }; - - /* Return the functions which are exposed outside this JS file */ - return { - generateECBControl: function (arrCurrentView, arrECBTitle) { - commonFunctions.generateECBControl(arrCurrentView, arrECBTitle); - } - }; -})(); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/FilterPanel.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/FilterPanel.js deleted file mode 100644 index eb854071..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/FilterPanel.js +++ /dev/null @@ -1,1085 +0,0 @@ -/// JS1003,JS2076,JS2032,JS2064,JS2074,JS2024,JS2026,JS2005,JS3085,JS3116,JS3092,JS3057,JS3058,JS3056 -/* Common JS file for filter panel */ - -var oFilterGlobal = { - siteURL: oGlobalConstants.Central_Repository_Url, - refinerHTMLTemplate: "
    ", - regularRefiner: new RegExp("#RefinerValue#", "g"), - selectAllNone: "", - noRecordRow: "
    No records found
    ", - regularNoRefinerRow: new RegExp("#noRefinerVisible#", "g"), - refinerOkButton: "
    Ok
    ", - regularRefinerType: new RegExp("#SearchType#", "g"), - refinerCancelButton: "
    Cancel
    ", - clientsList: "", - oTermStoreData: "", - isVisible: false, - arrOWADocumentExtension: [], - arrVisioFileExtension: [] -}, -oJQueryBindings = { - $ClientText: "", - $PracticeGroupText: "", - $AreaOfLawText: "", - $SearchMatter: "", - $SearchDocument: "", - $SwitchApp: "", - $SpecificName: "", - $DocumentContainers: "", - $IsVisible: "", -}, -commonFunction = {}, - -oPageConfig = { - currentPage: 0 -}; - -/* Function to show all options */ -commonFunction.showAllOptions = function ($ShowAll) { - "use strict"; - $ShowAll.children(".refinerRow").show(); -}; - -/* Function to check selected check boxes */ -commonFunction.checkSelected = function (arrSelectedText, $SelectedCheckbox) { - "use strict"; - $.each(arrSelectedText, function (index, value) { - var oRelevantRow = $SelectedCheckbox.find(".refinerRow").find("input[type=checkbox][value='" + value.trim() + "']"); - if (oRelevantRow.length) { - oRelevantRow.prop("checked", "checked"); - } - }); -}; - -/* Function to reset to saved state */ -commonFunction.resetToSavedState = function ($ResetThis) { - "use strict"; - if ($ResetThis.parent().children(".filterSearchRefinerText").attr("data-selected")) { - var sResetText = $ResetThis.parent().children(".filterSearchRefinerText").attr("data-selected").split("$|$"), totalCount = $ResetThis.parent().children(".filterSearchRefinerText").attr("data-totalcount"); - $ResetThis.children(".refinerRow").children("input[type=checkbox]").removeAttr("checked"); - if (totalCount && 0 < (parseInt(totalCount, 10))) { - $ResetThis.children(".noRefiners").hide(); - $ResetThis.children(".refinerRowLink").show(); - } else { - $ResetThis.children(".noRefiners").show(); - $ResetThis.children(".refinerRowLink").hide(); - } - $ResetThis.parent().children(".filterSearchRefinerText").val(sResetText.join(", ")); - commonFunction.checkSelected(sResetText, $ResetThis); - commonFunction.showAllOptions($ResetThis); - } -}; - -/* Function to close all pop up except the specified pop up */ -commonFunction.closeAllFilterExcept = function (sCloseThis, event) { - "use strict"; - if ("filterSearchAdvance" !== sCloseThis && "refinerClient" !== sCloseThis && "refinerPG" !== sCloseThis && "refinerAOL" !== sCloseThis && "ui-datepicker" !== sCloseThis && (oGridConfig.isMatterView || (event && event.target && event.target.className !== "ui-corner-all"))) { - $(".filterSearchAdvance").hide(); - } - if ("refinerClient" !== sCloseThis) { - $(".refinerClient").hide(); - } - if ("refinerPG" !== sCloseThis) { - $(".refinerPG").hide(); - } - if ("refinerAOL" !== sCloseThis) { - $(".refinerAOL").hide(); - } - if ("matterPopup" !== sCloseThis) { - $(".matterPopup").hide(); - } - if ("documentPopup" !== sCloseThis) { - $(".documentPopup").hide(); - } - if ("filterPanel" !== sCloseThis) { - $(".filterPanel").hide(); - } - if ("filterAutoComplete" !== sCloseThis) { - $(".filterAutoComplete").addClass("hide"); - } - if ("switchApp" !== sCloseThis) { - $(".switchApp").hide(); - } - if ("checkOutPopup" !== sCloseThis) { - $(".checkOutPopup").hide(); - } - if ("switchTab" !== sCloseThis) { - $(".switchTab").hide(); - } - if ("sdBannerPanel" !== sCloseThis) { - $(".sdBannerPanel").addClass("hide"); - } - sCloseThis && event && event.stopPropagation(); -}; - -/* Function to search on key up */ -function filterKeyUp(eventKeyUp, oSearchObject) { - "use strict"; - var arrSearch = $(oSearchObject).val().split(",") - , sTrimmedText = arrSearch[arrSearch.length - 1].trim() - , $SearchThis = $(oSearchObject).parent().children(".filterSearchRefinerDDL"); - if (arrSearch[0]) { - if ($SearchThis.is(":hidden")) { - $(oSearchObject).parent().children(".filterSearchRefinerDDL").width($(oSearchObject).width()); - commonFunction.showAllOptions($SearchThis); - $(oSearchObject).parent().children(".filterSearchRefinerDDL").toggle(); - eventKeyUp.stopPropagation(); - } - $SearchThis.find(".refinerRow").find("input[type=checkbox]").removeAttr("checked"); - $SearchThis.find(".refinerRow").hide(); - commonFunction.checkSelected(arrSearch, $SearchThis); - if (sTrimmedText) { - var $RelavantSearch = $SearchThis.find(".refinerRow").find("input[type=checkbox]").filter(function () { - return $(this).attr("value").toLowerCase().indexOf(sTrimmedText.toLowerCase()) > -1; - }); - if ($RelavantSearch.length) { - $RelavantSearch.prop("checked", "checked"); - $RelavantSearch.parent().parent().show(); - $SearchThis.children(".refinerWrapper").show(); - $SearchThis.children(".noRefiners").hide(); - $SearchThis.children(".refinerRowLink").show(); - } else { - $SearchThis.children(".refinerWrapper").hide(); - $SearchThis.children(".noRefiners").show(); - $SearchThis.children(".refinerRowLink").hide(); - } - } else { - commonFunction.showAllOptions($(".refinerWrapper")); - } - } else { - commonFunction.showAllOptions($(".refinerWrapper")); - commonFunction.refinerSelectNone($SearchThis); - $(".noRefiners").hide(); - $(".refinerRowLink").show(); - } - eventKeyUp.stopPropagation(); -} - -/* Functions for fetching client from Term store */ -commonFunction.onClientSuccess = function (refiners) { - "use strict"; - - var refinerClientHTML = oFilterGlobal.selectAllNone; - refinerClientHTML = "
    "; - var sClientTileHTML = ""; - var oClients = JSON.parse(refiners); - oFilterGlobal.clientsList = JSON.parse(JSON.stringify(oClients.ClientTerms)); - $.each(oFilterGlobal.clientsList, function (iIndex, val) { - refinerClientHTML = refinerClientHTML + oFilterGlobal.refinerHTMLTemplate.replace(oFilterGlobal.regularRefiner, val.Name); - }); - if (refinerClientHTML) { - refinerClientHTML = refinerClientHTML + "
    " + oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, "") + oFilterGlobal.refinerOkButton.replace(oFilterGlobal.regularRefinerType, "Clients") + oFilterGlobal.refinerCancelButton; - } else { - refinerClientHTML = oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, " noRefinersVisible"); - } - $(".refinerClient").length && $(".refinerClient").html(refinerClientHTML); - oJQueryBindings.$ClientText.attr("data-totalcount", $(".filterSearchClients input[type='checkbox']").length); - oJQueryBindings.$ClientText.attr("data-selectedcount", 0); -}; - -/* Function to show loading image before call to service */ -commonFunction.onBeforeSend = function (refiners) { - "use strict"; - $(".tileContainer").html("
    Loading...

    " + oGlobalConstants.Loading_Clients + "
    "); -}; - -/* Functions for fetching Practice Groups and Area of Laws */ -commonFunction.onPGSuccess = function (refiners) { - "use strict"; - var oPracticeGroup = JSON.parse(refiners); - if (!oPracticeGroup.code) { - var sPGHtml = oFilterGlobal.selectAllNone + "
    "; - var sAOLHtml = oFilterGlobal.selectAllNone + "
    "; - oFilterGlobal.oTermStoreData = JSON.parse(refiners); - - if (oPracticeGroup.PGTerms) { - $.each(oPracticeGroup.PGTerms, function (iIndex, sValue) { - var $AOLObject = sValue; - - sPGHtml = sPGHtml + oFilterGlobal.refinerHTMLTemplate.replace(oFilterGlobal.regularRefiner, $AOLObject.TermName); - - $.each($AOLObject.AreaTerms, function (iCount, sTerm) { - sAOLHtml = sAOLHtml + oFilterGlobal.refinerHTMLTemplate.replace(oFilterGlobal.regularRefiner, sTerm.TermName).replace("PGValue", $AOLObject.TermName); - }); - }); - } - if (sPGHtml) { - sPGHtml += "
    " + oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, "") + oFilterGlobal.refinerOkButton.replace(oFilterGlobal.regularRefinerType, "PG") + oFilterGlobal.refinerCancelButton; - } else { - sPGHtml = oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, " noRefinersVisible"); - } - if (sAOLHtml) { - sAOLHtml += "
    " + oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, "") + oFilterGlobal.refinerOkButton.replace(oFilterGlobal.regularRefinerType, "AOL") + oFilterGlobal.refinerCancelButton; - } else { - sAOLHtml = oFilterGlobal.noRecordRow.replace(oFilterGlobal.regularNoRefinerRow, " noRefinersVisible"); - } - $(".refinerPG").length && $(".refinerPG").html(sPGHtml); - $(".refinerAOL").length && $(".refinerAOL").html(sAOLHtml); - oJQueryBindings.$PracticeGroupText.attr("data-totalcount", $(".filterSearchPG input[type='checkbox']").length); - oJQueryBindings.$AreaOfLawText.attr("data-totalcount", $(".filterSearchAOL input[type='checkbox']").length); - oJQueryBindings.$PracticeGroupText.attr("data-selectedcount", 0); - oJQueryBindings.$AreaOfLawText.attr("data-selectedcount", 0); - } else { - showCommonErrorPopUp(oPracticeGroup.code); - } -}; - -/* Common failure function */ -commonFunction.onRefinerFailure = function (result, sContainer) { - "use strict"; - $(sContainer).html(result.d); - showCommonErrorPopUp(result); -}; - -/* Function to select all the check box */ -commonFunction.refinerSelectAll = function (sSelectLink) { - "use strict"; - $(sSelectLink).parent().parent().children().find("input[type=checkbox]").prop("checked", "checked"); -}; -/* Function to clear check box selection */ -commonFunction.refinerSelectNone = function (sSelectLink) { - "use strict"; - $(sSelectLink).parent().parent().children().find("input[type=checkbox]").removeAttr("checked"); -}; -/* Function to execute on click on Cancel */ -commonFunction.refinerCancelClick = function (sCancelButton) { - "use strict"; - var $CancelThis = $(sCancelButton).parent().parent(); - commonFunction.resetToSavedState($CancelThis); - $CancelThis.hide(); -}; -/* Function to execute on click of OK */ -commonFunction.refinerOkClick = function (sRefinerId, event) { - "use strict"; - var sSelectedText = "", sSelectedTextVal = ""; - $(sRefinerId + " .filterSearchRefinerText").attr("data-selectedcount", $(sRefinerId + " input:checked").length); - $(sRefinerId + " input:checked").each(function () { - if (sSelectedText) { - sSelectedText = sSelectedText + "$|$" + $(this).val(); - sSelectedTextVal = sSelectedTextVal + ", " + $(this).val(); - } else { - sSelectedText = $(this).val(); - sSelectedTextVal = $(this).val(); - } - }); - $(sRefinerId + " .filterSearchRefinerText").attr("data-selected", sSelectedText); - $(sRefinerId + " .filterSearchRefinerText").val(sSelectedTextVal); - commonFunction.closeAllFilterExcept("filterSearchAdvance", event); - /* Code to cascade the Area of Laws */ - if (".filterSearchPG" === sRefinerId) { //// If OK clicked on Practice Group filter - if (sSelectedText) { //// If at least one practice group is selected - var $AOLObject = $(".refinerAOL .refinerWrapper"); - $AOLObject.find("input[type='checkbox']").removeAttr("checked"); //// Uncheck all the AOL - var arrPracticeGroup = sSelectedText.split("$|$"); - $.each(arrPracticeGroup, function (index, val) { //// Check the AOL for selected practice group - $AOLObject.find("input[type='checkbox'][data-pg='" + val + "']").prop("checked", "checked"); - }); - } else { - commonFunction.refinerSelectNone(".refinerAOL .buttonCancel"); - } - commonFunction.refinerOkClick(".filterSearchAOL", event); - } - /* Code to cascade the Area of Laws */ -}; - -/* Function to bind all JQuery elements */ -commonFunction.JQueryBindings = function () { - "use strict"; - oJQueryBindings.$ClientText = $(".refinerClientsText"); - oJQueryBindings.$PracticeGroupText = $(".refinerPGText"); - oJQueryBindings.$AreaOfLawText = $(".refinerAOLText"); - oJQueryBindings.$SearchMatter = $("#searchMatter"); - oJQueryBindings.$SearchDocument = $("#searchDocument"); - oJQueryBindings.$SwitchApp = $(".switchApp"); - oJQueryBindings.$SpecificName = $(".specificName"); - oJQueryBindings.$IsVisible = false; -}; - -commonFunction.openAdvanceSearch = function (sSelectorThis, $Element, iFlag, event) { - "use strict"; - var sSelector = sSelectorThis.replace("DD", "") - , sSelectorString = sSelector.replace(".", ""); - $(sSelector).find(".refinerWrapper").show(); - $(sSelector).find(".refinerRow").show(); - $(sSelector).find(".noRefiners").hide(); - if ($(sSelector).find(".noRefiners").is(":visible")) { - $(sSelector).find(".noRefiners").css("display", "none"); - } - if ($(sSelector).find(".refinerRowLink").is(":hidden")) { - $(sSelector).find(".refinerRowLink").show(); - } - commonFunction.closeAllFilterExcept(sSelectorString, event); - $(sSelector).width($Element.width()); - iFlag && commonFunction.resetToSavedState($(sSelector)); - $(sSelector).toggle(); - event.stopPropagation(); -}; - -commonFunction.openSortDropdown = function (sSelectorThis, $Element, iFlag, event) { - "use strict"; - if ("block" === $Element.css("display")) { - $Element.addClass("hide"); - } else { - $Element.removeClass("hide"); - } -}; - -commonFunction.switchThisApp = function (sAppName) { - "use strict"; - $(".popupWait, .loadingImage").removeClass("hide"); - $(".loadingImage").css("position", "absolute"); - "use strict"; - $(".swicthApp").toggle(); - var sQueryParameter = commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + sAppName, false); - switch (sAppName) { - case oGlobalConstants.App_Name_Search_Matters: - window.location.href = oGlobalConstants.ServicePath_FindMatter + sQueryParameter; - break; - case oGlobalConstants.App_Name_Search_Documents: - window.location.href = oGlobalConstants.ServicePath_FindDocument + sQueryParameter; - break; - case oGlobalConstants.App_Name_Provision_Matters: - window.location.href = oGlobalConstants.ServicePath_MatterProvision + sQueryParameter; - break; - case oGlobalConstants.App_Name_App_Landing_Page: - window.location.href = oGlobalConstants.ServicePath_AppLandingPage + sQueryParameter; - break; - } -}; - -//// Function to log App Insight events and set query parameter in URL on redirection -commonFunction.AppLogEvent = function (sAppName, bToLog) { - "use strict"; - var sQueryParameter = "", - sGroupName = oGlobalConstants.Browser, - parameterKey = "appType", - appType = oCommonObject.getParameterByName(parameterKey), - eventName = ""; - - if (null != appType) { - switch (appType) { - case oGlobalConstants.Querystring_Office: - sGroupName = oGlobalConstants.Word; - sQueryParameter = "?" + parameterKey + "=" + oGlobalConstants.Querystring_Office; - break; - case oGlobalConstants.Querystring_OWA: - sGroupName = oGlobalConstants.OWA; - sQueryParameter = "?" + parameterKey + "=" + oGlobalConstants.Querystring_OWA; - break; - case oGlobalConstants.Querystring_Outlook: - sQueryParameter = "?" + parameterKey + "=" + oGlobalConstants.Querystring_Outlook; - sGroupName = oGlobalConstants.Outlook; - break; - } - } - eventName = sGroupName + "/" + sAppName; - (bToLog) ? oCommonObject.logEvent(eventName) : ""; - return sQueryParameter; -}; - -// Function to trim trailing special character if present -function trimEndChar(sOrignalString, sCharToTrim) { - "use strict"; - if (sOrignalString && sCharToTrim === sOrignalString.substr(-1)) { - return sOrignalString.substr(0, sOrignalString.length - 1); - } - return sOrignalString; -} - -function advanceSearchDropdown() { - "use strict"; - if ($("#filterSearchDown").is(":visible")) { - $(".filterSearchDD").toggle(); - } -} - -commonFunction.onLoadActions = function (isServiceCall) { - "use strict"; - //// #region JQuery Bindings - commonFunction.JQueryBindings(); - //// #endregion - - // #region Date Picker - $("#refinerFromText, .imageDatePickerFrom").datepicker({ - dateFormat: "yy-mm-dd", - changeMonth: true, - changeYear: true, - yearRange: "-70:+70", - constrainInput: true, - duration: "", - gotoCurrent: true, - maxDate: "+0D", - onClose: function (selectedDate) { - $("#refinerToText, .imageDatePickerTo").datepicker("option", "minDate", selectedDate); - } - }).datepicker(); - $("#refinerToText, .imageDatePickerTo").datepicker({ - dateFormat: "yy-mm-dd", - changeMonth: true, - changeYear: true, - yearRange: "-70:+10", - constrainInput: true, - duration: "", - gotoCurrent: true, - maxDate: "+0D", - onClose: function (selectedDate) { - $("#refinerFromText, .imageDatePickerFrom").datepicker("option", "maxDate", selectedDate || "-1D"); - } - }).datepicker(); - $(".ui-datepicker").click(function (event) { - commonFunction.closeAllFilterExcept("ui-datepicker", event); - event.stopPropagation(); - }); - //// #endregion - - //// #region Binding - // #region App Switch - $(".specificName").click(function (event) { - oJQueryBindings.$SwitchApp.toggle(); - event.bubbles = false; - return false; - }); - - // #endregion - $(".filterSearchDD").click(function (event) { - // App Insight Event tracking for Advance Search - var eventName = oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Open_Advance_Search; - if ($("#filterSearchDown").is(":visible")) { - eventName = oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Close_Advance_Search; - } - commonFunction.AppLogEvent(eventName, true); - commonFunction.closeAllFilterExcept("filterSearchAdvance", event); - if ($(".closeFailSavedSearchNotification").is(":visible")) { - $(".closeFailSavedSearchNotification").parent().remove(); - } - $(".filterSearchAdvance").toggle(); - $(".quickLinksMenuItems").hide(); - $(".filterSearchDD").toggle(); - $(".sdBannerPanel").addClass("hide"); - event.stopPropagation(); - }); - //// #region Close All Pop up except specified popup - $(".filterSearchAdvance").click(function (event) { - commonFunction.closeAllFilterExcept("filterSearchAdvance", event); - }); - $(".refinerClient").click(function (event) { - commonFunction.closeAllFilterExcept("refinerClient", event); - }); - $(".refinerPG").click(function (event) { - commonFunction.closeAllFilterExcept("refinerPG", event); - }); - $(".refinerAOL").click(function (event) { - commonFunction.closeAllFilterExcept("refinerAOL", event); - }); - oJQueryBindings.$PracticeGroupText.click(function (event) { - commonFunction.closeAllFilterExcept("refinerPG", event); - }); - oJQueryBindings.$AreaOfLawText.click(function (event) { - commonFunction.closeAllFilterExcept("refinerAOL", event); - }); - $("#filterAdvancedSearch").click(function (event) { - if ($(".filterSearchAdvance").css("display") === "block") { - $(".filterSearchDD").toggle(); - } - commonFunction.removeClasses(); - // Change the default sort setting to relevant - if ("function" === typeof (updateSortSettings)) { - oGridConfig.nGridPageNumber = 1; - updateSortSettings(event); - } - advancedSearch("#allMatters", "tileContainer", event); - commonFunction.closeAllFilterExcept("", event); - closeAllPopupExcept("", event); - }); - $(".filterSearchImg").click(function (event) { - oCommonObject.bHideAutoComplete = true; - // App Insight Event tracking for Text box search - var sCurrentEvent = (oGridConfig.isMatterView ? oGlobalConstants.Matter_Textbox_Search : oGlobalConstants.Document_Textbox_Search); - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + sCurrentEvent, true); - if ($(".filterSearchAdvance").css("display") === "block") { - $(".filterSearchDD").toggle(); - } - commonFunction.removeClasses(); - // Change the default sort setting to relevant - if ("function" === typeof (updateSortSettings)) { - oGridConfig.nGridPageNumber = 1; - updateSortSettings(event); - } - advancedSearch("#allMatters", "tileContainer", event); - commonFunction.closeAllFilterExcept("", event); - closeAllPopupExcept("", event); - }); - oJQueryBindings.$ClientText.click(function (event) { - commonFunction.closeAllFilterExcept("refinerClient", event); - }); - $(document).on("input", ".filterSearchRefinerText", function () { - if (!oJQueryBindings.$ClientText.val()) { - $(".refinerWrapper").find("input[type=checkbox]").removeAttr("checked"); - } - }); - $(".filterSearchText").click(function (event) { - commonFunction.closeAllFilterExcept("filterSearchAdvance", event); - }); - //// endregion - $(document).on("keyup", ".filterSearchRefinerText", function (event) { - $(".refinerWrapper").show(); - $(".buttonOk").removeAttr("disabled"); - if (!oJQueryBindings.$ClientText[0].validity.patternMismatch && !oJQueryBindings.$PracticeGroupText[0].validity.patternMismatch && !oJQueryBindings.$AreaOfLawText[0].validity.patternMismatch) { - filterKeyUp(event, this); - } else { - $(".refinerWrapper").hide(); - $(".refinerRowLink").hide(); - $(".noRefiners").show(); - $(".buttonOk").attr("disabled", "disabled"); - } - event.stopPropagation(); - }); - // functions for switching app - - $(document).on("click", ".appSwitch", function (event) { - oFilterGlobal.isVisible ? $(".appSwitch").removeClass("appSwitchMenushow").find(".appSwitcherName").removeClass("hide") : $(".appSwitch").addClass("appSwitchMenushow").find(".appSwitcherName").addClass("hide"); - oFilterGlobal.isVisible = !(oFilterGlobal.isVisible); - $(".matterPopup .documentPopup").hide(); - $(".appSwitchMenu").toggleClass("hide"); - event.stopPropagation(); - }); - - // End of function for switching app. - //// #endregion - //// #region Advance search pop up - /* Common function change */ - $(".refinerClientDD").click(function (event) { - commonFunction.openAdvanceSearch(".refinerClientDD", oJQueryBindings.$ClientText, 1, event); - }); - $(".refinerPGDD").click(function (event) { - commonFunction.openAdvanceSearch(".refinerPGDD", oJQueryBindings.$PracticeGroupText, 1, event); - }); - $(".refinerAOLDD").click(function (event) { - commonFunction.openAdvanceSearch(".refinerAOLDD", oJQueryBindings.$AreaOfLawText, 0, event); - }); - - $(document).on("click", ".switchAppRow, .switchAppLink", function () { - if ($(".appSwitcherName span").text().toLowerCase() !== $(this).attr("data-attr").toLowerCase()) { - $(".popupWait, .loadingImage").removeClass("hide"); - $(".loadingImage").css("position", "absolute"); - commonFunction.switchThisApp($(this).attr("data-attr")); - } - }); - - //// #endregion - ////#region Service Calls - if (isServiceCall) { - /* Call to fetch Clients from Term Store */ - var matterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oFilterGlobal.siteURL }, "details": { "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Client_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Client_Custom_Properties_Url } }; - oCommonObject.callProvisioningService("GetTaxonomyData", matterDetails, commonFunction.onClientSuccess, commonFunction.onRefinerFailure, commonFunction.onBeforeSend); - /* Call to fetch Practice Groups and Area of Laws */ - var PGDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oFilterGlobal.siteURL }, "details": { "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Practice_Group_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Practice_Group_Custom_Properties } }; - oCommonObject.callProvisioningService("GetTaxonomyData", PGDetails, commonFunction.onPGSuccess, commonFunction.onRefinerFailure); - } - ////#endregion - - // #region events for upload popup and drill down on folders - var $MailBodyElement = $("#mailBody"); - $MailBodyElement.on("dblclick", ".folderStructureContent ul li ul li", function (e) { - e.stopPropagation(); - e.stopImmediatePropagation(); - e.preventDefault(); - oUploadGlobal.oDrilldownParameter.nCurrentLevel++; - commonFunction.drilldownNavigation(e); - $(".folderStructureContent, .parentNode").addClass("folderStructureWithBreadcrumb"); - }); - - $MailBodyElement.on("dragover", ".folderStructureContent ul li", function (e, ui) { - e.stopImmediatePropagation(); - $(this).addClass("folderDragOver"); - }); - - $MailBodyElement.on("dragleave", ".folderStructureContent ul li", function (e, ui) { - $(this).removeClass("folderDragOver"); - }); - - $MailBodyElement.on("click", "#rootLink", function () { - commonFunction.clearGlobalVariables(); - var htmlChunk = buildNestedList(oSearchGlobal.oFolderName, null); - if ("undefined" !== typeof htmlChunk) { - $(".folderStructureContent").html(htmlChunk); - } - if ("undefined" !== typeof bindDroppable) { - bindDroppable($(".folderStructureContent ul li")); - } - $(".folderStructureContent, .parentNode").removeClass("folderStructureWithBreadcrumb"); - }); - - $MailBodyElement.on("click", "#parentFolder", function (e) { - oUploadGlobal.oDrilldownParameter.nCurrentLevel--; - commonFunction.drilldownNavigation(e); - }); - // #endregion - $(document).on("click", ".ErrorPopUpCloseIcon, .ErrorPopupBackground", function () { - $(".ErrorPopUpHolder").addClass("hide"); - }); - $(document).on("click", ".TryAgainLink", function () { - $(".popupWait").removeClass("hide").addClass("ErrorPopUpIndex"); - }); - $(".AdminLink").attr("href", oGlobalConstants.Admin_Support_URL); -}; - -//// Function to redirect user for authentication in case of Token Request Failure exception -function reauthenticateUser() { - "use strict"; - //// Token Request failed exception occurred, thus do not show error pop up, re-authenticate the user - var windowLocation = window.location, - sCurrentWindowUrl = windowLocation.protocol + "//" + windowLocation.host + windowLocation.pathname, - sQueryParameter = commonFunction.AppLogEvent("", false); - sCurrentWindowUrl = sCurrentWindowUrl + "?{StandardTokens}" + "?" + oGlobalConstants.TokenRequestFailedQueryString + "=true" + sQueryParameter; - //// AppRedirect page + Client ID + Redirect URI + Parameters - window.location.href = oGlobalConstants.App_Redirect_URL + "?client_id=" + oGlobalConstants.ClientID + "&redirect_uri=" + sCurrentWindowUrl + encodeURIComponent(windowLocation.search); -} - -// Function to show common Error Pop up -function showCommonErrorPopUp(sErrorPopUpData) { - "use strict"; - if (("undefined" !== typeof oSearchGlobal && "undefined" !== typeof oSearchGlobal.sClientName && "undefined" !== typeof oSearchGlobal.sClientSiteUrl && "undefined" !== typeof oSearchGlobal.bIsTenantCall) && (("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) || oSearchGlobal.bIsTenantCall)) { - $(".ErrorPopUpContainer").addClass("ErrorPopupSP"); - } - var iErrorCode = "NA", iTimeStamp = "NA"; - if (sErrorPopUpData && "string" === typeof sErrorPopUpData && (-1 < sErrorPopUpData.indexOf("#|#"))) { - var arrErrorPopUpData = sErrorPopUpData.split("#|#"); - if (arrErrorPopUpData[0] && arrErrorPopUpData[1]) { - iErrorCode = arrErrorPopUpData[0]; - iTimeStamp = arrErrorPopUpData[1]; - } - } - $("#errorCode").text(iErrorCode); - $("#errorTimeStamp").text(iTimeStamp); - if (oGlobalConstants.TokenRequestFailedErrorCode === iErrorCode) { - reauthenticateUser(); - } else { - //// Some other exception occurred - $(".ErrorPopUpHolder").removeClass("hide"); - $(".ErrorMessageText").html(oGlobalConstants.Error_Pop_Up_Message); - if (window.top === window.self) { - $(".TryAgainLink").attr("href", "javascript:window.top.location.reload()"); - } else { - $(".TryAgainLink").attr({ "href": window.location.href, "target": "_self" }); - } - } -} - -// Function is used to remove classes that are applied during save searches -commonFunction.removeClasses = function () { - "use strict"; - if ("none" !== $(".pinnedSearchesContainer").css("display")) { - $(".rightContentContainer").removeClass("sSSortDDMinimized sSSortDD"); - $(".PinnedSearchesGridHeaderLabel").removeClass("sSHeaderLabelMinimized"); - $(".sdBanner").removeClass("sSSdBanner"); - $(".sdBannerPanel").removeClass("sSBannerPanel"); - } - $(".rightContentContainer").addClass("sortDDAllResult"); -}; - -// #region methods for drill down on folders - being used in find matter and web dashboard -commonFunction.clearGlobalVariables = function () { - "use strict"; - oUploadGlobal.oDrilldownParameter.nCurrentLevel = 0; - $("#breadcrumb").addClass("hide"); -}; - -commonFunction.drilldownNavigation = function (e) { - "use strict"; - var sParentUrl = "undefined" === typeof $(e.target).parent().attr("data-parentname") ? $(e.target).attr("data-parentname") : $(e.target).parent().attr("data-parentname"); - var sCurrentUrl = "undefined" === typeof $(e.target).parent().attr("data-foldername") ? $(e.target).attr("data-foldername") : $(e.target).parent().attr("data-foldername"); - var arrCurrentFolder = [], oParentElement = {}, oCurrentElement = {}; - - oUploadGlobal.oDrilldownParameter.sCurrentParentUrl = sCurrentUrl; - $.each(oSearchGlobal.oFolderName, function (iIndex, child) { - if ((null !== child.url && child.url === oUploadGlobal.oDrilldownParameter.sCurrentParentUrl) || (null !== child.parenturl && child.parenturl === oUploadGlobal.oDrilldownParameter.sCurrentParentUrl)) { - arrCurrentFolder.push(child); - } - if (null !== child.url && child.url === oUploadGlobal.oDrilldownParameter.sCurrentParentUrl) { - oCurrentElement = child; - } else if (sParentUrl === child.url) { - oParentElement = child; - } - }); - - if (1 < oUploadGlobal.oDrilldownParameter.nCurrentLevel) { - $("#parentFolder").html(oParentElement.name).attr("data-foldername", oParentElement.url).attr("data-parentname", oParentElement.parenturl).attr("title", oParentElement.name); - $("#currentFolder").html(oCurrentElement.name).attr("title", oCurrentElement.name); - $("#breadcrumb").removeClass("hide"); - } else { - $("#breadcrumb").addClass("hide"); - } - - if (2 === oUploadGlobal.oDrilldownParameter.nCurrentLevel) { - $("#parentFolder").hide(); - $("#breadcrumbSeparator").hide(); - } else { - $("#parentFolder").show(); - $("#breadcrumbSeparator").show(); - } - - var $HtmlChunk = buildNestedList(arrCurrentFolder, sParentUrl); - if ("undefined" !== typeof $HtmlChunk) { - $(".folderStructureContent").html($HtmlChunk); - } - - if ("undefined" !== typeof bindDroppable) { - bindDroppable($(".folderStructureContent ul li")); - } -}; - -// removes the extension from the file name -function extractTitle(fileName) { - "use strict"; - return (fileName) ? fileName.substring(0, fileName.lastIndexOf(".")) : ""; -} - -// This function will clear Filter Panel -function clearFilterPanel() { - "use strict"; - // Clear Search term - $(".filterSearchText").val(""); - - // Clear Clients - $(".refinerClient .refinerRowLink:last a").click(); - $(".refinerClient .filterOkButton:first > .tileOk").click(); - - // Clear PG - $(".refinerPG .refinerRowLink:last a").click(); - $(".refinerPG .filterOkButton:first > .tileOk").click(); - - // Clear AOL - $(".filterSearchAOL .refinerRowLink:last a").click(); - $(".refinerAOL .filterOkButton:first> .tileOk").click(); - - // Clear DOC Author - $(".filterSearchAdvance .filterSearchAuthor .refinerRight .filterSearchRefinerText").val(""); - - // Clear From Date - $(".filterSearchAdvance .filterSearchDate .refinerRight #refinerFromText").val(""); - - // Clear To Date - $(".filterSearchAdvance .filterSearchDate .refinerRight #refinerToText").val(""); - - // Clear global filter object - if (oGridConfig.isMatterView) { - oSearchGlobal.oFilterData = { AOLList: "", PGList: "", ClientsList: [], FromDate: "", ToDate: "", DocumentAuthor: "", FilterByMe: oSearchGlobal.searchOption }; - } else { - oSearchGlobal.oFilterData = { ClientsList: [], FromDate: "", ToDate: "", DocumentAuthor: "", FilterByMe: oSearchGlobal.searchOption }; - } - oSearchGlobal.sSearchTerm = ""; -} - -function ViewMatterandGoToOneNote(event, eventName) { - "use strict"; - // App Insight Event tracking for View Matter and Go To OneNote - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + eventName, true); - event.stopPropagation(); -} -// #endregion - -// Error handling for page load -$(document).ready(function () { - "use strict"; - /* Open Contextual help flyout */ - $(document).on("keydown", openContextualHelpFlyout); - if ("undefined" !== typeof oErrorObject && oErrorObject.isErrorOccured) { - if ("undefined" !== oErrorObject.errorPopupData.code && "string" === typeof oErrorObject.errorPopupData.code && (-1 < oErrorObject.errorPopupData.code.indexOf("#|#"))) { - showCommonErrorPopUp(oErrorObject.errorPopupData.code); - } - } - /* Hide the fly outs if clicked outside */ - $(document).on("click", function (event) { - if (oFilterGlobal.isVisible) { - $(".appSwitch").removeClass("appSwitchMenushow").find(".appSwitcherName").removeClass("hide"); - oFilterGlobal.isVisible = !(oFilterGlobal.isVisible); - $(".appSwitchMenu").toggleClass("hide"); - event.stopPropagation(); - } - var oAppMenuFlyout = $(".AppMenuFlyout"); - if (oAppMenuFlyout.is(":visible")) { - oAppMenuFlyout.slideUp(); - $(".OpenSwitcher").removeClass("hide"); - $(".MenuCaption").removeClass("hideMenuCaption"); - $(".CloseSwitcher").addClass("hide"); - } - $(".PersonaFlyout").slideUp(); - - var oContextualHelpFlyout = $(".ContextualHelpContainer"); - if (oContextualHelpFlyout.is(":visible")) { - oContextualHelpFlyout.hide(); - } - }); - - $(".ContextualHelpContainer").click(function (event) { - event ? event.stopPropagation() : ""; - }); - $(".ContextualHelpLogo").click(function (event) { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Contextual_help, true); - $(".PersonaFlyout").slideUp(); - showContextualHelpFlyout(event); - event ? event.stopPropagation() : ""; - }); - - /* Hide/Show fly out based on the click on the hamburger icon */ - $(".AppSwitcher").on("click", function (event) { - oCommonObject.closeAllPopupExcept("", event); //// Close all pop-ups except App Menu flyout - var oAppMenuFlyout = $(".AppMenuFlyout"); - if (!(oAppMenuFlyout.is(":visible"))) { - //// Display the close icon and close the fly out - $(".OpenSwitcher").addClass("hide"); - $(".CloseSwitcher").removeClass("hide"); - $(".MenuCaption").addClass("hideMenuCaption"); - oAppMenuFlyout.slideDown(); - } else { - $(".CloseSwitcher").addClass("hide"); - $(".OpenSwitcher").removeClass("hide"); - $(".MenuCaption").removeClass("hideMenuCaption"); - } - event ? event.stopPropagation() : ""; - }); - /*Show/Hide persona flyout*/ - $("#AppHeaderPersona").on("click", function (event) { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Profile_switch, true); - oCommonObject.closeAllPopupExcept("PersonaFlyout", event); //// Close all pop-ups except Persona Flyout - var oPersonaFlyout = $(".PersonaFlyout"); - if (oPersonaFlyout.is(":visible")) { - oPersonaFlyout.slideUp(); - } else { - oPersonaFlyout.slideDown(); - } - event ? event.stopPropagation() : ""; - }); - /* Update the links from the resource files */ - $(".MatterSitesLink").on("click", function () { - commonFunction.switchThisApp(oGlobalConstants.App_Name_Search_Matters); - }); - $(".UploadLink").on("click", function () { - commonFunction.switchThisApp(oGlobalConstants.App_Name_Search_Matters); - }); - $(".MatterDocumentsLink").on("click", function () { - commonFunction.switchThisApp(oGlobalConstants.App_Name_Search_Documents); - }); - $(".DelveLink").on("click", function () { - if ($("#autoCompleteText").val().trim()) { - $(".DelveLink").attr("href", oGlobalConstants.Delve_Link + encodeURIComponent($("#autoCompleteText").val().trim())); - } else if (oGlobalConstants.Delve_Link) { - $(".DelveLink").attr("href", oGlobalConstants.Delve_Link.split("?")[0]); - } - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Search_Documents + oGlobalConstants.Delve, true); - }); - $(".HomeLink").on("click", function () { - commonFunction.switchThisApp(oGlobalConstants.App_Name_App_Landing_Page); - }); - $(document).on("click", ".ErrorPopUpCloseIcon, .ErrorPopupBackground", function () { - $(".ErrorPopUpHolder").addClass("hide"); - }); - - $(".MatterCenterSupportLink").on("click", function (event) { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Matter_Center_Support, true); - }); -}); - -// Function to replace to default error image. -function errorImage(image) { - "use strict"; - if ($(image).attr("data-error")) { - $(image).attr("src", oGlobalConstants.Image_General_Document).attr("data-error", "true"); - } else { - $(image).attr("src", $(image).attr("src").substring(0, $(image).attr("src").lastIndexOf(".") + 1) + "png").attr("data-error", "true"); - } -} - -// Sets the object with list of OWA document extensions and Visio extensions -commonFunction.setOWADocumentExtension = function () { - "use strict"; - var arrOWAExtension, arrVisioExtension; - if (oGlobalConstants.OWA_Document_Extensions) { - arrOWAExtension = oGlobalConstants.OWA_Document_Extensions.split(","); - if (arrOWAExtension.length) { - oFilterGlobal.arrOWADocumentExtension = commonFunction.trimArrayElements(arrOWAExtension); - } - } - if (oGlobalConstants.OWA_Visio_Extensions) { - arrVisioExtension = oGlobalConstants.OWA_Visio_Extensions.split(","); - if (arrVisioExtension.length) { - oFilterGlobal.arrVisioFileExtension = commonFunction.trimArrayElements(arrVisioExtension); - } - } -}; - -// Creates the OWA URL for document if supported by OWA. Else, returns the document path -commonFunction.getOWAUrl = function (documentExtension, documentSPWebUrl, documentPath) { - "use strict"; - var sOWADocumentUrl, anchorElement = document.createElement("a"), sDocumentPath = encodeURIComponent(documentPath); - anchorElement.href = sDocumentPath; - if (-1 < $.inArray(documentExtension, oFilterGlobal.arrVisioFileExtension)) { - sOWADocumentUrl = documentSPWebUrl + "/" + oGlobalConstants.VisioWebAccessUrl.replace("{0}", sDocumentPath.replace(anchorElement.protocol + "//" + anchorElement.hostname, "")); - } else { - sOWADocumentUrl = documentSPWebUrl + "/" + oGlobalConstants.OWA_WOPIFrameUrl.replace("{0}", sDocumentPath.replace(anchorElement.protocol + "//" + anchorElement.hostname, "")); - } - return sOWADocumentUrl; -}; - -// Trims the elements of array -commonFunction.trimArrayElements = function (arrElements) { - "use strict"; - var arrTrimmedElements = []; - arrTrimmedElements = $.map(arrElements, function (item) { - return $.trim(item); - }); - return arrTrimmedElements; -}; - -$(".closeContextualHelpFlyout").click(function () { - "use strict"; - $(".ContextualHelpContainer").hide(); -}); - -function getContextualHelpData(iCurrentPage) { - "use strict"; - var sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "selectedPage": iCurrentPage }, oParam = 5; - oCommonObject.callSearchService("FetchContextualHelpContent", sParameters, onFetchContextualHelpContentSuccess, onFetchContextualHelpContentFailure, beforeFetchingContextualHelpContent, oParam); -} - -function showContextualHelpFlyout(event) { - "use strict"; - oCommonObject.closeAllPopupExcept("ContextualHelpContainer", event); //// Close all pop-ups except Contextual Menu - $(".ContextualHelpContainer").show(); -} - -function beforeFetchingContextualHelpContent() { - "use strict"; - $(".contextualHelpSections").html("
    \"Loading...\"
    " + oGlobalConstants.Load_Contextual_Help_Context + "
    "); -} - -function onFetchContextualHelpContentSuccess(dataPassed) { - "use strict"; - var sHtmlSectionContainer = ""; - if (dataPassed.Result) { - var result = JSON.parse(dataPassed.Result), - index = 0, - sortedContent = {}, - sHtmlSectionLinks = "", selectedSection = "", sHtmlSectionHeader = "", currLinkTitle = "", currLinkUrl = "", currSectionTitle = "", numberOfColumns = ""; - for (index = 0; index < result.length; index++) { - currSectionTitle = result[index] && result[index].hasOwnProperty("ContextSection") && result[index].ContextSection.hasOwnProperty("SectionTitle") ? result[index].ContextSection.SectionTitle.trim() : "NA"; - numberOfColumns = result[index] && result[index].hasOwnProperty("ContextSection") && result[index].ContextSection.hasOwnProperty("NumberOfColumns") ? result[index].ContextSection.NumberOfColumns.trim() : "1"; - currLinkTitle = result[index].hasOwnProperty("LinkTitle") ? result[index].LinkTitle.trim() : "NA"; - currLinkUrl = result[index].hasOwnProperty("LinkURL") ? result[index].LinkURL.trim() : "NA"; - - if (selectedSection.toLocaleLowerCase() !== currSectionTitle.toLocaleLowerCase()) { - // this is a new section - selectedSection = currSectionTitle; - if ("" !== sHtmlSectionHeader && "" !== typeof sHtmlSectionLinks) { - sHtmlSectionContainer = sHtmlSectionContainer + "
    " + sHtmlSectionHeader + sHtmlSectionLinks + "
    "; - } - sHtmlSectionLinks = "", sHtmlSectionHeader = ""; - sHtmlSectionHeader = "
    " + currSectionTitle + "
    "; - } - var displayNumberOfColumns = "1" === numberOfColumns ? "displaySingleColumn" : "displayDoubleColumns"; - sHtmlSectionLinks = sHtmlSectionLinks + ""; - } - if ("" !== sHtmlSectionHeader && "" !== typeof sHtmlSectionLinks) { - sHtmlSectionContainer = sHtmlSectionContainer + "
    " + sHtmlSectionHeader + sHtmlSectionLinks + "
    "; - } else { - sHtmlSectionContainer = oGlobalConstants.No_Help_Links_Message; - } - } else { - sHtmlSectionContainer = oGlobalConstants.No_Help_Links_Message; - } - $(".contextualHelpSections").html(sHtmlSectionContainer); -} - -function onFetchContextualHelpContentFailure(dataFailed) { - "use strict"; - var sResult = dataFailed.Result; - $(".contextualHelpSections").html(sResult); -} - -function openContextualHelpFlyout(e) { - "use strict"; - // if key pressed is F1 then display the popup - if (112 === e.keyCode) { - $(".ContextualHelpLogo").click(); - e.preventDefault(); - e.stopPropagation(); - } -}; - -$(window).on("resize", function () { - "use strict"; - $(".ContextualHelpContainer").hide(); - $(".PersonaFlyout").hide(); -}); - -$("#openHamburger, #closeHamburger").click(function () { - "use strict"; - var oElement = $("#headerFlyout"); - if (oElement.length) { - if (oElement.is(":visible")) { - oElement.slideUp(); - $(".matterCenterHeaderBackground").addClass("hide"); - $("#closeHamburger").addClass("hide"); - $("#openHamburger").removeClass("hide"); - $("#matterCenterHomeText").removeClass("buffer"); - } else { - oElement.slideDown(); - $(".matterCenterHeaderBackground").removeClass("hide"); - $("#closeHamburger").removeClass("hide"); - $("#matterCenterHomeText").addClass("buffer"); - } - } -}); - -$("#matterCenterHomeText").click(function () { - "use strict"; - window.open(oGlobalConstants.Site_Url + oGlobalConstants.TenantWebDashboard, "_parent"); -}); - -$(".matterCenterHeaderBackground").click(function () { - "use strict"; - closeHamburgerMenu(); -}); - -function closeHamburgerMenu() { - "use strict"; - $("#openHamburger, #closeHamburger").click(); -} - -$("#searchLink").on("click", function (event) { - "use strict"; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Enterprise_Search, true); - var sSearchText = $("#searchText").val().trim(); - var sSearchPage = ""; - if ("undefined" !== typeof oWebDashboardConstants) { - sSearchPage = oWebDashboardConstants.Search_Page_URL; - } - if ("undefined" !== typeof oSettingsConstants) { - sSearchPage = oSettingsConstants.Search_Page_URL; - } - var sDelimiter = "$|$"; - if (sSearchText) { - var sSearchPageUrl = oGlobalConstants.Site_Url + sSearchPage.replace("{0}", encodeURIComponent(sSearchText)); - var message = "enterprise_search" + sDelimiter + sSearchPageUrl; - window.top.parent.location.href = sSearchPageUrl; - } -}); - -/* Register the keypress event for search text box */ -$("#searchText").on("keypress", function (event) { - "use strict"; - if (event.which === 13) { - $("#searchLink").click(); - } -}); - -function delveIt() { - "use strict"; - if ($("#autoCompleteText").val().trim()) { - window.open(oGlobalConstants.Delve_Link + encodeURIComponent($("#autoCompleteText").val().trim())); - } else if (oGlobalConstants.Delve_Link) { - window.open(oGlobalConstants.Delve_Link.split("?")[0]); - } - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Search_Documents + oGlobalConstants.Delve, true); -} \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/GridView.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/GridView.js deleted file mode 100644 index b154e732..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/GridView.js +++ /dev/null @@ -1,818 +0,0 @@ -/// JS1003,JS2005,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS2085,JS3054,JS3057,JS3085,JS3092,JS3116,JS3056,JS3058 - -var oGridConfig = { - nColumnCounter: 1, - nGridWidth: 0, - nCurrentGridWidth: 0, - nPreviousGridWidth: 0, - nCurrentGridHeight: 0, - nPreviousGridHeight: 0, - nWidthDiff: 50, - sortable: "", -}; - -var oGridViewObject = { - pageNumber: 1, - searchResultCount: 0, - itemsPerPage: oGlobalConstants.GridViewItemsPerPage, - waitTillDataLoaded: false, - oCurrentMandatory: "", - filterData: [], - nHeaderLeftOffset: 0, - bDefaultSelectionChanged: false, - arrUserSelectedColumns: [], - isPageLoad: 0 -}; - -/* Global functions */ - -/* Function to detect if vertical scroll bar is present for a particular element */ -(function ($) { - $.fn.hasScrollBar = function () { - return this.get(0).scrollHeight > this.height(); - }; -})( -/// JS3058 -jQuery); - -var toggleView = function (isMatterView) { - "use strict"; - oCommonObject.isMatterView = isMatterView; -}; - -$(document).on("click", function () { - "use strict"; - $(".ms-ContextualMenu").removeClass("is-open"); -}); - -//// #region Formatter functions for grid view control - -/* Function to generate check-box column for grid view control*/ -function loadCheckboxColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var iCurrentIndex = parseInt(parseInt(oGridViewObject.itemsPerPage, 10) * parseInt(oGridViewObject.pageNumber, 10), 10) + parseInt(nIndex, 10); - var sCheckBoxChunk = "
    "; - return sCheckBoxChunk; -} - -/* Function to generate Ellipsis column for grid view control*/ -function loadEllipsisColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sECBMenuTitle = oCommonObject.isMatterView ? oFindMatterConstants.GridViewECBMenuTitle : oFindDocumentConstants.GridViewECBMenuTitle; - return "
    "; -} - -/* Function to generate Title column for grid view control*/ -function loadNameColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sTitleProperty = ""; - oGridConfig.nColumnCounter = 1; - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentGridViewData()) { - sTitleProperty = oCommonObject.isMatterView ? oFindMatterConstants.GridViewPinnedTitleProperty : oFindDocumentConstants.GridViewPinnedTitleProperty; - } else { - sTitleProperty = oCommonObject.isMatterView ? oFindMatterConstants.GridViewTitleProperty : oFindDocumentConstants.GridViewTitleProperty; - } - var sTitleValue = ($.trim(rowObject[sTitleProperty])) ? $.trim(rowObject[sTitleProperty]) : "NA" - , sDocumentPath, sDocumentExtension, sDocumentSPWebUrl; - if (!oCommonObject.isMatterView) { - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentGridViewData()) { - sDocumentPath = rowObject[oFindDocumentConstants.GridViewDocumentOWAUrl]; - } else { - sTitleValue = extractTitle(sTitleValue); //// Remove the extension from the document name only if current section is NOT pinned section - // Document path URL will be available as a property of rowObject in case of pinned documents. - sDocumentPath = trimEndChar(rowObject[oFindDocumentConstants.GridViewDocumentPath], "/"), sDocumentExtension = rowObject[oFindDocumentConstants.GridViewDocumentExtension], sDocumentSPWebUrl = rowObject[oFindDocumentConstants.GridViewDocumentSPWebUrl]; - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentPath = commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentPath); - } - } - } - //// Code chunk to put all returned properties as data- attributes - var sHTMLChunk = "
    " + sTitleValue + "
    " : sHTMLChunk += "\">" + sTitleValue + "
    "; - return sHTMLChunk; -} - -/* Function to generate non-specific columns for grid view control*/ -function genericColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue) ? trimEndChar($.trim(cellValue), ";") : "NA"; - var sGenericColumnChunk = "" + sCurrentValue + ""; - return sGenericColumnChunk; -} - -/* Function to generate Date column for grid view control*/ -function loadDateColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue) ? cellValue : "NA" - , orignalDateValue = sCurrentValue; - var sDate = "NA" !== sCurrentValue ? oGridView.formatDate(sCurrentValue) : "NA"; - var sGenericColumnChunk = "" + sDate + ""; - return sGenericColumnChunk; -} - -/* Function to generate ClientMatterID column for grid view control, content will be rendered as ClientID.MatterID*/ -function loadClientMatterID_Column(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sMatterIDProperty = "", sClientMatterID = ""; - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentGridViewData()) { - sMatterIDProperty = (oCommonObject.isMatterView) ? oFindMatterConstants.GridViewPinnedClientMatterIDPropertyName : oFindDocumentConstants.GridViewPinnedClientMatterIDPropertyName; - sClientMatterID = $.trim(rowObject[sMatterIDProperty]) ? $.trim(rowObject[sMatterIDProperty]) : "NA"; - } else { - sMatterIDProperty = (oCommonObject.isMatterView) ? oFindMatterConstants.GridViewMatterIDPropertyName : oFindDocumentConstants.GridViewMatterIDPropertyName; - var sClientIDValue = $.trim(cellValue) ? cellValue : "NA" - , sMatterIDValue = $.trim(rowObject[sMatterIDProperty]) ? $.trim(rowObject[sMatterIDProperty]) : "NA"; - sClientMatterID = sClientIDValue + "." + sMatterIDValue; - } - - var sClientMatterIDChunk = "" + sClientMatterID + ""; - return sClientMatterIDChunk; -} - -/* Function to modify checked out to column in case of Search Document grid view */ -function loadCheckedOutToUser(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue); - sCurrentValue = sCurrentValue ? sCurrentValue : "NA"; - var sGenericColumnChunk = "" + sCurrentValue + ""; - return sGenericColumnChunk; -} - -/* Function to generate Document Type Icon column in case of Search Document grid view */ -function loadDocumentTypeIcon(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sExtension = "", iconSrc = ""; - if (4 === oCommonObject.iCurrentGridViewData()) { - sExtension = (rowObject && rowObject.DocumentExtension) ? rowObject.DocumentExtension : ""; - } else { - sExtension = (rowObject && rowObject.FileExtension) ? rowObject.FileExtension : ""; - } - iconSrc = oCommonObject.getIconSource(sExtension); - return ""; -} - -/* Function to open matter landing page */ -function viewMatter(oElement) { - "use strict"; - var sMatterURL = $(oElement).attr("data-matterlink"); - oCommonObject.openWindow(sMatterURL, "_blank"); -} - -//// #endregion - -var oGridView = (function () { - "use strict"; - var oGridViewCommonObject = { - oGridHeader: [], - oGridView: [] - }, - oCommonFunctions = {}; - - //// #region Grid View Control - - /* Position the filtering fly out */ - oCommonFunctions.positionFilteringFlyout = function (oThisObject, sSelector) { - var iCaretIconOffset = oThisObject.position().left; - var iFlyoutLeftPosition = iCaretIconOffset; - if (iFlyoutLeftPosition > 250) { //// We checked whether select column is first column or not by getting position of caret icon - $(sSelector).css({ "left": iFlyoutLeftPosition - $(sSelector).width() + 10 }); //// for aligning filter flyout we add 10px to left because we have caret icon with 10px width - } else { - $(sSelector).css({ "left": "0px" }); - } - //// Set position of text flyout dynamically - $(sSelector).css({ "top": $("#gridViewContainer").scrollTop() + 40 }); //// Add 40px in top of text flyout because we have 40px header width. - $(sSelector).removeClass("hide"); - }; - - /* Function to bind events on list view control */ - oCommonFunctions.addGridViewControlBindings = function () { - var oGridViewContainer = $("#gridViewContainer"); - if (oGridViewContainer && oGridViewContainer.length) { - oGridViewContainer.on("scroll", function () { - oGridView.bindScrollEvent(); - }); - var oLoadingImageContainer = $("#loadingImageContainer"); - if (oLoadingImageContainer && oLoadingImageContainer.length) { - oGridViewContainer.find(".lazyLoading").remove(); - var sLoadingImageChunk = oLoadingImageContainer.html(); - $("#gridViewContainer_Grid").append(sLoadingImageChunk); - oLoadingImageContainer.addClass("hide"); - } - } - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - - /* Bind the event for getting values for given column */ - $(".jsonGridHeader .ms-Icon--caretDown").off().on("click", function (event) { - oCommonObject.arrUniqueRefinerData().length = 0; //// Refresh the array of values for filter fly out - oCommonObject.closeAllPopupExcept("", event); - $(".filterFlyoutSection .ms-Label").css("display", "inline"); //// remove fabric's inline style - $(".filterFlyoutSearchText").val(""); //// Clear the text from the search box - oCommonObject.iFilterFlyoutPageNumber(); //// Reset the page number for filter fly out data to 1 - oCommonObject.moveFilterFlyout(); - $("#filterResultsContainer").empty(); //// Clear the older filter data - var oThisObject = $(this), oCurrentHeader = oThisObject.parent(); - if (oCurrentHeader.length) { - var sRefinerName = oCurrentHeader.attr("id") - , sFilterFlyoutType = oCurrentHeader.attr("filterFlyOutType"); - if ($.trim(sRefinerName) && "NA" !== sFilterFlyoutType) { - //// Set the clear filter text and title attribute for the filter - var oHeaderTitle = oCurrentHeader.find(".headerTitle") - , oClearText = $(".clearText") - , oClearFilterTitle = $(".clearFilterTitle"); - //// Set the title for clear text filters - if (oHeaderTitle.length && oClearText.length && oClearFilterTitle.length) { - oClearFilterTitle.text(oHeaderTitle.text()); - oClearText.attr("title", $(oClearText[0]).text()); - } - //// Processing for date filters - if ("date" === sFilterFlyoutType) { - $("#dateFlyoutContent").attr({ "data-refinername": sRefinerName, "data-filterflyouttype": sFilterFlyoutType }); - oCommonObject.setDateFilters(sRefinerName, sFilterFlyoutType); - oCommonFunctions.positionFilteringFlyout(oThisObject, "#dateFlyoutContent"); - } else { //// Processing for single and multi text filters - $("#textFlyoutContent").attr({ "data-refinername": sRefinerName, "data-filterflyouttype": sFilterFlyoutType }); - oCommonFunctions.positionFilteringFlyout(oThisObject, "#textFlyoutContent"); - //// If current section is pinned section - if (4 === oCommonObject.iCurrentGridViewData()) { - //// add code for pinned sections - oGridViewObject.filterData = []; - var filter = oCommonObject.isMatterView ? oCommonObject.oPinnedFlyoutFilters.oSearchMatterFilters : oCommonObject.oPinnedFlyoutFilters.oSearchDocumentFilters; - if (Object.keys(filter).length) { - oCommonObject.filterData(filter, true, sRefinerName); - } else { - var oData = oCommonObject.pinnedFilterData.length ? oCommonObject.pinnedFilterData : oCommonObject.pinnedData; - $.each(oData, function (iCount, sCurrentValue) { - var arrSplitValues = []; - if ($.trim(sCurrentValue[sRefinerName])) { - arrSplitValues = sCurrentValue[sRefinerName] && sCurrentValue[sRefinerName].split(";"); - } - $.each(arrSplitValues, function (iCurrentCount, sValue) { - var sTrimmedValue = $.trim(sValue); - ($.inArray(sTrimmedValue, oGridViewObject.filterData) === -1) && oGridViewObject.filterData.push(sTrimmedValue); - }); - }); - } - //// Server side sorting on the filter fly out data - oGridViewObject.filterData.sort(function (previousValue, nextValue) { - if (isNaN(previousValue) || isNaN(nextValue)) { - return previousValue > nextValue ? 1 : -1; - } - return previousValue - nextValue; - }); - } else { //// Processing for My and All sections - var sFilterSearchTerm = oCommonObject.formatFilterSearchTerm(sRefinerName); - } - oCommonObject.isSearchText = 1; - oCommonObject.highlightSelectedFilters(sRefinerName, sFilterFlyoutType); - } - } - } - event && event.stopPropagation(); - }); - $(".jsonGridHeader").hover(function () { - if ("NA" !== $(this).attr("filterFlyOutType")) { - $(this).find(".ms-Icon--caretDown").css("opacity", "1"); - } - }, function () { - $(this).find(".ms-Icon--caretDown").css("opacity", "0"); - }); - }; - - /* Function to generate the grid view JSON */ - oCommonFunctions.generateGridViewJSON = function () { - var gridViewJSON = [], arrColumnNames = [], arrColumnWidth = [], arrColumnFormatter = []; - if (oCommonObject.isMatterView) { - /* Get the data that is to be shown in Search Matter grid view control */ - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentGridViewData()) { - arrColumnNames = $.trim(oFindMatterConstants.GridViewPinnedColumnValueFields) ? $.trim(oFindMatterConstants.GridViewPinnedColumnValueFields).split(";") : ""; - oGridConfig.sortable = true; - } else { - arrColumnNames = $.trim(oFindMatterConstants.GridViewColumnValueFields) ? $.trim(oFindMatterConstants.GridViewColumnValueFields).split(";") : ""; - oGridConfig.sortable = false; - } - arrColumnWidth = $.trim(oFindMatterConstants.GridViewColumnWidth) ? $.trim(oFindMatterConstants.GridViewColumnWidth).split(";") : ""; - arrColumnFormatter = $.trim(oFindMatterConstants.GridViewColumnFomatter) ? $.trim(oFindMatterConstants.GridViewColumnFomatter).split(";") : ""; - } else { - /* Get the data that is to be shown in Search Document grid view control */ - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentGridViewData()) { - arrColumnNames = $.trim(oFindDocumentConstants.GridViewPinnedColumnValueFields) ? $.trim(oFindDocumentConstants.GridViewPinnedColumnValueFields).split(";") : ""; - oGridConfig.sortable = true; - } else { - arrColumnNames = $.trim(oFindDocumentConstants.GridViewColumnValueFields) ? $.trim(oFindDocumentConstants.GridViewColumnValueFields).split(";") : ""; - oGridConfig.sortable = false; - } - arrColumnWidth = $.trim(oFindDocumentConstants.GridViewColumnWidth) ? $.trim(oFindDocumentConstants.GridViewColumnWidth).split(";") : ""; - arrColumnFormatter = $.trim(oFindDocumentConstants.GridViewColumnFomatter) ? $.trim(oFindDocumentConstants.GridViewColumnFomatter).split(";") : ""; - } - if (arrColumnNames && arrColumnNames.length && arrColumnWidth && arrColumnWidth.length && arrColumnFormatter && arrColumnFormatter.length) { - /* Generate the column structure that is to be shown in the grid view control */ - $.each(arrColumnNames, function (iCurrentIndex, sCurrentValue) { - var oCurrentItem = {}; - if ("ECB" === sCurrentValue) { - oCurrentItem = { name: sCurrentValue, width: arrColumnWidth[iCurrentIndex], id: sCurrentValue, align: "center", trimOnOverflow: false, formatter: arrColumnFormatter[iCurrentIndex], sortable: oGridConfig.sortable, sortType: String }; - } else { - oCurrentItem = { name: sCurrentValue, width: arrColumnWidth[iCurrentIndex], id: sCurrentValue, align: "left", trimOnOverflow: false, formatter: arrColumnFormatter[iCurrentIndex], sortable: oGridConfig.sortable, sortType: String }; - } - gridViewJSON.push(oCurrentItem); - }); - return gridViewJSON; - } - return []; - }; - - /* Function to load grid view control */ - oCommonFunctions.createGridView = function (oDataToLoad, bIsPageLoadData) { - //// Get the grid view JSON based on the current page - var gridViewJSON = oCommonFunctions.generateGridViewJSON(); - if (gridViewJSON && gridViewJSON.length) { - var arrHeaderData, arrHeaderDataTitle; - if (oCommonObject.isMatterView) { - arrHeaderData = oFindMatterConstants.GridViewHeaderName.split(";"); - arrHeaderDataTitle = oFindMatterConstants.GridViewHeaderNameTitle.split("$|$"); - } else { - arrHeaderData = oFindDocumentConstants.GridViewHeaderName.split(";"); - arrHeaderDataTitle = oFindDocumentConstants.GridViewHeaderNameTitle.split("$|$"); - } - var oHeaderNames = [], oHeaderFilterType = []; - $.each(arrHeaderData, function (iItem, sCurrentValue) { - var oCurrentHeader = sCurrentValue && sCurrentValue.split(","); - oHeaderNames.push(oCurrentHeader[0]); - oCommonObject.oHeaderFilterType.push(oCurrentHeader[1]); - }); - var sortBy = (oCommonObject.isMatterView) ? oFindMatterConstants.GridViewTitleProperty : oFindDocumentConstants.GridViewTitleProperty; - //// Generate the common JSON structure for generating the grid view control - var GridConfig = { - container: "gridViewContainer", - data: oDataToLoad, - gridName: "Grid View", - gridHeader: oHeaderNames, - gridHeaderTitle: arrHeaderDataTitle, - columnNames: gridViewJSON, - sortby: "", - sortorder: "asc", - sortType: String, - initialsortorder: "", - retainpageonsort: false, - maxRows: oGridViewObject.itemsPerPage, - viewrecords: true, - pagination: false, - cellSpacing: 0 - }; - if (bIsPageLoadData) { - //// Generate the grid view grid for page load data - oCommonObject.isAllRowSelected = false; - new oGrid.JsonGrid(GridConfig); - $(".jsonGridHeader").addClass("ms-font-m-plus"); - oGridViewObject.nHeaderLeftOffset = $("#gridViewContainer_Grid thead").length ? $("#gridViewContainer_Grid thead")[0].offsetLeft : ""; - } else { - //// Generate the grid view table without header for lazy load data - var oAdditionalProperties = { - currentPage: 0, - tblBody: $("#gridViewContainer tbody")[0], - drilldown: false - }; - - //// Update the JSON object to extend additional properties for generating grid view - GridConfig = $.extend(GridConfig, oAdditionalProperties); - new oGrid.CreateHTMLTableRow(GridConfig); - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - - //// Update the data present in the grid view object to have data loaded by lazy load - $.merge(oGrid.gridObject[0].data, oDataToLoad); - oGrid.gridObject[0].maxRows = oGrid.gridObject[0].data.length; - oGridViewObject.waitTillDataLoaded = false; - } - $(window).trigger("resize"); - oCommonObject.configureOnLoadView(); - oCommonFunctions.addGridViewControlBindings(); - } - }; - - /* Function to load grid view control */ - oCommonFunctions.loadGridView = function (sDataToLoad, bIsPageLoadData) { - var oDataToLoad = "", oGridViewContainer = $("#gridViewContainer_Grid"); - if ("null" !== sDataToLoad) { - oDataToLoad = JSON.parse(sDataToLoad); - } else { - oDataToLoad = JSON.parse(oGridViewCommonObject.sData); - } - if (4 === oCommonObject.iCurrentGridViewData()) { - $.each(oDataToLoad, function (key, value) { - var sMatterId = oCommonObject.isMatterView ? oFindMatterConstants.GridViewPinnedMatterIDPropertyName : oFindDocumentConstants.GridViewPinnedMatterIDPropertyName - , sClientId = oCommonObject.isMatterView ? oFindMatterConstants.GridViewPinnedMatterClientIDPropertyName : oFindDocumentConstants.GridViewPinnedDocumentClientIDPropertyName; - value.CalClientMatterId = value[sClientId] + "." + value[sMatterId]; - }); - oCommonObject.pinnedData = oDataToLoad; - - } - if (!(oGridViewContainer.length && 4 === oCommonObject.iCurrentGridViewData())) { - oCommonFunctions.createGridView(oDataToLoad, bIsPageLoadData); - } - oCommonFunctions.bindECB(); - oCommonObject.enableSearch(); - }; - - /* Function to bind ECB control */ - oCommonFunctions.bindECB = function () { - /* First unbind the click event and re-bind the ECB control to all the rows present in the grid view control */ - $(".ellipsis").off().on("click", function (event) { - var oCurrentRow = $(this).parents(".GridRow"), sECBHTMLChunk = {}, oCheckBoxList = {}; //// Get the parent row with class GridRow - $(".ECBControlClass").remove(); - sECBHTMLChunk = $("#ECBControl").length && $("#ECBControl").clone() && $("#ECBControl").clone()[0]; - $(sECBHTMLChunk).removeClass("hide").addClass("ECBControlClass"); - $("#gridViewContainer").append(sECBHTMLChunk); - /* Function to bind ECB controls */ - oCommonObject.addECBBindings(); - var $AllGridViewItems = $(".isSelectRowsActive"); - if ($AllGridViewItems && $AllGridViewItems.length && $AllGridViewItems[0].checked) { - $AllGridViewItems.prop("checked", false); - oCommonObject.isAllRowSelected = false; - } - var oGridViewRows = $(".GridRow, .GridRowAlternate"); - if (oGridViewRows.length) { - oGridViewRows.removeClass("is-selectedRow"); - $(".ellipsis").parent().removeClass("ellipsisBackground"); - $(".checkBoxImage").removeClass("checkboxHoverImageContainer checkboxImageContainer").addClass("hide"); - $(".checkBox").removeClass("hide"); - - oCheckBoxList = oGridViewRows.find(".ms-ChoiceField-input"); - if (oCheckBoxList && oCheckBoxList.length) { - $.each(oCheckBoxList, function (iCurrentItem, sCurrentValue) { - sCurrentValue.checked = false; - }); - } - var oCurrentRow = $(this).parent().parent(); - if (oCurrentRow.length) { - oCurrentRow.addClass("is-selectedRow"); - $(this).parent().addClass("ellipsisBackground"); - var currentCheckbox = $(this).parent().parent().find(".ms-ChoiceField-input"); - if (currentCheckbox && currentCheckbox.length) { - currentCheckbox[0].checked = true; - oCurrentRow.find(".checkBoxImage").removeClass("hide checkboxHoverImageContainer").addClass("checkboxImageContainer"); - oCurrentRow.find(".checkBox").addClass("hide"); - $("#attachDocuments").removeClass("is-disabled"); - } - } - } - !(oCurrentRow && oCurrentRow.length) ? oCurrentRow = $(this).parents(".GridRowAlternate") : ""; //// if GridRow is not present check for GridRowAlternate - var oContextualMenu = $(".ms-ContextualMenu"); - oGridViewObject.oCurrentMandatory = oCurrentRow.find(".mandatory"); //// Assign to global object so that it can used for reference from outer JS files as well - if (oCommonObject.isMatterView) { - updateECBforMatter(oContextualMenu, oGridViewObject.oCurrentMandatory); - } else { - updateECBforDocument(oContextualMenu, oGridViewObject.oCurrentMandatory); - } - oContextualMenu.find(".ms-ContextualMenu-link").removeClass("is-selected"); - //// Position the ECB fly out on the current ellipses icon and display the fly out - var nDynamicWidth = oCommonObject.getWidth() - , iEllipsesOffsetFromTop = $(this).position().top - , iECBMenuOffsetFromTop = iEllipsesOffsetFromTop - , iGridViewOffsetFromTop = $("#gridViewContainer").offset().top + $("#gridViewContainer").height(); //// Adjust ECB menu relative to grid view control (Kept commented for future purpose) - nDynamicWidth = (450 < nDynamicWidth) ? $(this).position().left - 5 : (parseInt($(this).position().left + 10, 10) - parseInt(oContextualMenu.width(), 10)) + 15; - $("#ECBControl").css({ - "left": nDynamicWidth, "top": iEllipsesOffsetFromTop + 23 - }); //// Add 10px to adjust the as per height of ellipses - oContextualMenu.addClass("is-open"); - oCommonObject.closeAllPopupExcept("ms-ContextualMenu", event); //// Close all pop-ups except ECB menu - (event) ? event.stopPropagation() : ""; - }); - }; - - /* Function to bind the scroll event on the element */ - oCommonFunctions.bindScrollEvent = function () { - if (4 !== oCommonObject.iCurrentGridViewData()) { //// No lazy loading for pinned section (flag = 4) - if (!oGridViewObject.waitTillDataLoaded && ($("#gridViewContainer").scrollTop() + $("#gridViewContainer").height() > ($("#gridViewContainer_Grid").height() - (1 - (oGlobalConstants.GridViewLazyLoadingLimit / 100)) * $("#gridViewContainer_Grid").height()))) { - var iMaxCurrentData = parseInt(oGridViewObject.itemsPerPage) * (oGridViewObject.pageNumber); - if (oGridViewObject.searchResultCount > iMaxCurrentData) { - oGridViewObject.waitTillDataLoaded = true; //// Throttle the next request till current service request is completed - $("#gridViewContainer_Grid").find(".lazyLoading").removeClass("hide"); //// Display the loading image - $("#gridViewContainer .jsonGridHeader").attr("disabled", "disabled").addClass("disableHeader");////disable the grid header for lazy loading - oGridViewObject.pageNumber++; - if (oCommonObject.isMatterView) { - getSearchMatters("#gridView", 1); - } else { - getSearchDocuments("#gridView", 1); - } - } - } - } - $("#gridViewContainer_Grid thead").css("left", oGridViewObject.nHeaderLeftOffset - $("#gridViewContainer").scrollLeft()); - $("#gridViewContainer_Grid thead").width(($(document).width() - 37) + $("#gridViewContainer").scrollLeft()); //// set header width according to document width(after Deducting 37px which is width of column picker notch) and scroll of grid view container - if (320 > window.innerWidth) { - $("#gridViewContainer_Grid thead").css("left", (-($("body").scrollLeft())) + oGridViewObject.nHeaderLeftOffset); //// if there is horizontal scroll bar then set header left according to that scrollbar - } - }; - - $(document).on("scroll", function (event) { - $("#gridViewContainer_Grid thead") && $("#gridViewContainer_Grid thead").css("left", oGridViewObject.nHeaderLeftOffset - $(document).scrollLeft()); - }); - - /* Function to trigger event after window resize */ - var waitForFinalEvent = (function () { - "use strict"; - var timers = { - }; - return function (callback, ms, uniqueId) { - if (timers[uniqueId]) { - clearTimeout(timers[uniqueId]); - } - timers[uniqueId] = setTimeout(callback, ms); - }; - })(); - //// #endregion - - $(window).on("resize", function (event) { - "use strict"; - oCommonObject.closeAllPopupExcept("", event); //// Close all pop-ups - oCommonFunctions.adjustGridViewHeight(); - oCommonObject.adjustCaretIcon(); - //// Adjust the position of column picker as per presence of scroll - if ($("#gridViewContainer").hasScrollBar()) { - $("#columnPickerStrip, #columnPickerControl, #columnPickerContainer").removeClass("noScrollPadding").addClass("scrollPadding"); - } else { - $("#columnPickerStrip, #columnPickerControl, #columnPickerContainer").removeClass("scrollPadding").addClass("noScrollPadding"); - } - $("#gridViewContainer_Grid thead").css("width", ($(document).width() - 37) + $("#gridViewContainer").scrollLeft()); //// set header width according to document width(after Deducting 37px which is width of column picker notch) and scroll of grid view container - waitForFinalEvent(function () { - "use strict"; - //// function call of change grid view container height dynamically - oCommonFunctions.applyMapContainerHeight(); - }, 500, "String"); - }); - - oCommonFunctions.adjustGridViewHeight = function () { - var nCurrentWindowHeight = window.innerHeight; - var nCurrentWindowWidth = window.innerWidth; - //// check whether window height is less then 190px or not - //// if yes then set container height to 155 - //// else set container height according to windows height - if (parseInt(nCurrentWindowHeight) <= 155) { - $("#gridViewContainer").height(55); - } else { - var oAttachButton = $("#attachDocuments"), iButtonHeight = 0; - if (oAttachButton && oAttachButton.length) { - iButtonHeight = (oAttachButton.attr("data-applicable")) ? 53 : 0; - } - //// If width is less than 320 px, then two scroll bars will appear and that's why we have this condition - if (320 > nCurrentWindowWidth) { - $("#gridViewContainer").css("height", parseInt(nCurrentWindowHeight, 10) - (109 + iButtonHeight)); //// Deducting 109px from windows height in order to remove the height of App header section and height of app scrollbar - } else { - $("#gridViewContainer").css("height", parseInt(nCurrentWindowHeight, 10) - (92 + iButtonHeight)); //// Deducting 92px from windows height in order to remove the height of App header section - } - $("#columnPickerStrip").css("height", parseInt(nCurrentWindowHeight, 10) - (111 + iButtonHeight)); //// Deducting 111px from windows height in order to remove the height of App header section and horizontal scrollbar for grid view - } - }; - /* Function to set Grid View height dynamically according to window height*/ - oCommonFunctions.applyMapContainerHeight = function () { - oGridConfig.nPreviousGridHeight = oGridConfig.nCurrentGridHeight; - oGridConfig.nCurrentGridHeight = window.innerHeight; - //// check height of previous grid and current grid - //// oCommonObject.isServiceCallComplete used for check whether any service is currently running or not - //// 4 != oCommonObject.iCurrentGridViewData() used for check that there should not pinned matter/document data in grid view - if (oGridConfig.nPreviousGridHeight !== oGridConfig.nCurrentGridHeight && 4 !== oCommonObject.iCurrentGridViewData()) { // && oCommonObject.isServiceCallComplete) { - if (oGridConfig.nCurrentGridHeight >= parseInt(oGlobalConstants.GridView_BreakPoint, 10)) { - if (oGridConfig.nPreviousGridHeight < parseInt(oGlobalConstants.GridView_BreakPoint, 10)) { - oCommonObject.abortRequest(); - ////if height of container is more then 710px then load records according to height of browser window - //// equation : items per page = items per page * ( height of browser window / 710 ) + 1 - //// In 710px height we can show 21 list item in page - oCommonObject.isAllRowSelected = false; - oGridViewObject.itemsPerPage = oGridViewObject.itemsPerPage * (Math.floor((parseInt(oGridConfig.nCurrentGridHeight, 10) / parseInt(oGlobalConstants.GridView_BreakPoint, 10))) + 1); - oCommonObject.clearGridViewContent(); - // Update the grid view for matters/documents - oCommonObject.updateGridView(); - } - } else if (oGridConfig.nPreviousGridHeight >= oGlobalConstants.GridView_BreakPoint || 0 === oGridConfig.nPreviousGridHeight) { - ////oGridConfig.nPreviousGridHeight === 0 is checked for page load - //// set itemsperpage = 21 - oCommonObject.abortRequest(); - oCommonObject.isAllRowSelected = false; - oGridViewObject.itemsPerPage = oGlobalConstants.GridViewItemsPerPage; - if (1 === oGridViewObject.pageNumber || oGridConfig.nCurrentGridHeight <= parseInt(oGlobalConstants.GridView_BreakPoint, 10)) { - oCommonObject.clearGridViewContent(); - } - if (4 === oCommonObject.iCurrentGridViewData()) { - //// call pinned matters/documents - (oCommonObject.isMatterView) ? getPinnedMatters($("#gridView")) : getPinnedDocument($("#gridView")); - } else { - oCommonObject.updateGridView(); - } - } - } - //// If window height goes below 460px, dynamically updating the height of column picker panel. If not, removing in-line height, which will in turn apply height from css - if (460 >= parseInt(oGridConfig.nCurrentGridHeight)) { - $("#columnPickerBlock").height(parseInt(oGridConfig.nCurrentGridHeight) - 160); //// Deducting 160px from windows height in order to remove the height of App header section and 40px margin of column picker panel - $("#columnPickerPanel").height(parseInt(oGridConfig.nCurrentGridHeight) - 120); //// Deducting 120px from windows height in order to remove the height of App header section - $("#ContextualHelp .ContextualHelpContainer").height(parseInt(oGridConfig.nCurrentGridHeight) - 20); //// Deducting 20px from windows height in order to avoid app scroll bar - } else { - $("#columnPickerPanel,#columnPickerBlock,#ContextualHelp .ContextualHelpContainer").css("height", ""); - } - }; - - /* Function to get the initial width of the grid view control */ - oCommonFunctions.getGridViewWidth = function () { - var arrGridWidthValues = oCommonObject.isMatterView ? oFindMatterConstants.GridViewColumnWidth.split(";") : oFindDocumentConstants.GridViewColumnWidth.split(";"); - oGridConfig.nCurrentGridWidth = oGridConfig.nPreviousGridWidth = arrGridWidthValues.reduce(function (previousValue, currentValue) { return parseInt(previousValue) + parseInt(currentValue); }) + oGridConfig.nWidthDiff; - }; - - /* Function to load the ECB control and register ECB actions */ - oCommonFunctions.loadECBControl = function () { - var arrCurrentView, arrECBTitle; - /* Get the list of actions to be displayed in the ECB menu based on current page */ - if (oCommonObject.isMatterView) { - arrCurrentView = $.trim(oFindMatterConstants.GridViewECBActions) ? $.trim(oFindMatterConstants.GridViewECBActions).split(";") : ""; - arrECBTitle = oFindMatterConstants.GridViewECBActionsTitle ? (oFindMatterConstants.GridViewECBActionsTitle).split("$|$") : ""; - } else { - arrCurrentView = $.trim(oFindDocumentConstants.GridViewECBActions) ? $.trim(oFindDocumentConstants.GridViewECBActions).split(";") : ""; - arrECBTitle = oFindDocumentConstants.GridViewECBActionsTitle ? (oFindDocumentConstants.GridViewECBActionsTitle).split("$|$") : ""; - } - - /* Generate the ECB control based on the current page */ - (arrCurrentView && arrECBTitle && arrCurrentView.length == arrECBTitle.length) ? oECBControl.generateECBControl(arrCurrentView, arrECBTitle) : ""; - - /* Function to bind ECB controls */ - oCommonObject.addECBBindings(); - }; - - /* Function to convert the date in specific format For now only MMM DD, YYYY format is supported*/ - oCommonFunctions.formatDate = function (dDate) { - "use strict"; - var oDates = new Date(dDate), months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], date = "", oLocalDate = dDate; - if (isNaN(oDates)) { - var arrSplitedDate = dDate.replace(/[-]/g, "/"); - arrSplitedDate = arrSplitedDate.split("/"); - dDate = arrSplitedDate[1] + "-" + arrSplitedDate[0] + "-" + arrSplitedDate[2]; - oDates = new Date(dDate); - } - if (0 > oLocalDate.indexOf("Z")) { - date += months[parseInt(oDates.getMonth(), 10)] + " "; - date += oDates.getDate() + ", "; - date += oDates.getFullYear(); - } else { - date += months[parseInt(oDates.getUTCMonth(), 10)] + " "; - date += oDates.getUTCDate() + ", "; - date += oDates.getUTCFullYear(); - } - return date; - }; - oCommonFunctions.highlightGridViewRow = function ($RowElement, flag) { - var oGridRow = {}, oCheckBox = {}, oCheckImage = {}, oDocumentCheckbox = {}; - oGridRow = $RowElement; - oCheckBox = oGridRow.find(".checkBox"); - oCheckImage = oGridRow.find(".checkBoxImage"); - oDocumentCheckbox = oGridRow.find(".ms-ChoiceField-input"); - if (flag) { - oGridRow.addClass("is-selectedRow"); - oGridRow.find(".ellipsis").parent().addClass("ellipsisBackground"); - if (oDocumentCheckbox && oDocumentCheckbox.length) { - oDocumentCheckbox.prop("checked", true); - oCheckBox.addClass("hide"); - oCheckImage.removeClass("checkboxHoverImageContainer hide").addClass("checkboxImageContainer"); - } - } else { - oGridRow.removeClass("is-selectedRow"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisBackground"); - if (oDocumentCheckbox && oDocumentCheckbox.length) { - oDocumentCheckbox.prop("checked", false); - oGridRow.find(".checkboxHoverImageContainer").addClass("hide"); - oCheckBox.removeClass("hide"); - oCheckImage.removeClass("checkboxHoverImageContainer checkboxImageContainer").addClass("hide"); - } - } - var oSelectedRows = $(".is-selectedRow"); - (oSelectedRows && oSelectedRows.length) ? $("#attachDocuments").removeClass("is-disabled") : $("#attachDocuments").addClass("is-disabled"); - }; - - $(document).ready(function () { - /* Display the header */ - $(".AppHeader").removeClass("hide"); - $(document).on("click", ".jsonGridHeader:not('#DocType, #CheckBox ,#ECB')", function () { - var oThisObject = $(this), oGridRow = $(".GridRow, .GridRowAlternate"); - oCommonObject.isAllRowSelected = false; - if (4 === oCommonObject.iCurrentGridViewData()) { - $(".sort").addClass("hide"); - if ("asc" === oThisObject.attr("sortorder")) { - oThisObject.find(".sort").html("↑").removeClass("hide"); - } else { - oThisObject.find(".sort").html("↓").removeClass("hide"); - } - $(".isSelectRowsActive").prop("checked", false); - oCommonFunctions.highlightGridViewRow(oGridRow, false); - $("#attachDocuments").addClass("is-disabled"); - oGridView.bindECB(); - } else { - var sRefinerName = $.trim(oThisObject.attr("id")) //// This is the name of the property on which the sort is to be applied - , oCurrentSortObject = oCommonObject.oSortDetails(); - if (oCurrentSortObject.ByProperty === sRefinerName) { //// If same column is clicked - oCurrentSortObject.Direction = (oCurrentSortObject.Direction) ? 0 : 1; - } else { - oCurrentSortObject.Direction = 0; //// Ascending sort by default on first click - } - oCurrentSortObject.ByProperty = sRefinerName ? sRefinerName : ""; - oCommonObject.clearGridViewContent(); - if (oCommonObject.isMatterView) { - getSearchMatters("#gridView", 1); - } else { - getSearchDocuments("#gridView", 1); - } - } - }); - $(document).on("click", ".GridRow, .GridRowAlternate", function (event) { - var oDocumentCheckbox = {}, oCheckBox = {}, oCheckImage = {}, oGridRow = $(this); - if (event && event.target && (0 > event.target.className.indexOf("field"))) { - if (oCommonObject.isMatterView && !oGridRow.hasClass("is-selectedRow")) { - $(".GridRow, .GridRowAlternate").removeClass("is-selectedRow"); - $(".ellipsis").parent().removeClass("ellipsisBackground"); - } - if (oGridRow.hasClass("is-selectedRow")) { - oCommonFunctions.highlightGridViewRow(oGridRow, false); - } else { - oCommonFunctions.highlightGridViewRow(oGridRow, true); - } - } - oCommonObject.onGridViewCheckboxClick(); - }); - - $(document).on("click", ".checkboxHoverImageContainer", function (event) { - var oGridRow = $(this).parent().parent(); - if (oGridRow && oGridRow.length) { - oGridRow.click(); - } - event ? event.stopPropagation() : ""; - }); - - $(document).on("mouseover", ".GridRow, .GridRowAlternate", function (event) { - var oGridRow = $(this); - oGridRow.find(".checkBox").addClass("hide"); - oGridRow.find(".checkBoxImage").removeClass("hide checkboxImageContainer").addClass("checkboxHoverImageContainer"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisBackground").addClass("ellipsisHoverBackground"); - - }).on("mouseout", ".GridRow, .GridRowAlternate", function (event) { - var oGridRow = $(this); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisHoverBackground"); - if (oGridRow.hasClass("is-selectedRow")) { - oGridRow.find(".checkBoxImage").removeClass("checkboxHoverImageContainer hide").addClass("checkboxImageContainer"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisHoverBackground").addClass("ellipsisBackground"); - } else { - oGridRow.find(".checkBoxImage").addClass("hide"); - oGridRow.find(".checkBox").removeClass("hide"); - } - }); - - $(document).on("click", ".searchPanelDropdownOption", function (event) { - $(".searchPanelDropdownOption").removeClass("selectedDropdownOption"); - $(this).addClass("selectedDropdownOption"); - }); - }); - - return ({ - loadGridView: function (sDataToLoad, bIsPageLoadData) { - oCommonFunctions.loadGridView(sDataToLoad, bIsPageLoadData); - }, - scrollGridView: function ($Element) { - return oCommonFunctions.scrollGridView($Element); - }, - highlightGridViewRow: function ($RowElement, bFlag) { - oCommonFunctions.highlightGridViewRow($RowElement, bFlag); - }, - loadECBControl: function () { - oCommonFunctions.loadECBControl(); - }, - getGridViewWidth: function () { - oCommonFunctions.getGridViewWidth(); - }, - formatDate: function (dDate) { - return oCommonFunctions.formatDate(dDate); - }, - bindScrollEvent: function () { - oCommonFunctions.bindScrollEvent(); - }, - adjustGridViewHeight: function () { - oCommonFunctions.adjustGridViewHeight(); - }, - applyMapContainerHeight: function () { - oCommonFunctions.applyMapContainerHeight(); - }, - generateGridViewJSON: function () { - return oCommonFunctions.generateGridViewJSON(); - }, - bindECB: function () { - return oCommonFunctions.bindECB(); - }, - addGridViewControlBindings: function () { - return oCommonFunctions.addGridViewControlBindings(); - } - }); -})(); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Home.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Home.js deleted file mode 100644 index 6d3ab557..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Home.js +++ /dev/null @@ -1,104 +0,0 @@ -/// JS1003,JS2005,JS2023,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS2085,JS3054,JS3056,JS3057,JS3058,JS3085,JS3092,JS3116 -//// Above exclusion list is signed off as per the Modern Cop Exclusion list. - -var oHomeObject = (function () { - "use strict"; - - // #region Common Objects - var oJQueryObjects = { - $UploadAttachments: "", - $MattersContainer: "", - $DocumentsContainer: "", - $CreateMatter: "", - $MatterCenterSupportLink: "", - $LearnMoreLink: "", - $ProfileSwitcher: "", - $ContextualHelp: "", - $Home: "" - }, - commonFunctions = {}; - // #endregion - - /* Function to bind the click events on the Primary and Secondary Link Containers */ - commonFunctions.SwitchApp = function (oCurrentElement, sCurrentSelector, sAppNameToSwitch) { - oCurrentElement.find(sCurrentSelector).on("click", function () { - commonFunction.switchThisApp(sAppNameToSwitch); - }); - }; - - /* Function to bind the click events for App Insight Events tracking */ - commonFunctions.AppInsightEventsLogging = function (oCurrentElement, sEventToLog, isNoServiceCall) { - oCurrentElement.on("click", function () { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + sEventToLog, isNoServiceCall); - }); - }; - - $(document).ready(function () { - - /////* Set current page to 0 */ - oCommonObject.sCurrentPage = oGlobalConstants.Home_page; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oGlobalConstants.Home_page, true); - /* Get Contextual Help Data */ - getContextualHelpData(0); - - /* Display the header */ - $(".AppHeader").removeClass("hide"); - - // #region JQuery Bindings - oJQueryObjects.$UploadAttachments = $(".UploadAttachments"); - oJQueryObjects.$MattersContainer = $(".MattersContainer"); - oJQueryObjects.$DocumentsContainer = $(".DocumentsContainer"); - oJQueryObjects.$CreateMatter = $(".CreateMatter"); - oJQueryObjects.$MatterCenterSupportLink = $(".MatterCenterSupportLink"); - oJQueryObjects.$LearnMoreLink = $(".LearnMoreLink"); - oJQueryObjects.$ProfileSwitcher = $("#ProfileSwitcher"); - oJQueryObjects.$ContextualHelp = $("#ContextualHelp"); - oJQueryObjects.$Home = $(".Home"); - // #endregion - - /* Update the links from the resource files */ - oJQueryObjects.$LearnMoreLink.attr({ "href": oGlobalConstants.Learn_More_Link, "target": "_blank" }); - oJQueryObjects.$MatterCenterSupportLink.attr("href", "mailto:" + oGlobalConstants.Matter_Center_Support_Email); - $(".MatterDashboardLink").attr({ "href": oGlobalConstants.Site_Url + oGlobalConstants.TenantWebDashboard, "target": "_blank" }); - - /* Move the page specific content in the header section */ - var $HeaderPlaceHolder = $("#HeaderPlaceHolderContent"); - $("#HeaderPlaceHolder").html($HeaderPlaceHolder.html()); - $(".AppLogoContainer").removeClass("hide"); - $HeaderPlaceHolder.html(""); - - /* Remove the information panel on click of dismiss link */ - $(".DismissLink").on("click", function () { - $(".WelcomeBar").empty().addClass("RemoveWelcomeBar"); - }); - - // #region Bind the click events on the Primary and Secondary Link Containers - commonFunctions.SwitchApp(oJQueryObjects.$MattersContainer, ".FigureCaption, img", oGlobalConstants.App_Name_Search_Matters); - commonFunctions.SwitchApp(oJQueryObjects.$DocumentsContainer, ".FigureCaption, img", oGlobalConstants.App_Name_Search_Documents); - commonFunctions.SwitchApp(oJQueryObjects.$UploadAttachments, ".SecondaryLinksImg, .SecondaryLinksText", oGlobalConstants.App_Name_Search_Matters); - commonFunctions.SwitchApp(oJQueryObjects.$CreateMatter, ".SecondaryLinksImg, .SecondaryLinksText", oGlobalConstants.App_Name_Provision_Matters); - // #endregion - - // #region Bind the click events for App Insight Events tracking - commonFunctions.AppInsightEventsLogging(oJQueryObjects.$LearnMoreLink, oGlobalConstants.Learn_More_link_Name, true); - commonFunctions.AppInsightEventsLogging(oJQueryObjects.$Home, "/" + oGlobalConstants.Home_page, true); - commonFunctions.AppInsightEventsLogging(oJQueryObjects.$UploadAttachments, oGlobalConstants.Upload_Attachments, true); - // #endregion - - $(".AppLogoContainer").on("click", function () { - // App Insight Event tracking for Web dashboard - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Web_Dashboard, true); - commonFunction.switchThisApp(oGlobalConstants.App_Name_App_Landing_Page); - }); - }); -})(); - -/// Office.js Initialization -(function () { - "use strict"; - // The Office initialize function must be run each time a new page is loaded - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Outlook) { - Office.initialize = function (reason) { - }; - } -})(); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ListView.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ListView.js deleted file mode 100644 index b981cf47..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ListView.js +++ /dev/null @@ -1,818 +0,0 @@ -/// JS1003,JS2005,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS2085,JS3054,JS3057,JS3085,JS3092,JS3116,JS3056,JS3058 - -var oGridConfig = { - nColumnCounter: 1, - nGridWidth: 0, - nCurrentGridWidth: 0, - nPreviousGridWidth: 0, - nCurrentGridHeight: 0, - nPreviousGridHeight: 0, - nWidthDiff: 50, - sortable: "", -}; - -var oListViewObject = { - pageNumber: 1, - searchResultCount: 0, - itemsPerPage: oGlobalConstants.ListViewItemsPerPage, - waitTillDataLoaded: false, - oCurrentMandatory: "", - filterData: [], - nHeaderLeftOffset: 0, - bDefaultSelectionChanged: false, - arrUserSelectedColumns: [], - isPageLoad: 0 -}; - -/* Global functions */ - -/* Function to detect if vertical scroll bar is present for a particular element */ -(function ($) { - $.fn.hasScrollBar = function () { - return this.get(0).scrollHeight > this.height(); - }; -})( -/// JS3058 -jQuery); - -var toggleView = function (isMatterView) { - "use strict"; - oCommonObject.isMatterView = isMatterView; -}; - -$(document).on("click", function () { - "use strict"; - $(".ms-ContextualMenu").removeClass("is-open"); -}); - -//// #region Formatter functions for list view control - -/* Function to generate check-box column for list view control*/ -function loadCheckboxColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var iCurrentIndex = parseInt(parseInt(oListViewObject.itemsPerPage, 10) * parseInt(oListViewObject.pageNumber, 10), 10) + parseInt(nIndex, 10); - var sCheckBoxChunk = "
    "; - return sCheckBoxChunk; -} - -/* Function to generate Ellipsis column for list view control*/ -function loadEllipsisColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sECBMenuTitle = oCommonObject.isMatterView ? oFindMatterConstants.ListViewECBMenuTitle : oFindDocumentConstants.ListViewECBMenuTitle; - return "
    "; -} - -/* Function to generate Title column for list view control*/ -function loadNameColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sTitleProperty = ""; - oGridConfig.nColumnCounter = 1; - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentListViewData()) { - sTitleProperty = oCommonObject.isMatterView ? oFindMatterConstants.ListViewPinnedTitleProperty : oFindDocumentConstants.ListViewPinnedTitleProperty; - } else { - sTitleProperty = oCommonObject.isMatterView ? oFindMatterConstants.ListViewTitleProperty : oFindDocumentConstants.ListViewTitleProperty; - } - var sTitleValue = ($.trim(rowObject[sTitleProperty])) ? $.trim(rowObject[sTitleProperty]) : "NA" - , sDocumentPath, sDocumentExtension, sDocumentSPWebUrl; - if (!oCommonObject.isMatterView) { - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentListViewData()) { - sDocumentPath = rowObject[oFindDocumentConstants.ListViewDocumentOWAUrl]; - } else { - sTitleValue = extractTitle(sTitleValue); //// Remove the extension from the document name only if current section is NOT pinned section - // Document path URL will be available as a property of rowObject in case of pinned documents. - sDocumentPath = trimEndChar(rowObject[oFindDocumentConstants.ListViewDocumentPath], "/"), sDocumentExtension = rowObject[oFindDocumentConstants.ListViewDocumentExtension], sDocumentSPWebUrl = rowObject[oFindDocumentConstants.ListViewDocumentSPWebUrl]; - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentPath = commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentPath); - } - } - } - //// Code chunk to put all returned properties as data- attributes - var sHTMLChunk = "
    " + sTitleValue + "
    " : sHTMLChunk += "\">" + sTitleValue + "
    "; - return sHTMLChunk; -} - -/* Function to generate non-specific columns for list view control*/ -function genericColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue) ? trimEndChar($.trim(cellValue), ";") : "NA"; - var sGenericColumnChunk = "" + sCurrentValue + ""; - return sGenericColumnChunk; -} - -/* Function to generate Date column for list view control*/ -function loadDateColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue) ? cellValue : "NA" - , orignalDateValue = sCurrentValue; - var sDate = "NA" !== sCurrentValue ? oListView.formatDate(sCurrentValue) : "NA"; - var sGenericColumnChunk = "" + sDate + ""; - return sGenericColumnChunk; -} - -/* Function to generate ClientMatterID column for list view control, content will be rendered as ClientID.MatterID*/ -function loadClientMatterID_Column(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sMatterIDProperty = "", sClientMatterID = ""; - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentListViewData()) { - sMatterIDProperty = (oCommonObject.isMatterView) ? oFindMatterConstants.ListViewPinnedClientMatterIDPropertyName : oFindDocumentConstants.ListViewPinnedClientMatterIDPropertyName; - sClientMatterID = $.trim(rowObject[sMatterIDProperty]) ? $.trim(rowObject[sMatterIDProperty]) : "NA"; - } else { - sMatterIDProperty = (oCommonObject.isMatterView) ? oFindMatterConstants.ListViewMatterIDPropertyName : oFindDocumentConstants.ListViewMatterIDPropertyName; - var sClientIDValue = $.trim(cellValue) ? cellValue : "NA" - , sMatterIDValue = $.trim(rowObject[sMatterIDProperty]) ? $.trim(rowObject[sMatterIDProperty]) : "NA"; - sClientMatterID = sClientIDValue + "." + sMatterIDValue; - } - - var sClientMatterIDChunk = "" + sClientMatterID + ""; - return sClientMatterIDChunk; -} - -/* Function to modify checked out to column in case of Search Document list view */ -function loadCheckedOutToUser(cellValue, rowObject, width, nIndex, event) { - "use strict"; - oGridConfig.nColumnCounter++; - var sCurrentValue = $.trim(cellValue); - sCurrentValue = sCurrentValue ? sCurrentValue : "NA"; - var sGenericColumnChunk = "" + sCurrentValue + ""; - return sGenericColumnChunk; -} - -/* Function to generate Document Type Icon column in case of Search Document list view */ -function loadDocumentTypeIcon(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sExtension = "", iconSrc = ""; - if (4 === oCommonObject.iCurrentListViewData()) { - sExtension = (rowObject && rowObject.DocumentExtension) ? rowObject.DocumentExtension : ""; - } else { - sExtension = (rowObject && rowObject.FileExtension) ? rowObject.FileExtension : ""; - } - iconSrc = oCommonObject.getIconSource(sExtension); - return ""; -} - -/* Function to open matter landing page */ -function viewMatter(oElement) { - "use strict"; - var sMatterURL = $(oElement).attr("data-matterlink"); - oCommonObject.openWindow(sMatterURL, "_blank"); -} - -//// #endregion - -var oListView = (function () { - "use strict"; - var oListViewCommonObject = { - oListHeader: [], - oListView: [] - }, - oCommonFunctions = {}; - - //// #region List View Control - - /* Position the filtering fly out */ - oCommonFunctions.positionFilteringFlyout = function (oThisObject, sSelector) { - var iCaretIconOffset = oThisObject.position().left; - var iFlyoutLeftPosition = iCaretIconOffset; - if (iFlyoutLeftPosition > 250) { //// We checked whether select column is first column or not by getting position of caret icon - $(sSelector).css({ "left": iFlyoutLeftPosition - $(sSelector).width() + 10 }); //// for aligning filter flyout we add 10px to left because we have caret icon with 10px width - } else { - $(sSelector).css({ "left": "0px" }); - } - //// Set position of text flyout dynamically - $(sSelector).css({ "top": $("#listViewContainer").scrollTop() + 40 }); //// Add 40px in top of text flyout because we have 40px header width. - $(sSelector).removeClass("hide"); - }; - - /* Function to bind events on list view control */ - oCommonFunctions.addListViewControlBindings = function () { - var oListViewContainer = $("#listViewContainer"); - if (oListViewContainer && oListViewContainer.length) { - oListViewContainer.on("scroll", function () { - oListView.bindScrollEvent(); - }); - var oLoadingImageContainer = $("#loadingImageContainer"); - if (oLoadingImageContainer && oLoadingImageContainer.length) { - oListViewContainer.find(".lazyLoading").remove(); - var sLoadingImageChunk = oLoadingImageContainer.html(); - $("#listViewContainer_Grid").append(sLoadingImageChunk); - oLoadingImageContainer.addClass("hide"); - } - } - $("#listViewContainer_Grid").find(".lazyLoading").addClass("hide"); - - /* Bind the event for getting values for given column */ - $(".jsonGridHeader .ms-Icon--caretDown").off().on("click", function (event) { - oCommonObject.arrUniqueRefinerData().length = 0; //// Refresh the array of values for filter fly out - oCommonObject.closeAllPopupExcept("", event); - $(".filterFlyoutSection .ms-Label").css("display", "inline"); //// remove fabric's inline style - $(".filterFlyoutSearchText").val(""); //// Clear the text from the search box - oCommonObject.iFilterFlyoutPageNumber(); //// Reset the page number for filter fly out data to 1 - oCommonObject.moveFilterFlyout(); - $("#filterResultsContainer").empty(); //// Clear the older filter data - var oThisObject = $(this), oCurrentHeader = oThisObject.parent(); - if (oCurrentHeader.length) { - var sRefinerName = oCurrentHeader.attr("id") - , sFilterFlyoutType = oCurrentHeader.attr("filterFlyOutType"); - if ($.trim(sRefinerName) && "NA" !== sFilterFlyoutType) { - //// Set the clear filter text and title attribute for the filter - var oHeaderTitle = oCurrentHeader.find(".headerTitle") - , oClearText = $(".clearText") - , oClearFilterTitle = $(".clearFilterTitle"); - //// Set the title for clear text filters - if (oHeaderTitle.length && oClearText.length && oClearFilterTitle.length) { - oClearFilterTitle.text(oHeaderTitle.text()); - oClearText.attr("title", $(oClearText[0]).text()); - } - //// Processing for date filters - if ("date" === sFilterFlyoutType) { - $("#dateFlyoutContent").attr({ "data-refinername": sRefinerName, "data-filterflyouttype": sFilterFlyoutType }); - oCommonObject.setDateFilters(sRefinerName, sFilterFlyoutType); - oCommonFunctions.positionFilteringFlyout(oThisObject, "#dateFlyoutContent"); - } else { //// Processing for single and multi text filters - $("#textFlyoutContent").attr({ "data-refinername": sRefinerName, "data-filterflyouttype": sFilterFlyoutType }); - oCommonFunctions.positionFilteringFlyout(oThisObject, "#textFlyoutContent"); - //// If current section is pinned section - if (4 === oCommonObject.iCurrentListViewData()) { - //// add code for pinned sections - oListViewObject.filterData = []; - var filter = oCommonObject.isMatterView ? oCommonObject.oPinnedFlyoutFilters.oSearchMatterFilters : oCommonObject.oPinnedFlyoutFilters.oSearchDocumentFilters; - if (Object.keys(filter).length) { - oCommonObject.filterData(filter, true, sRefinerName); - } else { - var oData = oCommonObject.pinnedFilterData.length ? oCommonObject.pinnedFilterData : oCommonObject.pinnedData; - $.each(oData, function (iCount, sCurrentValue) { - var arrSplitValues = []; - if ($.trim(sCurrentValue[sRefinerName])) { - arrSplitValues = sCurrentValue[sRefinerName] && sCurrentValue[sRefinerName].split(";"); - } - $.each(arrSplitValues, function (iCurrentCount, sValue) { - var sTrimmedValue = $.trim(sValue); - ($.inArray(sTrimmedValue, oListViewObject.filterData) === -1) && oListViewObject.filterData.push(sTrimmedValue); - }); - }); - } - //// Server side sorting on the filter fly out data - oListViewObject.filterData.sort(function (previousValue, nextValue) { - if (isNaN(previousValue) || isNaN(nextValue)) { - return previousValue > nextValue ? 1 : -1; - } - return previousValue - nextValue; - }); - } else { //// Processing for My and All sections - var sFilterSearchTerm = oCommonObject.formatFilterSearchTerm(sRefinerName); - } - oCommonObject.isSearchText = 1; - oCommonObject.highlightSelectedFilters(sRefinerName, sFilterFlyoutType); - } - } - } - event && event.stopPropagation(); - }); - $(".jsonGridHeader").hover(function () { - if ("NA" !== $(this).attr("filterFlyOutType")) { - $(this).find(".ms-Icon--caretDown").css("opacity", "1"); - } - }, function () { - $(this).find(".ms-Icon--caretDown").css("opacity", "0"); - }); - }; - - /* Function to generate the list view JSON */ - oCommonFunctions.generateListViewJSON = function () { - var listViewJSON = [], arrColumnNames = [], arrColumnWidth = [], arrColumnFormatter = []; - if (oCommonObject.isMatterView) { - /* Get the data that is to be shown in Search Matter list view control */ - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentListViewData()) { - arrColumnNames = $.trim(oFindMatterConstants.ListViewPinnedColumnValueFields) ? $.trim(oFindMatterConstants.ListViewPinnedColumnValueFields).split(";") : ""; - oGridConfig.sortable = true; - } else { - arrColumnNames = $.trim(oFindMatterConstants.ListViewColumnValueFields) ? $.trim(oFindMatterConstants.ListViewColumnValueFields).split(";") : ""; - oGridConfig.sortable = false; - } - arrColumnWidth = $.trim(oFindMatterConstants.ListViewColumnWidth) ? $.trim(oFindMatterConstants.ListViewColumnWidth).split(";") : ""; - arrColumnFormatter = $.trim(oFindMatterConstants.ListViewColumnFomatter) ? $.trim(oFindMatterConstants.ListViewColumnFomatter).split(";") : ""; - } else { - /* Get the data that is to be shown in Search Document list view control */ - //// If pinned data is requested (flag = 4) get the different set of field names - if (4 === oCommonObject.iCurrentListViewData()) { - arrColumnNames = $.trim(oFindDocumentConstants.ListViewPinnedColumnValueFields) ? $.trim(oFindDocumentConstants.ListViewPinnedColumnValueFields).split(";") : ""; - oGridConfig.sortable = true; - } else { - arrColumnNames = $.trim(oFindDocumentConstants.ListViewColumnValueFields) ? $.trim(oFindDocumentConstants.ListViewColumnValueFields).split(";") : ""; - oGridConfig.sortable = false; - } - arrColumnWidth = $.trim(oFindDocumentConstants.ListViewColumnWidth) ? $.trim(oFindDocumentConstants.ListViewColumnWidth).split(";") : ""; - arrColumnFormatter = $.trim(oFindDocumentConstants.ListViewColumnFomatter) ? $.trim(oFindDocumentConstants.ListViewColumnFomatter).split(";") : ""; - } - if (arrColumnNames && arrColumnNames.length && arrColumnWidth && arrColumnWidth.length && arrColumnFormatter && arrColumnFormatter.length) { - /* Generate the column structure that is to be shown in the list view control */ - $.each(arrColumnNames, function (iCurrentIndex, sCurrentValue) { - var oCurrentItem = {}; - if ("ECB" === sCurrentValue) { - oCurrentItem = { name: sCurrentValue, width: arrColumnWidth[iCurrentIndex], id: sCurrentValue, align: "center", trimOnOverflow: false, formatter: arrColumnFormatter[iCurrentIndex], sortable: oGridConfig.sortable, sortType: String }; - } else { - oCurrentItem = { name: sCurrentValue, width: arrColumnWidth[iCurrentIndex], id: sCurrentValue, align: "left", trimOnOverflow: false, formatter: arrColumnFormatter[iCurrentIndex], sortable: oGridConfig.sortable, sortType: String }; - } - listViewJSON.push(oCurrentItem); - }); - return listViewJSON; - } - return []; - }; - - /* Function to load list view control */ - oCommonFunctions.createListView = function (oDataToLoad, bIsPageLoadData) { - //// Get the list view JSON based on the current page - var listViewJSON = oCommonFunctions.generateListViewJSON(); - if (listViewJSON && listViewJSON.length) { - var arrHeaderData, arrHeaderDataTitle; - if (oCommonObject.isMatterView) { - arrHeaderData = oFindMatterConstants.ListViewHeaderName.split(";"); - arrHeaderDataTitle = oFindMatterConstants.ListViewHeaderNameTitle.split("$|$"); - } else { - arrHeaderData = oFindDocumentConstants.ListViewHeaderName.split(";"); - arrHeaderDataTitle = oFindDocumentConstants.ListViewHeaderNameTitle.split("$|$"); - } - var oHeaderNames = [], oHeaderFilterType = []; - $.each(arrHeaderData, function (iItem, sCurrentValue) { - var oCurrentHeader = sCurrentValue && sCurrentValue.split(","); - oHeaderNames.push(oCurrentHeader[0]); - oCommonObject.oHeaderFilterType.push(oCurrentHeader[1]); - }); - var sortBy = (oCommonObject.isMatterView) ? oFindMatterConstants.ListViewTitleProperty : oFindDocumentConstants.ListViewTitleProperty; - //// Generate the common JSON structure for generating the list view control - var GridConfig = { - container: "listViewContainer", - data: oDataToLoad, - gridName: "List View", - gridHeader: oHeaderNames, - gridHeaderTitle: arrHeaderDataTitle, - columnNames: listViewJSON, - sortby: "", - sortorder: "asc", - sortType: String, - initialsortorder: "", - retainpageonsort: false, - maxRows: oListViewObject.itemsPerPage, - viewrecords: true, - pagination: false, - cellSpacing: 0 - }; - if (bIsPageLoadData) { - //// Generate the list view grid for page load data - oCommonObject.isAllRowSelected = false; - new LCADMS.JsonGrid(GridConfig); - $(".jsonGridHeader").addClass("ms-font-m-plus"); - oListViewObject.nHeaderLeftOffset = $("#listViewContainer_Grid thead").length ? $("#listViewContainer_Grid thead")[0].offsetLeft : ""; - } else { - //// Generate the list view table without header for lazy load data - var oAdditionalProperties = { - currentPage: 0, - tblBody: $("#listViewContainer tbody")[0], - drilldown: false - }; - - //// Update the JSON object to extend additional properties for generating list view - GridConfig = $.extend(GridConfig, oAdditionalProperties); - new LCADMS.CreateHTMLTableRow(GridConfig); - $("#listViewContainer_Grid").find(".lazyLoading").addClass("hide"); - - //// Update the data present in the list view object to have data loaded by lazy load - $.merge(LCADMS.gridObject[0].data, oDataToLoad); - LCADMS.gridObject[0].maxRows = LCADMS.gridObject[0].data.length; - oListViewObject.waitTillDataLoaded = false; - } - $(window).trigger("resize"); - oCommonObject.configureOnLoadView(); - oCommonFunctions.addListViewControlBindings(); - } - }; - - /* Function to load list view control */ - oCommonFunctions.loadListView = function (sDataToLoad, bIsPageLoadData) { - var oDataToLoad = "", oListViewContainer = $("#listViewContainer_Grid"); - if ("null" !== sDataToLoad) { - oDataToLoad = JSON.parse(sDataToLoad); - } else { - oDataToLoad = JSON.parse(oListViewCommonObject.sData); - } - if (4 === oCommonObject.iCurrentListViewData()) { - $.each(oDataToLoad, function (key, value) { - var sMatterId = oCommonObject.isMatterView ? oFindMatterConstants.ListViewPinnedMatterIDPropertyName : oFindDocumentConstants.ListViewPinnedMatterIDPropertyName - , sClientId = oCommonObject.isMatterView ? oFindMatterConstants.ListViewPinnedMatterClientIDPropertyName : oFindDocumentConstants.ListViewPinnedDocumentClientIDPropertyName; - value.CalClientMatterId = value[sClientId] + "." + value[sMatterId]; - }); - oCommonObject.pinnedData = oDataToLoad; - - } - if (!(oListViewContainer.length && 4 === oCommonObject.iCurrentListViewData())) { - oCommonFunctions.createListView(oDataToLoad, bIsPageLoadData); - } - oCommonFunctions.bindECB(); - oCommonObject.enableSearch(); - }; - - /* Function to bind ECB control */ - oCommonFunctions.bindECB = function () { - /* First unbind the click event and re-bind the ECB control to all the rows present in the list view control */ - $(".ellipsis").off().on("click", function (event) { - var oCurrentRow = $(this).parents(".GridRow"), sECBHTMLChunk = {}, oCheckBoxList = {}; //// Get the parent row with class GridRow - $(".ECBControlClass").remove(); - sECBHTMLChunk = $("#ECBControl").length && $("#ECBControl").clone() && $("#ECBControl").clone()[0]; - $(sECBHTMLChunk).removeClass("hide").addClass("ECBControlClass"); - $("#listViewContainer").append(sECBHTMLChunk); - /* Function to bind ECB controls */ - oCommonObject.addECBBindings(); - var $AllListViewItems = $(".isSelectRowsActive"); - if ($AllListViewItems && $AllListViewItems.length && $AllListViewItems[0].checked) { - $AllListViewItems.prop("checked", false); - oCommonObject.isAllRowSelected = false; - } - var oListViewRows = $(".GridRow, .GridRowAlternate"); - if (oListViewRows.length) { - oListViewRows.removeClass("is-selectedRow"); - $(".ellipsis").parent().removeClass("ellipsisBackground"); - $(".checkBoxImage").removeClass("checkboxHoverImageContainer checkboxImageContainer").addClass("hide"); - $(".checkBox").removeClass("hide"); - - oCheckBoxList = oListViewRows.find(".ms-ChoiceField-input"); - if (oCheckBoxList && oCheckBoxList.length) { - $.each(oCheckBoxList, function (iCurrentItem, sCurrentValue) { - sCurrentValue.checked = false; - }); - } - var oCurrentRow = $(this).parent().parent(); - if (oCurrentRow.length) { - oCurrentRow.addClass("is-selectedRow"); - $(this).parent().addClass("ellipsisBackground"); - var currentCheckbox = $(this).parent().parent().find(".ms-ChoiceField-input"); - if (currentCheckbox && currentCheckbox.length) { - currentCheckbox[0].checked = true; - oCurrentRow.find(".checkBoxImage").removeClass("hide checkboxHoverImageContainer").addClass("checkboxImageContainer"); - oCurrentRow.find(".checkBox").addClass("hide"); - $("#attachDocuments").removeClass("is-disabled"); - } - } - } - !(oCurrentRow && oCurrentRow.length) ? oCurrentRow = $(this).parents(".GridRowAlternate") : ""; //// if GridRow is not present check for GridRowAlternate - var oContextualMenu = $(".ms-ContextualMenu"); - oListViewObject.oCurrentMandatory = oCurrentRow.find(".mandatory"); //// Assign to global object so that it can used for reference from outer JS files as well - if (oCommonObject.isMatterView) { - updateECBforMatter(oContextualMenu, oListViewObject.oCurrentMandatory); - } else { - updateECBforDocument(oContextualMenu, oListViewObject.oCurrentMandatory); - } - oContextualMenu.find(".ms-ContextualMenu-link").removeClass("is-selected"); - //// Position the ECB fly out on the current ellipses icon and display the fly out - var nDynamicWidth = oCommonObject.getWidth() - , iEllipsesOffsetFromTop = $(this).position().top - , iECBMenuOffsetFromTop = iEllipsesOffsetFromTop - , iListViewOffsetFromTop = $("#listViewContainer").offset().top + $("#listViewContainer").height(); //// Adjust ECB menu relative to list view control (Kept commented for future purpose) - nDynamicWidth = (450 < nDynamicWidth) ? $(this).position().left - 5 : (parseInt($(this).position().left + 10, 10) - parseInt(oContextualMenu.width(), 10)) + 15; - $("#ECBControl").css({ - "left": nDynamicWidth, "top": iEllipsesOffsetFromTop + 23 - }); //// Add 10px to adjust the as per height of ellipses - oContextualMenu.addClass("is-open"); - oCommonObject.closeAllPopupExcept("ms-ContextualMenu", event); //// Close all pop-ups except ECB menu - (event) ? event.stopPropagation() : ""; - }); - }; - - /* Function to bind the scroll event on the element */ - oCommonFunctions.bindScrollEvent = function () { - if (4 !== oCommonObject.iCurrentListViewData()) { //// No lazy loading for pinned section (flag = 4) - if (!oListViewObject.waitTillDataLoaded && ($("#listViewContainer").scrollTop() + $("#listViewContainer").height() > ($("#listViewContainer_Grid").height() - (1 - (oGlobalConstants.ListViewLazyLoadingLimit / 100)) * $("#listViewContainer_Grid").height()))) { - var iMaxCurrentData = parseInt(oListViewObject.itemsPerPage) * (oListViewObject.pageNumber); - if (oListViewObject.searchResultCount > iMaxCurrentData) { - oListViewObject.waitTillDataLoaded = true; //// Throttle the next request till current service request is completed - $("#listViewContainer_Grid").find(".lazyLoading").removeClass("hide"); //// Display the loading image - $("#listViewContainer .jsonGridHeader").attr("disabled", "disabled").addClass("disableHeader");////disable the grid header for lazy loading - oListViewObject.pageNumber++; - if (oCommonObject.isMatterView) { - getSearchMatters("#listView", 1); - } else { - getSearchDocuments("#listView", 1); - } - } - } - } - $("#listViewContainer_Grid thead").css("left", oListViewObject.nHeaderLeftOffset - $("#listViewContainer").scrollLeft()); - $("#listViewContainer_Grid thead").width(($(document).width() - 37) + $("#listViewContainer").scrollLeft()); //// set header width according to document width(after Deducting 37px which is width of column picker notch) and scroll of list view container - if (320 > window.innerWidth) { - $("#listViewContainer_Grid thead").css("left", (-($("body").scrollLeft())) + oListViewObject.nHeaderLeftOffset); //// if there is horizontal scroll bar then set header left according to that scrollbar - } - }; - - $(document).on("scroll", function (event) { - $("#listViewContainer_Grid thead") && $("#listViewContainer_Grid thead").css("left", oListViewObject.nHeaderLeftOffset - $(document).scrollLeft()); - }); - - /* Function to trigger event after window resize */ - var waitForFinalEvent = (function () { - "use strict"; - var timers = { - }; - return function (callback, ms, uniqueId) { - if (timers[uniqueId]) { - clearTimeout(timers[uniqueId]); - } - timers[uniqueId] = setTimeout(callback, ms); - }; - })(); - //// #endregion - - $(window).on("resize", function (event) { - "use strict"; - oCommonObject.closeAllPopupExcept("", event); //// Close all pop-ups - oCommonFunctions.adjustListViewHeight(); - oCommonObject.adjustCaretIcon(); - //// Adjust the position of column picker as per presence of scroll - if ($("#listViewContainer").hasScrollBar()) { - $("#columnPickerStrip, #columnPickerControl, #columnPickerContainer").removeClass("noScrollPadding").addClass("scrollPadding"); - } else { - $("#columnPickerStrip, #columnPickerControl, #columnPickerContainer").removeClass("scrollPadding").addClass("noScrollPadding"); - } - $("#listViewContainer_Grid thead").css("width", ($(document).width() - 37) + $("#listViewContainer").scrollLeft()); //// set header width according to document width(after Deducting 37px which is width of column picker notch) and scroll of list view container - waitForFinalEvent(function () { - "use strict"; - //// function call of change list view container height dynamically - oCommonFunctions.applyMapContainerHeight(); - }, 500, "String"); - }); - - oCommonFunctions.adjustListViewHeight = function () { - var nCurrentWindowHeight = window.innerHeight; - var nCurrentWindowWidth = window.innerWidth; - //// check whether window height is less then 190px or not - //// if yes then set container height to 155 - //// else set container height according to windows height - if (parseInt(nCurrentWindowHeight) <= 155) { - $("#listViewContainer").height(55); - } else { - var oAttachButton = $("#attachDocuments"), iButtonHeight = 0; - if (oAttachButton && oAttachButton.length) { - iButtonHeight = (oAttachButton.attr("data-applicable")) ? 53 : 0; - } - //// If width is less than 320 px, then two scroll bars will appear and that's why we have this condition - if (320 > nCurrentWindowWidth) { - $("#listViewContainer").css("height", parseInt(nCurrentWindowHeight, 10) - (109 + iButtonHeight)); //// Deducting 109px from windows height in order to remove the height of App header section and height of app scrollbar - } else { - $("#listViewContainer").css("height", parseInt(nCurrentWindowHeight, 10) - (92 + iButtonHeight)); //// Deducting 92px from windows height in order to remove the height of App header section - } - $("#columnPickerStrip").css("height", parseInt(nCurrentWindowHeight, 10) - (111 + iButtonHeight)); //// Deducting 111px from windows height in order to remove the height of App header section and horizontal scrollbar for list view - } - }; - /* Function to set List View height dynamically according to window height*/ - oCommonFunctions.applyMapContainerHeight = function () { - oGridConfig.nPreviousGridHeight = oGridConfig.nCurrentGridHeight; - oGridConfig.nCurrentGridHeight = window.innerHeight; - //// check height of previous grid and current grid - //// oCommonObject.isServiceCallComplete used for check whether any service is currently running or not - //// 4 != oCommonObject.iCurrentListViewData() used for check that there should not pinned matter/document data in list view - if (oGridConfig.nPreviousGridHeight !== oGridConfig.nCurrentGridHeight && 4 !== oCommonObject.iCurrentListViewData()) { // && oCommonObject.isServiceCallComplete) { - if (oGridConfig.nCurrentGridHeight >= parseInt(oGlobalConstants.ListView_BreakPoint, 10)) { - if (oGridConfig.nPreviousGridHeight < parseInt(oGlobalConstants.ListView_BreakPoint, 10)) { - oCommonObject.abortRequest(); - ////if height of container is more then 710px then load records according to height of browser window - //// equation : items per page = items per page * ( height of browser window / 710 ) + 1 - //// In 710px height we can show 21 list item in page - oCommonObject.isAllRowSelected = false; - oListViewObject.itemsPerPage = oListViewObject.itemsPerPage * (Math.floor((parseInt(oGridConfig.nCurrentGridHeight, 10) / parseInt(oGlobalConstants.ListView_BreakPoint, 10))) + 1); - oCommonObject.clearListViewContent(); - // Update the list view for matters/documents - oCommonObject.updateListView(); - } - } else if (oGridConfig.nPreviousGridHeight >= oGlobalConstants.ListView_BreakPoint || 0 === oGridConfig.nPreviousGridHeight) { - ////oGridConfig.nPreviousGridHeight === 0 is checked for page load - //// set itemsperpage = 21 - oCommonObject.abortRequest(); - oCommonObject.isAllRowSelected = false; - oListViewObject.itemsPerPage = oGlobalConstants.ListViewItemsPerPage; - if (1 === oListViewObject.pageNumber || oGridConfig.nCurrentGridHeight <= parseInt(oGlobalConstants.ListView_BreakPoint, 10)) { - oCommonObject.clearListViewContent(); - } - if (4 === oCommonObject.iCurrentListViewData()) { - //// call pinned matters/documents - (oCommonObject.isMatterView) ? getPinnedMatters($("#listView")) : getPinnedDocument($("#listView")); - } else { - oCommonObject.updateListView(); - } - } - } - //// If window height goes below 460px, dynamically updating the height of column picker panel. If not, removing in-line height, which will in turn apply height from css - if (460 >= parseInt(oGridConfig.nCurrentGridHeight)) { - $("#columnPickerBlock").height(parseInt(oGridConfig.nCurrentGridHeight) - 160); //// Deducting 160px from windows height in order to remove the height of App header section and 40px margin of column picker panel - $("#columnPickerPanel").height(parseInt(oGridConfig.nCurrentGridHeight) - 120); //// Deducting 120px from windows height in order to remove the height of App header section - $("#ContextualHelp .ContextualHelpContainer").height(parseInt(oGridConfig.nCurrentGridHeight) - 20); //// Deducting 20px from windows height in order to avoid app scroll bar - } else { - $("#columnPickerPanel,#columnPickerBlock,#ContextualHelp .ContextualHelpContainer").css("height", ""); - } - }; - - /* Function to get the initial width of the list view control */ - oCommonFunctions.getListViewWidth = function () { - var arrGridWidthValues = oCommonObject.isMatterView ? oFindMatterConstants.ListViewColumnWidth.split(";") : oFindDocumentConstants.ListViewColumnWidth.split(";"); - oGridConfig.nCurrentGridWidth = oGridConfig.nPreviousGridWidth = arrGridWidthValues.reduce(function (previousValue, currentValue) { return parseInt(previousValue) + parseInt(currentValue); }) + oGridConfig.nWidthDiff; - }; - - /* Function to load the ECB control and register ECB actions */ - oCommonFunctions.loadECBControl = function () { - var arrCurrentView, arrECBTitle; - /* Get the list of actions to be displayed in the ECB menu based on current page */ - if (oCommonObject.isMatterView) { - arrCurrentView = $.trim(oFindMatterConstants.ListViewECBActions) ? $.trim(oFindMatterConstants.ListViewECBActions).split(";") : ""; - arrECBTitle = oFindMatterConstants.ListViewECBActionsTitle ? (oFindMatterConstants.ListViewECBActionsTitle).split("$|$") : ""; - } else { - arrCurrentView = $.trim(oFindDocumentConstants.ListViewECBActions) ? $.trim(oFindDocumentConstants.ListViewECBActions).split(";") : ""; - arrECBTitle = oFindDocumentConstants.ListViewECBActionsTitle ? (oFindDocumentConstants.ListViewECBActionsTitle).split("$|$") : ""; - } - - /* Generate the ECB control based on the current page */ - (arrCurrentView && arrECBTitle && arrCurrentView.length == arrECBTitle.length) ? oECBControl.generateECBControl(arrCurrentView, arrECBTitle) : ""; - - /* Function to bind ECB controls */ - oCommonObject.addECBBindings(); - }; - - /* Function to convert the date in specific format For now only MMM DD, YYYY format is supported*/ - oCommonFunctions.formatDate = function (dDate) { - "use strict"; - var oDates = new Date(dDate), months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], date = "", oLocalDate = dDate; - if (isNaN(oDates)) { - var arrSplitedDate = dDate.replace(/[-]/g, "/"); - arrSplitedDate = arrSplitedDate.split("/"); - dDate = arrSplitedDate[1] + "-" + arrSplitedDate[0] + "-" + arrSplitedDate[2]; - oDates = new Date(dDate); - } - if (0 > oLocalDate.indexOf("Z")) { - date += months[parseInt(oDates.getMonth(), 10)] + " "; - date += oDates.getDate() + ", "; - date += oDates.getFullYear(); - } else { - date += months[parseInt(oDates.getUTCMonth(), 10)] + " "; - date += oDates.getUTCDate() + ", "; - date += oDates.getUTCFullYear(); - } - return date; - }; - oCommonFunctions.highlightListViewRow = function ($RowElement, flag) { - var oGridRow = {}, oCheckBox = {}, oCheckImage = {}, oDocumentCheckbox = {}; - oGridRow = $RowElement; - oCheckBox = oGridRow.find(".checkBox"); - oCheckImage = oGridRow.find(".checkBoxImage"); - oDocumentCheckbox = oGridRow.find(".ms-ChoiceField-input"); - if (flag) { - oGridRow.addClass("is-selectedRow"); - oGridRow.find(".ellipsis").parent().addClass("ellipsisBackground"); - if (oDocumentCheckbox && oDocumentCheckbox.length) { - oDocumentCheckbox.prop("checked", true); - oCheckBox.addClass("hide"); - oCheckImage.removeClass("checkboxHoverImageContainer hide").addClass("checkboxImageContainer"); - } - } else { - oGridRow.removeClass("is-selectedRow"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisBackground"); - if (oDocumentCheckbox && oDocumentCheckbox.length) { - oDocumentCheckbox.prop("checked", false); - oGridRow.find(".checkboxHoverImageContainer").addClass("hide"); - oCheckBox.removeClass("hide"); - oCheckImage.removeClass("checkboxHoverImageContainer checkboxImageContainer").addClass("hide"); - } - } - var oSelectedRows = $(".is-selectedRow"); - (oSelectedRows && oSelectedRows.length) ? $("#attachDocuments").removeClass("is-disabled") : $("#attachDocuments").addClass("is-disabled"); - }; - - $(document).ready(function () { - /* Display the header */ - $(".AppHeader").removeClass("hide"); - $(document).on("click", ".jsonGridHeader:not('#DocType, #CheckBox ,#ECB')", function () { - var oThisObject = $(this), oGridRow = $(".GridRow, .GridRowAlternate"); - oCommonObject.isAllRowSelected = false; - if (4 === oCommonObject.iCurrentListViewData()) { - $(".sort").addClass("hide"); - if ("asc" === oThisObject.attr("sortorder")) { - oThisObject.find(".sort").html("↑").removeClass("hide"); - } else { - oThisObject.find(".sort").html("↓").removeClass("hide"); - } - $(".isSelectRowsActive").prop("checked", false); - oCommonFunctions.highlightListViewRow(oGridRow, false); - $("#attachDocuments").addClass("is-disabled"); - oListView.bindECB(); - } else { - var sRefinerName = $.trim(oThisObject.attr("id")) //// This is the name of the property on which the sort is to be applied - , oCurrentSortObject = oCommonObject.oSortDetails(); - if (oCurrentSortObject.ByProperty === sRefinerName) { //// If same column is clicked - oCurrentSortObject.Direction = (oCurrentSortObject.Direction) ? 0 : 1; - } else { - oCurrentSortObject.Direction = 0; //// Ascending sort by default on first click - } - oCurrentSortObject.ByProperty = sRefinerName ? sRefinerName : ""; - oCommonObject.clearListViewContent(); - if (oCommonObject.isMatterView) { - getSearchMatters("#listView", 1); - } else { - getSearchDocuments("#listView", 1); - } - } - }); - $(document).on("click", ".GridRow, .GridRowAlternate", function (event) { - var oDocumentCheckbox = {}, oCheckBox = {}, oCheckImage = {}, oGridRow = $(this); - if (event && event.target && (0 > event.target.className.indexOf("field"))) { - if (oCommonObject.isMatterView && !oGridRow.hasClass("is-selectedRow")) { - $(".GridRow, .GridRowAlternate").removeClass("is-selectedRow"); - $(".ellipsis").parent().removeClass("ellipsisBackground"); - } - if (oGridRow.hasClass("is-selectedRow")) { - oCommonFunctions.highlightListViewRow(oGridRow, false); - } else { - oCommonFunctions.highlightListViewRow(oGridRow, true); - } - } - oCommonObject.onListViewCheckboxClick(); - }); - - $(document).on("click", ".checkboxHoverImageContainer", function (event) { - var oGridRow = $(this).parent().parent(); - if (oGridRow && oGridRow.length) { - oGridRow.click(); - } - event ? event.stopPropagation() : ""; - }); - - $(document).on("mouseover", ".GridRow, .GridRowAlternate", function (event) { - var oGridRow = $(this); - oGridRow.find(".checkBox").addClass("hide"); - oGridRow.find(".checkBoxImage").removeClass("hide checkboxImageContainer").addClass("checkboxHoverImageContainer"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisBackground").addClass("ellipsisHoverBackground"); - - }).on("mouseout", ".GridRow, .GridRowAlternate", function (event) { - var oGridRow = $(this); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisHoverBackground"); - if (oGridRow.hasClass("is-selectedRow")) { - oGridRow.find(".checkBoxImage").removeClass("checkboxHoverImageContainer hide").addClass("checkboxImageContainer"); - oGridRow.find(".ellipsis").parent().removeClass("ellipsisHoverBackground").addClass("ellipsisBackground"); - } else { - oGridRow.find(".checkBoxImage").addClass("hide"); - oGridRow.find(".checkBox").removeClass("hide"); - } - }); - - $(document).on("click", ".searchPanelDropdownOption", function (event) { - $(".searchPanelDropdownOption").removeClass("selectedDropdownOption"); - $(this).addClass("selectedDropdownOption"); - }); - }); - - return ({ - loadListView: function (sDataToLoad, bIsPageLoadData) { - oCommonFunctions.loadListView(sDataToLoad, bIsPageLoadData); - }, - scrollListView: function ($Element) { - return oCommonFunctions.scrollListView($Element); - }, - highlightListViewRow: function ($RowElement, bFlag) { - oCommonFunctions.highlightListViewRow($RowElement, bFlag); - }, - loadECBControl: function () { - oCommonFunctions.loadECBControl(); - }, - getListViewWidth: function () { - oCommonFunctions.getListViewWidth(); - }, - formatDate: function (dDate) { - return oCommonFunctions.formatDate(dDate); - }, - bindScrollEvent: function () { - oCommonFunctions.bindScrollEvent(); - }, - adjustListViewHeight: function () { - oCommonFunctions.adjustListViewHeight(); - }, - applyMapContainerHeight: function () { - oCommonFunctions.applyMapContainerHeight(); - }, - generateListViewJSON: function () { - return oCommonFunctions.generateListViewJSON(); - }, - bindECB: function () { - return oCommonFunctions.bindECB(); - }, - addListViewControlBindings: function () { - return oCommonFunctions.addListViewControlBindings(); - } - }); -})(); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MailCart.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MailCart.js deleted file mode 100644 index d773af29..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MailCart.js +++ /dev/null @@ -1,650 +0,0 @@ -/// JS3057,JS3058,JS2074,JS2076,JS3092,JS3054,JS2005,JS3056,JS2073,JS2024,JS2026,JS2032,JS2064,JS3116 -var iDocumentCount = 0, - sOneDriveURL = "", - iOverWriteDivCount = 0, - iTotalDocumentCount = 0, - iParentNodeID = null, - errorDocumentNumber = -1, - sOneDriveErrorMessage = "", - arrCheckOutFailDocument = []; -function downloadEmail(bAttachmentCall) { - "use strict"; - // App Insight Event tracking for Email as attachment - bAttachmentCall ? (commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Email_Attachment, true)) : commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Email_Link, true); - var arrMatches = modifySelectedFileURLS(), matterDetails; - if (arrMatches.length > 0) { - // Prevent the click events if there is at least one document selected. - // Add a return false to each of the links when any link is clicked. - $(".sendEmailOptions").each(function () { - "use strict"; - var oCurrentLink = $(this); - if (oCurrentLink[0]) { - oCurrentLink.attr("onclick", "return false;" + oCurrentLink.attr("onclick")); - } - }); - var oEmailSelectedData = arrMatches, - sFileURLs = "", - nCount, oEmailRelativePath, - nEmailSelectedDataLength = oEmailSelectedData.length - 1, - beforeEmail; - - for (nCount = 0; nCount <= nEmailSelectedDataLength; nCount++) { - if (oEmailSelectedData[nCount].DocumentUrl) { - oEmailRelativePath = unescape(oEmailSelectedData[nCount].DocumentUrl); - } else { - oEmailRelativePath = unescape(oEmailSelectedData[nCount].Path); - } - oEmailRelativePath = trimEndChar(oEmailRelativePath, "/"); - oEmailRelativePath = oEmailRelativePath.replace(oGlobalConstants.Site_Url, "$") + "$"; - if (oEmailSelectedData[nCount].DocumentClientUrl) { - sFileURLs += oEmailSelectedData[nCount].DocumentTeamUrl + oEmailRelativePath + oEmailSelectedData[nCount].FileName + ";"; - } else { - sFileURLs += oEmailSelectedData[nCount].SiteName + oEmailRelativePath + oEmailSelectedData[nCount].FileName + ";"; - } - } - beforeEmail = { "oParam": { "FullUrl": sFileURLs } }; - matterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": sFileURLs, "IsAttachmentCall": bAttachmentCall } }; - $.ajax({ - type: "POST", - url: oGlobalConstants.Legal_Briefcase_Service_Url + "SaveEmail", - data: JSON.stringify(matterDetails), - contentType: "application/json; charset=utf-8", - headers: { "RequestValidationToken": oMasterGlobal.Tokens }, - begin: beforeLegalBriefcaseOperations(beforeEmail), - success: function (result) { - result = encodeURIComponent(result); - var url = "/pages/downloadEmail.aspx"; - var form = $("
    " + - "" + - "" + - "
    "); - $("body").append(form); - $(form).submit(); - var iDocuments = $(".attachmentList").length, iIterator = 0; - for (iIterator = 0; iIterator < iDocuments; iIterator++) { - $(".emailDocumentNames #" + iIterator + " img.mailCheck").css("display", "inline"); - $(".emailDocumentNames #" + iIterator + " .sendingDocumentImg").css("display", "none"); - } - // Remove the return false to enable the links again - $(".sendEmailOptions").each(function () { - "use strict"; - var oCurrentLink = $(this); - if (oCurrentLink[0]) { - oCurrentLink.attr("onclick", oCurrentLink.attr("onclick").replace(/return false;/g, "")); - } - }); - $(".mailForm").remove(); - } - }); - } -} - -/* Common function to retrieve selected documents in the Mail Cart popup */ -function modifySelectedFileURLS() { - "use strict"; - var query = $("img.mailCheck[data-checked='true']").map(function () { return $(this).attr("data-value"); }), - arrMatches = [], iIterate; - - arrMatches = $.grep(oGridConfig.arrSelectedGridData, function (selectedDocument) { - for (iIterate = 0; iIterate < query.length; iIterate++) { - if ((selectedDocument.DocumentUrl) && (decodeURI(trimEndChar(selectedDocument.DocumentUrl, "/").toUpperCase()) === decodeURI(query[iIterate].toUpperCase()))) { - selectedDocument.DocumentUrl = query[iIterate]; - arrMatches.push(selectedDocument); - return true; - } else if ((selectedDocument.Path) && (decodeURI(trimEndChar(selectedDocument.Path, "/").toUpperCase()) === decodeURI(query[iIterate].toUpperCase()))) { - selectedDocument.Path = query[iIterate]; - arrMatches.push(selectedDocument); - return true; - } - } - }); - return arrMatches; -} - - -/* Function to display Look up pop up */ -function showPopup() { - "use strict"; - var mailContainer = $(".popUpContainer"); - // Enable to onclick event. - $(".sendEmailOptions").each(function () { - "use strict"; - var oCurrentLink = $(this); - if (oCurrentLink[0]) { - oCurrentLink.attr("onclick", oCurrentLink.attr("onclick").replace(/return false;/g, "")); - } - }); - if ($(".checkOutPopup")) { - $(".checkOutPopup").hide(); - } - if ($(".notification")) { - $(".notification").remove(); - } - $(".popUpContainer .popUpBody ul").empty(); - var nCount = 0, oEmailRelativePath, fileURL = "", oParam, matterDetails; - - for (nCount = 0; nCount <= oGridConfig.arrSelectedGridData.length - 1; nCount++) { - if (oGridConfig.arrSelectedGridData[nCount].DocumentUrl) { - oEmailRelativePath = unescape(oGridConfig.arrSelectedGridData[nCount].DocumentUrl); - } else { - oEmailRelativePath = unescape(oGridConfig.arrSelectedGridData[nCount].Path); - } - oEmailRelativePath = trimEndChar(oEmailRelativePath, "/"); - oEmailRelativePath = oEmailRelativePath.replace(oGlobalConstants.Site_Url, "$") + ";"; - if (oGridConfig.arrSelectedGridData[nCount].DocumentClientUrl) { - fileURL += oGridConfig.arrSelectedGridData[nCount].DocumentClientUrl + oEmailRelativePath; - } else { - fileURL += oGridConfig.arrSelectedGridData[nCount].SiteName + oEmailRelativePath; - } - } - oParam = { "oSelectedGridData": oGridConfig.arrSelectedGridData, "nCount": nCount }; - matterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": fileURL } }; - - oCommonObject.callLegalBriefcase("CheckedOutDocumentByUser", matterDetails, onSearchCheckedOutDocumentsSuccess, onSearchCheckedOutDocumentsFailure, beforeSearchCheckedOutDocuments, oParam); - displayAttachmentCount(nCount); - $(".popupContainerBackground, .popUpContainer").removeClass("hide"); - oGridConfig.inWebDashboard && mailContainer.addClass("placePopup"); - if (("undefined" !== typeof oSearchGlobal.sClientName && "undefined" !== typeof oSearchGlobal.sClientSiteUrl && "undefined" !== typeof oSearchGlobal.bIsTenantCall) && (("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) || oSearchGlobal.bIsTenantCall)) { - $(".popUpContainer").addClass("popupSP"); - } -} -/* Hides the loading image shown on Mail cart popup*/ -function hideLoadingIcon() { - "use strict"; - $("#mailCartLoadingImage, #mailCartLoadingImage .LoadingImage").hide(); -} - -/* Function to show the loading image while the check out status of the documents is being retrieved */ -function beforeSearchCheckedOutDocuments() { - "use strict"; - $("#mailCartLoadingImage").show(); - $("#mailCartLoadingImage .LoadingImage").show(); -} - -/* Function to display the check out status of the documents */ -function onSearchCheckedOutDocumentsSuccess(result, event) { - "use strict"; - hideLoadingIcon(); - var sDocumentName = "", arrDocumentUrl = null, sDocumentUrl = null, iCount, oEmailRelativePath, iErrorCode, iTimeStamp, sHtmlChunk; - oGridConfig.arrCheckedOutDoc = []; - for (iCount = 0; iCount < result.oParam.nCount; iCount++) { - if (0 <= result.Result[iCount].indexOf("#|#")) { - var arrErrorPopUpData = JSON.parse(result.Result[iCount]).code.split("#|#"); - iErrorCode = arrErrorPopUpData[0]; - iTimeStamp = arrErrorPopUpData[1]; - if (oGridConfig.arrSelectedGridData[iCount].DocumentUrl) { - sDocumentName = oGridConfig.arrSelectedGridData[iCount].DocumentName + "." + oGridConfig.arrSelectedGridData[iCount].DocumentExtension; - } else { - sDocumentName = oGridConfig.arrSelectedGridData[iCount].FileName; - } - - sHtmlChunk = oGlobalConstants.Info_Popup_Error_Message + "
    Error Code:\\'" + iErrorCode + "\\'
    Timestamp:\\'" + iTimeStamp + "\\'"; - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.File_Not_Available + "
  • "); - } else { - if (result.oParam.oSelectedGridData[iCount].DocumentUrl) { - arrDocumentUrl = trimEndChar(result.oParam.oSelectedGridData[iCount].DocumentUrl, "/").split("/"); - sDocumentName = result.oParam.oSelectedGridData[iCount].DocumentName + "." + result.oParam.oSelectedGridData[iCount].DocumentExtension; - arrDocumentUrl[arrDocumentUrl.length - 1] = encodeURI(sDocumentName); - sDocumentUrl = arrDocumentUrl.join("/"); - if (result.Result[iCount] === "unavailable") { - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Checked_Out_File_Not_Found + "

    " + oGlobalConstants.Checked_Out_File_Not_Found_Moved_Deleted + "
  • "); - } else { - if (result.Result[iCount] === "") { - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Document_Checked_Out_Message + "
  • "); - } else { - //// Add document URL in array which are already checkout - oGridConfig.arrCheckedOutDoc.push(decodeURIComponent(sDocumentUrl)); - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Convenience_copy_available + "

    (Checked out by " + result.Result[iCount] + ")
  • "); - } - } - } else { - arrDocumentUrl = trimEndChar(result.oParam.oSelectedGridData[iCount].Path, "/").split("/"); - sDocumentName = result.oParam.oSelectedGridData[iCount].FileName; - arrDocumentUrl[arrDocumentUrl.length - 1] = encodeURI(sDocumentName); - sDocumentUrl = arrDocumentUrl.join("/"); - - if (result.Result[iCount] === "unavailable") { - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Checked_Out_File_Not_Found + "

    " + oGlobalConstants.Checked_Out_File_Not_Found_Moved_Deleted + "
  • "); - } else { - if (result.Result[iCount] === "") { - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Document_Checked_Out_Message + "
  • "); - } else { - //// Add document URL in array which are already checkout - oGridConfig.arrCheckedOutDoc.push(decodeURIComponent(sDocumentUrl)); - $(".popUpContainer .popUpBody ul").append("
  • \"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Convenience_copy_available + "

    (Checked out by " + result.Result[iCount] + ")
  • "); - } - } - } - } - } -} -function onSearchErrorCheckedOutDocumentsSuccess(result, event) { - "use strict"; - hideLoadingIcon(); - var sDocumentName = "", arrDocumentUrl = null, sDocumentUrl = null, iCount, oEmailRelativePath, iErrorCode, iTimeStamp, sHtmlChunk; - if (0 <= result.Result[0].indexOf("#|#")) { - var arrErrorPopUpData = JSON.parse(result.Result[iCount]).code.split("#|#"); - iErrorCode = arrErrorPopUpData[0]; - iTimeStamp = arrErrorPopUpData[1]; - $(".emailDocumentNames #" + errorDocumentNumber + " img.mailCheck").css("display", "inline"); - $(".emailDocumentNames #" + errorDocumentNumber + " .sendingDocumentImg").css("display", "none"); - - if (oGridConfig.arrSelectedGridData[errorDocumentNumber].DocumentUrl) { - sDocumentName = oGridConfig.arrSelectedGridData[errorDocumentNumber].DocumentName + "." + oGridConfig.arrSelectedGridData[errorDocumentNumber].DocumentExtension; - } else { - sDocumentName = oGridConfig.arrSelectedGridData[errorDocumentNumber].FileName; - } - - sHtmlChunk = oGlobalConstants.Info_Popup_Error_Message + "
    Error Code:\\'" + iErrorCode + "\\'
    Timestamp:\\'" + iTimeStamp + "\\'"; - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.File_Not_Available + "
    "; - - } else { - if (result.oParam.oSelectedGridData[0].DocumentUrl) { - arrDocumentUrl = trimEndChar(result.oParam.oSelectedGridData[0].DocumentUrl, "/").split("/"); - sDocumentName = result.oParam.oSelectedGridData[0].DocumentName + "." + result.oParam.oSelectedGridData[0].DocumentExtension; - arrDocumentUrl[arrDocumentUrl.length - 1] = encodeURI(sDocumentName); - sDocumentUrl = arrDocumentUrl.join("/"); - - if (result.Result[0] === "unavailable") { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Checked_Out_File_Not_Found + "

    " + oGlobalConstants.Checked_Out_File_Not_Found_Moved_Deleted + "
    "; - } else { - if (result.Result[0] === "") { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Document_Checked_Out_Message + "
    "; - } else { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Convenience_copy_available + "

    (Checked out by " + result.Result[0] + ")
    "; - } - } - } else { - arrDocumentUrl = trimEndChar(result.oParam.oSelectedGridData[0].Path, "/").split("/"); - sDocumentName = result.oParam.oSelectedGridData[0].FileName; - arrDocumentUrl[arrDocumentUrl.length - 1] = encodeURI(sDocumentName); - sDocumentUrl = arrDocumentUrl.join("/"); - - if (result.Result[0] === "unavailable") { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Checked_Out_File_Not_Found + "

    " + oGlobalConstants.Checked_Out_File_Not_Found_Moved_Deleted + "
    "; - } else { - if (result.Result[0] === "") { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Document_Checked_Out_Message + "
    "; - } else { - $("ul li").eq(errorDocumentNumber)[0].innerHTML = "\"checkbox\"" + sDocumentName + "
    " + oGlobalConstants.Convenience_copy_available + "

    (Checked out by " + result.Result[0] + ")
    "; - } - } - } - } - errorDocumentNumber = -1; -} -/* Function to display failure notification in case the check-out status of the documents cannot be retrieved */ -function onSearchCheckedOutDocumentsFailure(result, event) { - "use strict"; - $(".popUpHeader .notificationContainerForPopup").empty(); - var sFailContent = '
    ' + 'warning Failed to retrieve document check-out status. x
    '; - $(".popUpHeader .notificationContainerForPopup").append(sFailContent); - hideLoadingIcon(); -} - -/* Function to show the check out status information of each document */ -function checkOutInfo(element, event, attachmentNumber, message) { - "use strict"; - var sContent = ""; - $(".checkOutMetadata").text(""); - $(".checkOutMetadata").html(message); - $(".ErrorTryAgainLink").attr({ href: "javascript:void(0);", onclick: "tryAgainShowPopup(" + attachmentNumber + ")" }); - var documentList = $(element)[0].parentNode.parentNode; - var scrollTopValue = (documentList.scrollTop !== 0 ? documentList.scrollTop : documentList.parentNode.scrollTop); - $(".checkOutPopup").css({ top: $(element)[0].offsetTop - scrollTopValue - 34 }); - $(".checkOutPopup").show(); - iParentNodeID = $(element).parent()[0].id; - commonFunction.closeAllFilterExcept("checkOutPopup", event); - if (!event) { - event = window.event; - event.cancelBubble = true; - } - if (event.stopPropagation) { - event.stopPropagation(); - } -} - -function tryAgainShowPopup(attachmentNumber) { - "use strict"; - errorDocumentNumber = attachmentNumber; - $(".popUpCloseIcon").remove(); - $(".checkOutPopup").hide(); - $(".notification").remove(); - $(".emailDocumentNames #" + attachmentNumber + " img.mailCheck").css("display", "none"); - $(".emailDocumentNames #" + attachmentNumber + " .sendingDocumentImg").css("display", "inline"); - var oEmailRelativePath, fileURL = "", oParam, matterDetails, data = []; - data[0] = oGridConfig.arrSelectedGridData[attachmentNumber]; - if (data.DocumentUrl) { - oEmailRelativePath = unescape(data[0].DocumentUrl); - } else { - oEmailRelativePath = unescape(data[0].Path); - } - oEmailRelativePath = trimEndChar(oEmailRelativePath, "/"); - oEmailRelativePath = oEmailRelativePath.replace(oGlobalConstants.Site_Url, "$") + ";"; - if (data.DocumentClientUrl) { - fileURL += data.DocumentClientUrl + oEmailRelativePath; - } else { - fileURL += oGridConfig.arrSelectedGridData[attachmentNumber].SiteName + oEmailRelativePath; - } - oParam = { "oSelectedGridData": data, "nCount": 1 }; - matterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": fileURL } }; - - oCommonObject.callLegalBriefcase("CheckedOutDocumentByUser", matterDetails, onSearchErrorCheckedOutDocumentsSuccess, onSearchCheckedOutDocumentsFailure, null, oParam); - $(".popupContainerBackground, .popUpContainer").removeClass("hide"); - - if (("undefined" !== typeof oSearchGlobal.sClientName && "undefined" !== typeof oSearchGlobal.sClientSiteUrl && "undefined" !== typeof oSearchGlobal.bIsTenantCall) && (("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) || oSearchGlobal.bIsTenantCall)) { - $(".popUpContainer").addClass("popupSP"); - } -} - -/* Function to send the documents to user's One Drive */ -function sendToBriefcase() { - "use strict"; - var oParam, matterDetails, arrMatches; - - iOverWriteDivCount = 0; - iDocumentCount = 0; - - arrMatches = modifySelectedFileURLS(); - - if (arrMatches.length > 0) { - // Prevent the click events if there is at least one document selected. - // Add a return false to each of the links when any link is clicked. - $(".sendEmailOptions").each(function () { - "use strict"; - var oCurrentLink = $(this); - if (oCurrentLink[0]) { - oCurrentLink.attr("onclick", "return false;" + oCurrentLink.attr("onclick")); - } - }); - var sFileURLs = "", iCount, oEmailRelativePath; - iTotalDocumentCount = arrMatches.length; - - for (iCount = 0; iCount < arrMatches.length; iCount++) { - if (arrMatches[iCount].DocumentUrl) { - oEmailRelativePath = decodeURIComponent(unescape(arrMatches[iCount].DocumentUrl)); - } else { - oEmailRelativePath = decodeURIComponent(unescape(arrMatches[iCount].Path)); - } - oEmailRelativePath = trimEndChar(oEmailRelativePath, "/"); - oEmailRelativePath = oEmailRelativePath.replace(decodeURIComponent(oGlobalConstants.Site_Url), "$") + ";"; - sFileURLs += arrMatches[iCount].DocumentClientUrl ? decodeURIComponent(arrMatches[iCount].DocumentClientUrl) + oEmailRelativePath : arrMatches[iCount].SiteName + oEmailRelativePath; - } - - matterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": sFileURLs, "IsOverwrite": 0 }, "doCheckOut": true }; - oParam = { "iCount": 2, "FullUrl": sFileURLs }; - oCommonObject.callLegalBriefcase("SendToBriefcase", matterDetails, onSearchDocumentsSuccess, onSearchDocumentsFailure, beforeLegalBriefcaseOperations, oParam); - } -} - -/* Function to retrieve the URL of the documents if already existing in the user's One Drive and/or display the success notification in case of successfully sending out all the new documents to user's One Drive */ -function onSearchDocumentsSuccess(result) { - "use strict"; - if ($(".notification")) { - $(".notification").remove(); - } - var iDocuments = $(".attachmentList").length, iIterator = 0, - oParsedResultDoc = $.parseJSON(result.Result), sResultDoc = oParsedResultDoc.value; - if (!oParsedResultDoc.code || "0" === oParsedResultDoc.code) { - var arrResultDoc = sResultDoc.lastIndexOf(";") === sResultDoc.length - 1 ? sResultDoc.substr(0, (sResultDoc.length - 1)).split(";") : sResultDoc.split(";"), - iCount = result.oParam.iCount, oParam, matterDetails; - for (iIterator = 0; iIterator < iDocuments; iIterator++) { - $(".emailDocumentNames #" + iIterator + " img.mailCheck").css("display", "inline"); - $(".emailDocumentNames #" + iIterator + " .sendingDocumentImg").css("display", "none"); - } - if ("false" !== arrResultDoc[0]) { - iDocumentCount += parseInt(arrResultDoc[1], 10); - sOneDriveURL = arrResultDoc[0]; - - if (iCount === arrResultDoc.length - 1) { - showNotification(iDocumentCount, sOneDriveURL, "successNotification", iTotalDocumentCount, 0); - } - while (iCount < arrResultDoc.length - 1) { - iCount++; - onSearchExistingDocumentsSuccess({ "iCount": iCount, "FullUrl": arrResultDoc[iCount] }); - - } - } else { // In case collection is not initialized display error notification. - showNotification(iDocuments, arrResultDoc[1], "failNotification", iDocuments, 1); - } - } else { - sOneDriveErrorMessage = sResultDoc; //// to be used in case of error in configuration of OneDrive - showNotification(iDocuments, oParsedResultDoc.code, "failNotification", iDocuments, 2); - } -} - -/* Function to display the failure notification in case of failure in sending the documents to the user's One Drive */ -function onSearchDocumentsFailure(result) { - "use strict"; - showNotification(iDocumentCount, sOneDriveURL, "failNotification", iTotalDocumentCount, 0); -} - -/* Function to display notification to user for every document that is already existing in the user's One Drive */ -function onSearchExistingDocumentsSuccess(result) { - "use strict"; - - var iDocuments = $(".attachmentList").length, iIterator = 0, sContent; - for (iIterator = 0; iIterator < iDocuments; iIterator++) { - $(".emailDocumentNames #" + iIterator + " img.mailCheck").css("display", "inline"); - $(".emailDocumentNames #" + iIterator + " .sendingDocumentImg").css("display", "none"); - } - - iOverWriteDivCount++; - if ("" !== result.FullUrl) { - if (iOverWriteDivCount > 1) { - sContent = '
    ' + result.FullUrl.split("$")[1].substring(result.FullUrl.split("$")[1].lastIndexOf("/") + 1) + " already exists in your OneDrive. Do you want to overwrite it?" + '
    '; - } else { - sContent = '
    ' + result.FullUrl.split("$")[1].substring(result.FullUrl.split("$")[1].lastIndexOf("/") + 1) + " already exists in your OneDrive. Do you want to overwrite it?" + '
    '; - } - $(".popUpHeader .notificationContainerForPopup").append(sContent); - } -} - -/* Function to retrieve the user's choice to overwrite a document or not and depending on that either overwrite that document or not */ -function overWriteDocument(oDocument) { - "use strict"; - var sNotificationPopup = oDocument.parentNode.parentNode.parentNode.id; - $(".notificationContainerForPopup #" + sNotificationPopup + " .askForOverwrite #overWriteYes")[0].disabled = true; - $(".notificationContainerForPopup #" + sNotificationPopup + " .askForOverwrite #overWriteNo")[0].disabled = true; - var sDocumentURL = "", oMatterDetails = {}, oParam = { "divId": sNotificationPopup, "FullUrl": "" }; - if ("Yes" === oDocument.value) { - sDocumentURL = oDocument.getAttribute("data-url"); - oParam.FullUrl = sDocumentURL; - oMatterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": sDocumentURL, "IsOverwrite": 1 }, "doCheckOut": true }; - - oCommonObject.callLegalBriefcase("SendToBriefcase", oMatterDetails, onOverWriteDocumentSuccess, onOverWriteDocumentFailure, beforeLegalBriefcaseOperations, oParam); - } else { - sDocumentURL = $(oDocument).parent().find("#overWriteYes").attr("data-url"); - var sDocumentFullUrl = oGlobalConstants.Site_Url + sDocumentURL.split("$")[1], sDocumentName = ""; - oParam.FullUrl = sDocumentURL; - if (-1 === $.inArray(sDocumentFullUrl, oGridConfig.arrCheckedOutDoc)) { - oMatterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": sDocumentURL, "IsOverwrite": 1 }, "doCheckOut": true }; - sDocumentName = sDocumentFullUrl.split("/"); - arrCheckOutFailDocument.push(sDocumentName[sDocumentName.length - 1]); - oCommonObject.callLegalBriefcase("DiscardCheckOutChanges", oMatterDetails, onOverWriteDocumentCancelSuccess, onOverWriteDocumentCancelFail, null, null); - } - var notificationContainer = $(".notificationContainerForPopup #" + sNotificationPopup); - if (notificationContainer.length !== 0) { - notificationContainer.remove(); - } - if ($(".warningNotification").length === 0) { - showNotification(iDocumentCount, sOneDriveURL, "successNotification", iTotalDocumentCount, 0); - } else { - var iTempCount = parseInt(sNotificationPopup, 10) + 1; - $(".notificationContainerForPopup #" + iTempCount).show(); - } - } - -} - -function onOverWriteDocumentCancelSuccess() { - "use strict"; - arrCheckOutFailDocument.pop(); -} - -// Display error message while checkout fails -function onOverWriteDocumentCancelFail() { - "use strict"; - var sDocument = arrCheckOutFailDocument.pop(); - showNotification(iDocumentCount, sDocument, "failNotification", 0, 3); // Use 0 for number of document to display and use 3 for display check out fail notification -} - -/* On successfully overwriting a document, this function will display the next document overwrite notification or the success notification depending on the number of documents left to be asked to the user to be overwritten or not */ -function onOverWriteDocumentSuccess(result) { - "use strict"; - if (result) { - var oParsedResult = JSON.parse(result.Result); - if (!oParsedResult.code || "0" === oParsedResult.code) { - var iDocuments = $(".attachmentList").length, iIterator = 0, notificationContainer; - for (iIterator = 0; iIterator < iDocuments; iIterator++) { - $(".emailDocumentNames #" + iIterator + " img.mailCheck").css("display", "inline"); - $(".emailDocumentNames #" + iIterator + " .sendingDocumentImg").css("display", "none"); - } - - iDocumentCount += 1; - notificationContainer = $(".notificationContainerForPopup #" + result.oParam.divId); - - if (notificationContainer.length !== 0) { - notificationContainer.remove(); - } - if ($(".warningNotification").length === 0) { - sOneDriveURL = $.parseJSON(result.Result).value.split(";")[0]; - showNotification(iDocumentCount, sOneDriveURL, "successNotification", iTotalDocumentCount, 0); - } else { - var iTempCount = parseInt(result.oParam.divId, 10) + 1; - $(".notificationContainerForPopup #" + iTempCount).show(); - } - } else { - $(".notification").remove(); - showNotification(iDocuments, oParsedResult.code, "failNotification", iDocuments, 2); - } - } -} - -/* Click event for close notification popup*/ -$(document).on("click", ".closeFailNotification", function () { - "use strict"; - $(this).parent().remove(); -}); - -/* Function to display failure notification if the document was not successfully overwritten */ -function onOverWriteDocumentFailure(result) { - "use strict"; - if ($(".warningNotification").length > 0) { - $(".warningNotification").remove(); - } - showNotification(iDocumentCount, sOneDriveURL, "failNotification", iTotalDocumentCount, 0); - return "false"; -} - -/* Function to display loading images next to the documents in the Mail Cart for which the Send to Briefcase or overwrite functionality is being carried out */ -function beforeLegalBriefcaseOperations(result) { - "use strict"; - var iIterateFiles = 0, iIterator = 0, - arrFileURLs = result.oParam.FullUrl.split(";"), - iDocuments = $(".attachmentList").length, - arrMatches = []; - - arrMatches = oGridConfig.arrSelectedGridData; - - if (arrMatches.length > 0) { - var sFileURLs = "", iCount, oEmailRelativePath; - for (iCount = 0; iCount < arrMatches.length; iCount++) { - if (arrMatches[iCount].DocumentUrl) { - oEmailRelativePath = unescape(arrMatches[iCount].DocumentUrl); - } else { - oEmailRelativePath = unescape(arrMatches[iCount].Path); - } - oEmailRelativePath = trimEndChar(oEmailRelativePath, "/"); - oEmailRelativePath = oEmailRelativePath.replace(oGlobalConstants.Site_Url, "$") + "$"; - if (arrMatches[iCount].DocumentClientUrl) { - sFileURLs += arrMatches[iCount].DocumentTeamUrl + oEmailRelativePath + arrMatches[iCount].FileName + ";"; - } else { - sFileURLs += arrMatches[iCount].SiteName + oEmailRelativePath + arrMatches[iCount].FileName + ";"; - } - } - } - - var arrSelectedFileURLs = sFileURLs.split(";"); - - for (iIterateFiles = 0; iIterateFiles < arrFileURLs.length; iIterateFiles++) { - if (arrFileURLs[iIterateFiles] !== "") { - for (iIterator = 0; iIterator < iDocuments; iIterator++) { - if (arrSelectedFileURLs[iIterator] === arrFileURLs[iIterateFiles]) { - $(".emailDocumentNames #" + iIterator + " img.mailCheck").css("display", "none"); - $(".emailDocumentNames #" + iIterator + " .sendingDocumentImg").css("display", "inline"); - } - } - } - } -} - -/* Function to display success/failure notification */ -function showNotification(iSentDocumentCount, sMsg, resultClass, iTotalDocument, bUninitializedError) { - "use strict"; - // Remove the return false to enable the links again - $(".sendEmailOptions").each(function () { - "use strict"; - var oCurrentLink = $(this); - if (oCurrentLink[0]) { - oCurrentLink.attr("onclick", oCurrentLink.attr("onclick").replace(/return false;/g, "")); - } - }); - - $("#legalBriefcaseLoadingImage").hide(); - var sContent = "", sFailContent = ""; - if (iSentDocumentCount === 1) { - sContent = '
    ' + '
    ' + iSentDocumentCount + ' File sent to your OneDrive. You can view here x
    '; - } else { - sContent = '
    ' + '
    ' + iSentDocumentCount + ' Files sent to your OneDrive. You can view here x
    '; - } - // Do not show the success message for 0 documents uploaded - if (0 < iSentDocumentCount) { - $(".popUpHeader .notificationContainerForPopup").append(sContent); - } - if (resultClass === "failNotification") { - $(".successNotification").hide(); - if (1 === bUninitializedError) { // In case user's OneDrive is not set up - sFailContent = '
    ' + '' + oGlobalConstants.ErrorMessageSendToOneDrive + 'x
    '; - } else if (2 === bUninitializedError) { //// In case of exception occurred in service - var sErrorCode = sMsg && sMsg.split("#|#") && sMsg.split("#|#")[0]; - if (sErrorCode === oGlobalConstants.ErrorCodeOneDriveNotConfigured) { - sFailContent = '
    ' + '' + oGlobalConstants.ErrorMessageOneDriveNotConfigured.replace("{0}", sOneDriveErrorMessage) + 'x
    '; - } else { - sFailContent = '
    ' + '' + oGlobalConstants.Send_To_OneDrive_Error_Message + sErrorCode + 'x
    '; - } - $(".attachmentList .mailCheck").show(); //// need to perform show hide as previous implementation does not allow to use add and remove class - $(".attachmentList .sendingDocumentImg").hide(); - } else if (3 === bUninitializedError) { //// need to show error while failed to checkout - sFailContent = '
    ' + '' + oGlobalConstants.Check_Out_Document_Fail + " " + sMsg + 'x
    '; - } else { - var iFailedDocument = iTotalDocument - iSentDocumentCount; - sFailContent = '
    ' + ' Failed to send ' + iFailedDocument + ' document to OneDrive. x
    '; - } - $(".popUpHeader .notificationContainerForPopup").append(sFailContent); - } -} - -$(document).ready(function () { - "use strict"; - $(document).on("click", ".mailCheck", function () { - // Set the image to checked if unchecked and vice versa on click. - // data-checked attribute will be true or false based on the image. - var oCheckboxImage = $(this); - if (oCheckboxImage[0]) { - var sDataChecked = oCheckboxImage.attr("data-checked"); - if (sDataChecked && "false" === sDataChecked) { - oCheckboxImage.attr({ "src": "../Images/checkbox-selected.png", "data-checked": "true" }); - } else { - oCheckboxImage.attr({ "src": "../Images/checkbox.png", "data-checked": "false" }); - } - } - }); -}); - - -$(window).on("resize", function () { - "use strict"; - // hide infoPopup - $(".checkOutPopup").hide(); -}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ManagePermissions.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ManagePermissions.js deleted file mode 100644 index 2fabf811..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/ManagePermissions.js +++ /dev/null @@ -1,829 +0,0 @@ -/// JS1003,JS2005,JS2023,JS2024,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS2085,JS3054,JS3056,JS3057,JS3058,JS3085,JS3092,JS3116 - -var oManagePermissionsOnMatter = (function () { - "use strict"; - var serviceConstants = { - sCentralRepositoryLocation: oGlobalConstants.Central_Repository_Url, - arrRoles: [], - arrPermissions: [], - oMandatoryRoles: [], - arrReadOnlyUsers: [], - oMandatoryRoleNames: [], - arrUserUploadPermissions: oGlobalConstants.User_Upload_Permissions && oGlobalConstants.User_Upload_Permissions.trim().split(","), - sConflictScenario: "", - bHasEmailStamped: false, - oEmailRegex: new RegExp(oGlobalConstants.Email_Validation_Regex) - }, - oEditPermissionOnMatter = { - sPermissionToAppend: "
    " - + "
    " - + "" - + "
    " - + "
    Role Icon
    " - + "
    " - + "
    Permission Icon
    " - + "delete
    ", - iPermissionCount: 1 - }, - commonFunctions = {}, - /* Object to store all the JQuery binding elements used */ - oJQueryObjects = { - edit: "", - clientUrl: "", - libraryName: "", - arrResults: "", - iShowSuccessMessage: "" - }; - - /* Functions for retrieving roles */ - commonFunctions.getRoleFailure = function (result) { - "use strict"; - return false; - }; - commonFunctions.getRoleSuccess = function (result) { - "use strict"; - var $RoleObject = $("#ddlRoleAssignList1"); - $RoleObject.empty(); - var arrResults = JSON.parse(result), roleItem, roleOption, arrOptions = [], iLengthvar - , iExpectedCount = 0, iActualCount = 0, iIterator = 0, iLength; - if (!arrResults.code) { - serviceConstants.oMandatoryRoles = arrResults; - serviceConstants.arrRoles = JSON.parse(JSON.stringify(arrResults)); - for (roleItem in arrResults) { - roleOption = "
    " + arrResults[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - iLength = serviceConstants.oMandatoryRoles.length; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - $RoleObject.append(arrOptions.join("")); - // This function will display "role" drop-down menu - $(".ddlRoleAssignDiv1").click(function (event) { - closeAllPopupExcept(""); - var $Element = $RoleObject; - toggleThisElement($Element); - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $("#ddlRoleAssignList1").addClass("hide"); - $(".assignPerm1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - // Default selection should be Responsible Attorney - $($(".assignPerm1")[0]).click(); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#btnSave", arrResults.value); - } - } - iLength = serviceConstants.oMandatoryRoles.length; - serviceConstants.oMandatoryRoleNames.length = 0; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - iExpectedCount++; - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - oJQueryObjects.iShowSuccessMessage++; - if (2 == oJQueryObjects.iShowSuccessMessage) { - oJQueryObjects.edit = getParameterByName("IsEdit"); - commonFunctions.getTeamMembers(); - if ("false" === oJQueryObjects.edit) { - commonFunctions.addMorePermissions(1); - } - } - }; - commonFunctions.getMatterCenterRoles = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { - "Url": sClientUrl - } - }; - oCommonObject.callProvisioningService("GetRoleData", matterDetails, commonFunctions.getRoleSuccess, commonFunctions.getRoleFailure); - }; - - /* Functions for retrieving permissions */ - commonFunctions.getPermSuccess = function (result) { - "use strict"; - var $PermissionObject = $("#ddlPermAssignList1"); - $PermissionObject.empty(); - var arrResults = JSON.parse(result), permItem, permOption, arrOptions = []; - if (!arrResults.code) { - serviceConstants.arrPermissions = JSON.parse(JSON.stringify(arrResults)); - for (permItem in arrResults) { - permOption = "
    " + arrResults[permItem].Name + "
    "; - arrOptions.push(permOption); - } - $PermissionObject.append(arrOptions.join("")); - // This function will display "permission" drop-down menu - $(".ddlPermAssignDiv1").click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $("#ddlPermAssignList1").addClass("hide"); - $(".permContent1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - // Default value should be full control - $($(".permValue")[0]).click(); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#btnSave", arrResults.value); - } - } - oJQueryObjects.iShowSuccessMessage++; - if (2 == oJQueryObjects.iShowSuccessMessage) { - oJQueryObjects.edit = getParameterByName("IsEdit"); - commonFunctions.getTeamMembers(); - if ("false" === oJQueryObjects.edit) { - commonFunctions.addMorePermissions(1); - } - } - }; - commonFunctions.getPermFailure = function (result) { - "use strict"; - return false; - }; - commonFunctions.getMatterCenterPermissions = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { - "Url": sClientUrl - } - }; - - oCommonObject.callProvisioningService("GetPermissionLevels", matterDetails, commonFunctions.getPermSuccess, commonFunctions.getpermFailure); - }; - - /* Function to add permission row and bind the events*/ - commonFunctions.bindPermissionEvents = function (iUniqueId) { - "use strict"; - var permItem, permOption, roleItem, roleOption, arrOptions = []; - for (roleItem in serviceConstants.arrRoles) { - roleOption = "
    " + serviceConstants.arrRoles[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - var $RoleObject = $("#ddlRoleAssignList" + iUniqueId); - $RoleObject.append(arrOptions.join("")); - // This function will display "role" drop-down menu - $(".ddlRoleAssignDiv" + iUniqueId).click(function (event) { - closeAllPopupExcept(""); - var $Element = $RoleObject; - toggleThisElement($Element); - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm" + iUniqueId + "").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign" + iUniqueId); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $RoleObject.addClass("hide"); - $(".assignPerm" + iUniqueId).removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".assignPerm" + iUniqueId)[0]).click(); - - arrOptions = []; - for (permItem in serviceConstants.arrPermissions) { - permOption = "
    " + serviceConstants.arrPermissions[permItem].Name + "
    "; - arrOptions.push(permOption); - } - var $PermissionObject = $("#ddlPermAssignList" + iUniqueId); - $PermissionObject.append(arrOptions.join("")); - - // This function will display permission drop-down menu - $(".ddlPermAssignDiv" + iUniqueId).click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent" + iUniqueId).click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign" + iUniqueId); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $PermissionObject.addClass("hide"); - $(".permContent" + iUniqueId).removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".permContent" + iUniqueId)[0]).click(); - - oCommonObject.bindAutocomplete("#txtAssign" + iUniqueId, true); - }; - - /* Function to add more team assignment line items */ - commonFunctions.addMorePermissions = function (iUniqueId) { - "use strict"; - var sPermissionChunk = $.trim(oEditPermissionOnMatter.sPermissionToAppend); - sPermissionChunk = sPermissionChunk ? sPermissionChunk.replace(/\{0\}/g, iUniqueId) : ""; - sPermissionChunk && $("#permissionContainer").append(sPermissionChunk); - - if (null !== oJQueryObjects.add && 1 !== parseInt(iUniqueId, 10)) { - commonFunctions.bindPermissionEvents(parseInt(iUniqueId, 10)); - } else { - commonFunctions.bindPermissionEvents(parseInt(iUniqueId, 10)); - } - oCommonObject.bindAutocomplete("#txtAssign" + iUniqueId, true); - oEditPermissionOnMatter.iPermissionCount++; - }; - - commonFunctions.getTeamMembers = function () { - "use strict"; - oJQueryObjects.clientUrl = getParameterByName("clientUrl"); - oJQueryObjects.libraryName = getParameterByName("matterName"); - var matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { - "Url": oJQueryObjects.clientUrl - }, - "matter": { "Name": oJQueryObjects.libraryName } - }; - oCommonObject.callProvisioningService("RetrieveMatterStampedProperties", matterDetails, commonFunctions.getTeamMembersSuccess, commonFunctions.getTeamMembersFailure); - }; - commonFunctions.getTeamMembersSuccess = function (result) { - "use strict"; - if (result) { - var arrResults = JSON.parse(result); - var iCounter = 0, iCount = 0, userRole, userPermission, sEmail = ""; - $(".loadingImage").hide(); - $("#editpermissionContainer").removeClass("hide"); - oJQueryObjects.arrResults = arrResults; - if (!arrResults.code) { - if (0 < arrResults.MatterObject.BlockUserNames.length) { - serviceConstants.sConflictScenario = "True"; - } else { - serviceConstants.sConflictScenario = "False"; - } - } - if ("true" === oJQueryObjects.edit) { - $("#permissionContainer").empty(); - if (!arrResults.code) { - if (0 < arrResults.MatterObject.AssignUserNames.length) { - if (arrResults.MatterObject.AssignUserNames) { - for (iCounter = 0; iCounter < arrResults.MatterObject.AssignUserNames.length; iCounter++) { - var userName = "#txtAssign" + (iCounter), roles = "#ddlRoleAssign" + (iCounter), permissions = "#ddlPermAssign" + (iCounter); - commonFunctions.addMorePermissions(iCounter); - for (iCount = 0; iCount < arrResults.MatterObject.AssignUserNames[iCounter].length; iCount++) { - if (arrResults.MatterObject.AssignUserEmails && 0 < arrResults.MatterObject.AssignUserEmails.length && arrResults.MatterObject.AssignUserEmails[iCounter][iCount]) { - sEmail = arrResults.MatterObject.AssignUserEmails[iCounter][iCount]; - if (serviceConstants.oEmailRegex.test(sEmail)) { - $(userName)[0].value += arrResults.MatterObject.AssignUserNames[iCounter][iCount] + " (" + sEmail + ")" + ";"; - } else { - $(userName)[0].value += arrResults.MatterObject.AssignUserNames[iCounter][iCount] + ";"; - } - oManagePermissionsOnMatter.bHasEmailStamped = true; - } else { - $(userName)[0].value += arrResults.MatterObject.AssignUserNames[iCounter][iCount] + ";"; - - } - } - $(userName).attr("data-resolved", "1"); - userRole = arrResults.MatterObject.Roles ? arrResults.MatterObject.Roles[iCounter] ? arrResults.MatterObject.Roles[iCounter] : serviceConstants.arrRoles[0].Name : serviceConstants.arrRoles[0].Name; - userPermission = arrResults.MatterObject.Permissions[iCounter] ? arrResults.MatterObject.Permissions[iCounter] ? arrResults.MatterObject.Permissions[iCounter] : serviceConstants.arrPermissions[0].Name : serviceConstants.arrPermissions[0].Name; - if (-1 === $.inArray(userRole, serviceConstants.oMandatoryRoleNames)) { - $(roles).val(userRole).attr("data-value", userRole).attr("data-mandatory", "false"); - } else { - $(roles).val(userRole).attr("data-value", userRole).attr("data-mandatory", "true"); - } - $(permissions).val(userPermission).attr("data-value", userPermission); - } - } - } else { - if (null !== arrResults.IsNewMatter) { - if (arrResults.MatterDetailsObject.ResponsibleAttorney) { - var userName = "#txtAssign" + (iCounter), roles = "#ddlRoleAssign" + (iCounter), permissions = "#ddlPermAssign" + (iCounter); - commonFunctions.addMorePermissions(iCounter); - $(userName)[0].value = arrResults.MatterDetailsObject.ResponsibleAttorney; - $(userName).attr("data-resolved", "1"); - $(roles).val(serviceConstants.arrRoles[0].Name).attr("data-value", userRole).attr("data-mandatory", "true"); - $(permissions).val("").attr("data-value", ""); - } - if (arrResults.MatterDetailsObject.TeamMembers) { - iCounter++; - var teamMembers = arrResults.MatterDetailsObject.TeamMembers.split(";"); - for (iCount = 0; iCount < teamMembers.length; iCount++) { - var userName = "#txtAssign" + (iCounter), roles = "#ddlRoleAssign" + (iCounter), permissions = "#ddlPermAssign" + (iCounter); - commonFunctions.addMorePermissions(iCounter); - iCounter++; - $(userName)[0].value += teamMembers[iCount]; - $(userName).attr("data-resolved", "1"); - $(roles).val("").attr("data-value", userRole).attr("data-mandatory", ""); - $(permissions).val("").attr("data-value", userPermission).attr("data-mandatory", ""); - } - } - } - - } - - - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#btnSave", arrResults.value); - } - } - } - } - }; - commonFunctions.getTeamMembersFailure = function () { - "use strict"; - return false; - }; - - commonFunctions.validatePopup = function (iCurrentPage) { - "use strict"; - switch (iCurrentPage) { - case 1: - if (validateAssignedUser()) { - if (validateTeamAssigmentRole()) { - if (validatePermission()) { - if (validateBlockUsers()) { - return true; - } else { - showErrorNotification("#btnSave", oMatterProvisionConstants.Error_Invalid_User); - } - } else { - showErrorNotification("#btnSave", oMatterProvisionConstants.Error_Edit_Matter_Mandatory_Permission); - } - - } else { - showErrorNotification("#btnSave", oMatterProvisionConstants.Error_Mandatory_Role.replace("{0}", serviceConstants.oMandatoryRoleNames.join(","))); - serviceConstants.oMandatoryRoleNames.length = 0; - } - } - return false; - - break; - case 2: - if (validateAssignedUser()) { - if (validateBlockUsers()) { - return true; - } else { - showErrorNotification("#btnSave", oMatterProvisionConstants.Error_Invalid_User); - } - } - return false; - default: - return false; - } - }; - - $(document).ready(function () { - "use strict"; - oJQueryObjects.clientUrl = getParameterByName("clientUrl"); - oJQueryObjects.libraryName = getParameterByName("matterName"); - oJQueryObjects.edit = getParameterByName("IsEdit"); - if (validateParameters()) { - commonFunctions.getMatterCenterRoles(); - commonFunctions.getMatterCenterPermissions(); - } else { - $(".loadingImage").hide(); - $(".error").html(oGlobalConstants.Edit_Matter_Insufficient_Parameter).removeClass("hide"); - } - - $("#addMorePermissions").on("click", function () { - commonFunctions.addMorePermissions(oEditPermissionOnMatter.iPermissionCount); - }); - $(document).on("click", ".deleteIcon", function () { - if (1 < $(".assignNewPermission").length) { - var oParentObject = $(this).parent(); - oParentObject[0] && oParentObject.remove(); - } - closeAllPopupExcept(""); - }); - }); - $("#btnSave").click(function (event) { - "use strict"; - $(".errorPopUp").addClass("hide"); - $(".loading").removeClass("hide"); - $("#btnSave").attr("disabled", "disabled"); - var isValid = "true" === oJQueryObjects.edit ? commonFunctions.validatePopup(1) : commonFunctions.validatePopup(2); - var oAssignPermList = $("input[id^=txtAssign]"), iErrorFlag = 0, sResponsibleAttorney = [], sResponsibleAttorneyEmail = []; - var arrResults = oJQueryObjects.arrResults - , userId = []; - if (arrResults.ClientObject) { - var sClientId = arrResults.ClientObject.Id ? arrResults.ClientObject.Id : "" - , sClientUrl = arrResults.ClientObject.Url ? arrResults.ClientObject.Url : "" - , sClientName = arrResults.ClientObject.Name ? arrResults.ClientObject.Name : ""; - } - if (arrResults.MatterObject) { - var - matterName = arrResults.MatterObject.Name ? arrResults.MatterObject.Name : "" - , arrUserNames = [] - , arrUserEmails = [] - , arrTeamMembers = [] - , matterDetails = {} - , arrRoles = [] - , arrPermissions = [] - , arrBlockUserNames = arrResults.MatterObject.BlockUserNames ? arrResults.MatterObject.BlockUserNames : "" - , roleInformation = {}; - } - if (isValid) { - $.each($("input[id^=ddlPermAssign]"), function (iPosition) { - var $CurrObject = $(this)[0]; - if ($CurrObject) { - var userPermission = $($CurrObject).val(); - if (-1 < $.inArray(userPermission, serviceConstants.arrUserUploadPermissions)) { - var readUsersList = oCommonObject.getUserName($($("input[id^=txtAssign]")[iPosition]).val().trim(), false); - if (readUsersList) { - var readUsersLength = readUsersList.length; - for (var iIterator = 0; iIterator < readUsersLength; iIterator++) { - var tempUser = readUsersList[iIterator]; - if (tempUser && -1 === $.inArray(tempUser, serviceConstants.arrReadOnlyUsers)) { - serviceConstants.arrReadOnlyUsers.push(readUsersList[iIterator]); //// store the users in the list - } - } - } - } - } - }); - - $.each(oAssignPermList, function () { - var sCurrElementID = $(this).attr("id"); - if (sCurrElementID) { - sCurrElementID = sCurrElementID.trim().split("txtAssign")[1]; - var sCurrRole = $("#ddlRoleAssign" + sCurrElementID), sCurrPermission = $("#txtAssign" + sCurrElementID); - if (sCurrRole && sCurrPermission) { - if (-1 !== $.inArray(sCurrRole.val(), serviceConstants.oMandatoryRoleNames)) { - sResponsibleAttorney.push(oCommonObject.getUserName($.trim($(this).val()), true).join(";")); - sResponsibleAttorneyEmail.push(oCommonObject.getUserName($.trim($(this).val()), false).join(";")); // Removed and Appended semicolon to ensure all users are separated by semicolon - } - } - } - }); - $.each(oAssignPermList, function () { - - var sCurrElementID = $(this).attr("id"); - if (sCurrElementID) { - sCurrElementID = sCurrElementID.trim().split("txtAssign")[1]; - var sCurrRole = $("#ddlRoleAssign" + sCurrElementID), sCurrPermission = $("#txtAssign" + sCurrElementID); - if (sCurrRole && sCurrPermission) { - if (roleInformation.hasOwnProperty(sCurrRole.val())) { - //// This role is already present. append the new role with semicolon separated value - roleInformation[sCurrRole.val()] = roleInformation[sCurrRole.val()] + sCurrPermission.val(); - } else { - //// Add this role to the object - roleInformation[sCurrRole.val()] = sCurrPermission.val(); - } - - } - } - }); - - $.each(roleInformation, function (key, item) { - roleInformation[key] = trimEndChar(item.trim(), ";"); - }); - - $.each($("input[id^=ddlRoleAssign]"), function () { - arrRoles.push($(this).val()); - }); - - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($.trim($(this).val()), true)); - arrUserEmails.push(oManagePermissionsOnMatter.bHasEmailStamped ? oCommonObject.getUserName($.trim($(this).val(), false)) : getValidUserName($.trim($(this).val()))); - arrTeamMembers.push(oCommonObject.getUserName($.trim($(this).val()), true).join(";")); - userId.push(this.id); - }); - - $.each($("input[id^=ddlPermAssign]"), function () { - arrPermissions.push($(this).val()); - }); - - matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, - "client": { "Url": oJQueryObjects.clientUrl, "Id": sClientId, "Name": sClientName }, - "matter": { "Name": oJQueryObjects.libraryName, "BlockUserNames": arrBlockUserNames, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "Permissions": arrPermissions, "Roles": arrRoles, "Conflict": { "Identified": serviceConstants.sConflictScenario } }, - "matterDetails": { "ResponsibleAttorney": sResponsibleAttorney.join(";").replace(/;;/g, ";"), "ResponsibleAttorneyEmail": sResponsibleAttorneyEmail.join(";").replace(/;;/g, ";"), "UploadBlockedUsers": serviceConstants.arrReadOnlyUsers, "TeamMembers": arrTeamMembers.join(";"), "RoleInformation": JSON.stringify(roleInformation) } - , "editMode": oJQueryObjects.edit, "userId": userId - }; - oCommonObject.callProvisioningService("UpdateMatterDetails", matterDetails, commonFunctions.matterUpdateSuccess, commonFunctions.matterUpdateFailure, commonFunctions.beforeSendMatterUpdate); - } else { - event.stopPropagation(); - } - - }); - commonFunctions.beforeSendMatterUpdate = function () { - $(".popupWait").removeClass("hide"); - }; - commonFunctions.matterUpdateSuccess = function (result) { - "use strict"; - if (result) { - var arrResults = JSON.parse(result); - $("#btnSave").removeAttr("Disabled"); - $(".loading, .popupWait").addClass("hide"); - if (!arrResults.code) { - sendMessageToParent("true"); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - var results = JSON.stringify(oJQueryObjects.arrResults); - var errorMessage; - commonFunctions.getTeamMembersSuccess(results); - if (arrResults.code === oGlobalConstants.Error_Code_Security_Group_Exists || arrResults.code === oGlobalConstants.Incorrect_Team_Members_Code) { - errorMessage = arrResults.value.split("$|$")[0]; - } else { - errorMessage = arrResults.value; - } - showErrorNotification("#btnSave", errorMessage); - } - } - } - }; - commonFunctions.matterUpdateFailure = function (result) { - "use strict"; - $(".loading,.popupWait").addClass("hide"); - $(".error").html(oGlobalConstants.Edit_Matter_Failure).removeClass("hide"); - $("#btnSave").removeAttr("Disabled"); - }; - - function validateAssignedPerm() { - "use strict"; - var oAssignPermList = $("input[id^=txtAssign]"), iAssignPermPos = 1, iErrorFlag = 0, arrAssignIdList = [], oRolesList = $("input[id^=ddlRoleAssign]"); - //// Here we have a list of ID's of Assign Permissions which are currently present in Step 2 - $.each(oAssignPermList, function (iIterator) { - if ("1" !== $(this).attr("data-resolved")) { - if ($(this).attr("id")) { - var iCurrId = $(this).attr("id").trim().split("txtAssign")[1], oCurrRoleItem = $("#ddlRoleAssign" + iCurrId); - if (oCurrRoleItem) { - var sErrorId = $(this).attr("id"), sAssignedRole = oCurrRoleItem.val(); - if ("true" === $($("input[id=ddlRoleAssign" + iCurrId + "]")[0]).attr("data-mandatory")) { - iErrorFlag = 1; - } - } - } - } - }); - if (1 === iErrorFlag) { - return false; - } - return true; - }; - - // Function to get email address from text box if present else take user name instead of email address - function getValidUserName(sUserEmails) { - "use strict"; - var arrUserNames = [], sEmail = "", oEmailRegex = new RegExp(oGlobalConstants.Email_Validation_Regex); - if (sUserEmails && null !== sUserEmails && "" !== sUserEmails) { - arrUserNames = sUserEmails.split(";"); - for (var iIterator = 0; iIterator < arrUserNames.length - 1; iIterator++) { - if (arrUserNames[iIterator] && null !== arrUserNames[iIterator] && "" !== arrUserNames[iIterator]) { - if (-1 !== arrUserNames[iIterator].lastIndexOf("(")) { - sEmail = $.trim(arrUserNames[iIterator].substring(arrUserNames[iIterator].lastIndexOf("(") + 1, arrUserNames[iIterator].lastIndexOf(")"))); - if (oEmailRegex.test(sEmail)) { - arrUserNames[iIterator] = sEmail; - } - } - } - } - } - return arrUserNames; - }; - - function validateTeamAssigmentRole() { - "use strict"; - var oAssignList = $("input[id^=ddlRoleAssign]") - , iExpectedCount = 0, iActualCount = 0, iIterator = 0, iLength = serviceConstants.oMandatoryRoles.length; - serviceConstants.oMandatoryRoleNames.length = 0; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - iExpectedCount++; - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - $.each(oAssignList, function () { - if ($(this)[0]) { - if ("true" === $($(this)[0]).attr("data-mandatory")) { - iActualCount++; - } - } - }); - if (iExpectedCount <= iActualCount) { - return true; - } - return false; - } - - /* Function to validate Permission */ - function validatePermission() { - "use strict"; - var oPermissionList = $("input[id^=ddlPermAssign]"), bIsFullControl = false; - $.each(oPermissionList, function (oPermissionList, oPermissionListItem) { - if (oPermissionListItem) { - if (oMatterProvisionConstants.Edit_Matter_Mandatory_Permission_Level === $(oPermissionListItem).attr("data-value")) { - bIsFullControl = true; - } - } - }); - return bIsFullControl; - } - - function getParameterByName(name) { - "use strict"; - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(decodeURIComponent(location.search)); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); - } - - /* Function to validate the entries in Blocked user field */ - function validateBlockUsers() { - "use strict"; - var validity = true, arrBlockedUsers = oJQueryObjects.arrResults.MatterObject.BlockUserNames ? oJQueryObjects.arrResults.MatterObject.BlockUserNames : null; - if (!arrBlockedUsers) { - return true; - } - $.each(arrBlockedUsers, function (iIndex) { - if (arrBlockedUsers[iIndex]) { - $.each($("input[id^=txtAssign]"), function () { - if ($(this).val().trim() && -1 !== $(this).val().trim().indexOf(arrBlockedUsers[iIndex].trim()) && arrBlockedUsers[iIndex] && arrBlockedUsers[iIndex].trim()) { - validity = false; - return false; - } - }); - if (!validity) { - return false; - } - } - }); - return validity; - } - - $(document).on("click", function () { - "use strict"; - closeAllPopupExcept(""); - }); - - function showErrorNotification(sElement, sMsg) { - "use strict"; - $(".loading").addClass("hide"); - $("#btnSave").removeAttr("Disabled"); - var windowWidth = GetWidth(); - var removeTop = -247, removeLeft = -430; - var posLeft = "50px"; - var triangleTopPos = 48; - var errorBoxHeight = 55; - var errorBoxTop = 7; - var errorBoxLeft = 24; - var oRoleObject = $(sElement); - if (oRoleObject) { - var iLeftPos = oRoleObject.offset().left - , iTopPos = oRoleObject.offset().top - , iCurrentWidth = oRoleObject.outerWidth(); - iLeftPos = parseInt(iLeftPos, 10) + parseInt(iCurrentWidth, 10) - 20; - iTopPos = parseInt(iTopPos, 10) - 20; - oJQueryObjects.$ErrorPopUp = $(".errorPopUp"); - if (windowWidth > 734) { - if (sElement === "#btnSave" && !($("#editpermissionContainer").hasClass("hide"))) { - removeLeft = 90; - posLeft = "125px"; - removeTop = 73; - } - } - oJQueryObjects.$ErrorPopUp.css("left", iLeftPos - removeLeft).css("top", iTopPos - removeTop).removeClass("hide").find(".errText").text(sMsg); - $(".mainArea .errTriangleBorder").css("left", posLeft); - $(".mainArea .errTriangle").css("left", posLeft); - $(".mainArea .errTriangleBorder").css("top", "calc(50% - -" + (triangleTopPos - 1) + "px)"); - $(".mainArea .errTriangle").css("top", "calc(50% - -" + (triangleTopPos) + "px)"); - $(".mainArea .errText").css("min-height", errorBoxHeight + "px").css("top", errorBoxTop + "px").css("left", errorBoxLeft + "px"); - oRoleObject.css("border-width", "2px").css("border-color", "red"); - } - } - - function GetWidth() { - "use strict"; - var x = 0; - if (self.innerHeight) { - x = self.innerWidth; - } else if (document.documentElement && document.documentElement.clientHeight) { - x = document.documentElement.clientWidth; - } else if (document.body) { - x = document.body.clientWidth; - } - return x; - } - - $(document).on("keypress, input", "input[id^=txtAssign]", function () { - $(this).removeAttr("data-resolved"); - }); - - $(document).on("click", "#editpermissionContainer", function () { - "use strict"; - $(".errorPopUp").addClass("hide"); - }); - function validateParameters() { - "use strict"; - if (!oJQueryObjects.clientUrl || !oJQueryObjects.libraryName || !oJQueryObjects.edit) { - return false; - } - return true; - } - - /* Function to validate Assigned Users */ - function validateAssignedUser() { - "use strict"; - var oAssignPermList = $("input[id^=txtAssign]"), iErrorFlag = 0; - //// Here we have a list of ID's of Assign Permissions which are currently present in Step 2 - $.each(oAssignPermList, function (iIterator) { - var iCurrId = $(this).attr("id").trim().split("txtAssign")[1], iCurrUser = $("#txtAssign" + iCurrId), oCurrRoleItem = $("#ddlRoleAssign" + iCurrId); - if (!iCurrUser.val()) { - iErrorFlag = 1; - showErrorNotification("#btnSave", oGlobalConstants.Edit_Matter_Validate_User.replace("{0}", oCurrRoleItem.val())); - } - }); - if (1 === iErrorFlag) { - return false; - } - return true; - } - - // Function is used to close popup dialog - function sendMessageToParent(status) { - "use strict"; - if (status) { - var iFrameURL = oGlobalConstants.Site_Url; - window.top.parent.postMessage(status, iFrameURL); - } - } - - /* Function to toggle element */ - function toggleThisElement($Element) { - "use strict"; - if ($Element.is(":visible")) { - $Element.addClass("hide"); - } else { - $Element.removeClass("hide"); - } - } - - /* Function to close all pop up except the passed one */ - function closeAllPopupExcept(divClass) { - "use strict"; - if ("ddlClientList" !== divClass) { - $("#ddlClientList").addClass("hide"); - $(".ddlClientListItem").removeClass("ddListOnHover"); - } - if ("popUpPGList" !== divClass) { - $("#popUpPGList").addClass("hide"); - } - // Hide assign permission role drop-down - $(".ddlRoleAssignList").addClass("hide"); - // Hide Permission level drop-down - $(".ddlPermAssignList").addClass("hide"); - } - // #region Return exposed Functions and Variables - return ({ - sConflictScenario: function () { - return serviceConstants.sConflictScenario; - } - }); -})(); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MatterProvision.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MatterProvision.js deleted file mode 100644 index 411d6d58..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/MatterProvision.js +++ /dev/null @@ -1,2543 +0,0 @@ -/// JS1003,JS2076,JS2032,JS2064,JS2074,JS2024,JS2026,JS2005,JS3085,JS3116,JS3092,JS3057,JS3058,JS3056 -//// Above exclusion list is signed off as per the Modern Cop Exclusion list. - -/* Provision Matter Global Object */ -var oMatterProvisionObject = (function () { - "use strict"; - // #region Global Declaration - /* Object to store all the global constants */ - var serviceConstants = { - sCentralRepositoryLocation: oGlobalConstants.Central_Repository_Url, - oTermStoreJson: {}, - iCurrentPage: 1, - bClient: false, - bRole: false, - bPermission: false, - bContentType: false, - bValidMatterName: true, - sPracticeGroupList: "", - sAreaOfLawList: "", - sSubAreaOfLawList: "", - iRefreshCycle: oGlobalConstants.Refresh_Local_Storage, - oMandatoryRoles: [], - oMandatoryRoleNames: [], - arrUserUploadPermissions: oGlobalConstants.User_Upload_Permissions && oGlobalConstants.User_Upload_Permissions.trim().split(","), - arrReadOnlyUsers: [], - iShowSuccessMessage: 0, - iLastRowNumber: 2, - bMatterLandingPage: true, - bViewCreationFailed: false, - bErrorOccured: false, - sConflictScenario: "True", - oDefaultConfiguration: [], - isNextClicked: false, - iPageClicked: 1, - isValidClient: true, - isErrorOccurred: false, - iCallsComplete: 0, - bCloseErrorPopup: true, - matterGUID: "", - oEmailRegex: new RegExp(oGlobalConstants.Email_Validation_Regex) - }, - /* Object to store all the JQuery binding elements used */ - oJQueryObjects = { - $Loading: "", - $LoadingLookUp: "", - $ClientName: "", - $ClientId: "", - $MatterName: "", - $MatterId: "", - $MatterDescription: "", - $ContentTypes: "", - $ConflictCheckConducted: "", - $ConflictConductedBy: "", - $ConflictCheckDate: "", - $ConflictIdentified: "", - $BlockedUsers: "", - $BoolSecureMatter: "", - $AssignPermissions: "", - $CreateButton: "", - $LookUpButton: "", - $ErrorPopUp: "", - $MenuClick: "", - $PracticeGroup: "", - $SwitchApp: "", - $Paginate: "" - }, - commonFunctions = {}; /* Object to store all the common functions */ - // #endregion - - /* Function to generate 32 bit GUID */ - function get_GUID() { - function create_GUID(bFlag) { - var sCurrentGUID = (Math.random().toString(16) + "000000000").substr(2, 8); - return bFlag ? "-" + sCurrentGUID.substr(0, 4) + "-" + sCurrentGUID.substr(4, 4) : sCurrentGUID; - } - return create_GUID() + create_GUID(true) + create_GUID(true) + create_GUID(); - } - - /* Function to get the GUID by removing the hyphen character */ - function getMatterGUID() { - serviceConstants.matterGUID = get_GUID().replace(/-/g, ""); //// Remove '-' (hyphen) from the GUID as this character is removed from URL by SharePoint - } - - /* Function to display notifications in App */ - function showNotification(sElement, sMsg, sClass) { - var sContent = "
    " + sMsg + "x
    "; - $(sElement).removeClass("successBanner warningBanner failureBanner").addClass(sClass).append(sContent); - } - - /* Function to display error Tool tip */ - function showErrorNotification(sElement, sMsg) { - var windowWidth = GetWidth(); - var removeTop = 75, removeLeft = 115; - var posLeft = "50px"; - var triangleTopPos = 48; - var errorBoxHeight = 55; - var errorBoxTop = 7; - var errorBoxLeft = 24; - var oSecurityGroupError = sMsg.split("$|$"); - var bSecurityGroupError = false; - if (2 === oSecurityGroupError.length) { - bSecurityGroupError = true; - } - var oRoleObject = $(sElement); - if (oRoleObject) { - var iLeftPos = oRoleObject.offset().left - , iTopPos = oRoleObject.offset().top - , iCurrentWidth = oRoleObject.outerWidth(); - iLeftPos = parseInt(iLeftPos, 10) + parseInt(iCurrentWidth, 10) - 20; - iTopPos = parseInt(iTopPos, 10) - 20; - oJQueryObjects.$ErrorPopUp = $(".mainArea .errorPopUp"); - if (windowWidth > 734) { - if (sElement === "#btnLookup") { - removeLeft = 180; - posLeft = "125px"; - removeTop = 76; - } else if (sElement === "#txtMatterDesc") { - triangleTopPos = 48; - removeTop = 75; - removeLeft = 100; - errorBoxHeight = 62; - errorBoxTop = 0; - } else if (sElement === ".chkConflictCheckParent") { - removeTop = 52; - triangleTopPos = 31; - errorBoxHeight = 40; - errorBoxTop = 5; - removeLeft = 627; - } else if (sElement === "#txtMatterId") { - removeLeft = 145; - } else if (sElement === "#txtBlockUser") { - removeLeft = 107; - triangleTopPos = 50; - removeTop = 76; - errorBoxHeight = 64; - errorBoxTop = 0; - } else if (sElement === "#ddlRoleAssign1") { - removeLeft = 203; - triangleTopPos = 48; - removeTop = 75; - } else if (sElement === "#btnCreateMatter") { - if (bSecurityGroupError) { - errorBoxTop = -8; - errorBoxHeight = 71; - sMsg = oSecurityGroupError[0]; - } - removeTop = 76; - removeLeft = 94; - triangleTopPos = 49; - } else if (sElement === "#txtMatterName") { - if (bSecurityGroupError) { - sMsg = oSecurityGroupError[0]; - } - } else { - removeLeft = 100; - } - } else { - iTopPos = iTopPos - 50; - if (sElement === "#txtMatterId") { - removeTop = 76; - removeLeft = 145; - } else if (sElement === "#txtMatterDesc") { - triangleTopPos = 48; - removeTop = 75; - removeLeft = 305; - errorBoxHeight = 62; - errorBoxTop = 0; - } else if (sElement === "#btnLookup") { - removeLeft = 94; - } else if (sElement === ".chkConflictCheckParent") { - triangleTopPos = 48; - removeLeft = 287; - } else if (sElement === "#txtBlockUser") { - triangleTopPos = 47; - removeTop = 74; - removeLeft = 285; - } else if (sElement === "#ddlRoleAssign1") { - removeLeft = 152; - removeTop = 76; - triangleTopPos = 48; - errorBoxLeft = 33; - } else if (sElement === "#btnCreateMatter") { - if (bSecurityGroupError) { - errorBoxTop = -9; - errorBoxHeight = 71; - posLeft = -3; - errorBoxLeft = -31; - sMsg = oSecurityGroupError[0]; - } - removeLeft = 90; - removeTop = 77; - triangleTopPos = 48; - } else if (sElement === "#txtMatterName") { - removeLeft = 305; - if (bSecurityGroupError) { - sMsg = oSecurityGroupError[0]; - } - } else { - removeLeft = 305; - } - } - oJQueryObjects.$ErrorPopUp.css("left", iLeftPos - removeLeft).css("top", iTopPos - removeTop).removeClass("hide").find(".errText").text(sMsg); - $(".mainArea .errTriangleBorder").css("left", posLeft); - $(".mainArea .errTriangle").css("left", posLeft); - $(".mainArea .errTriangle").css("top", "50%").css("top", "+=" + (triangleTopPos) + "px"); - $(".mainArea .errTriangleBorder").css("top", "50%").css("top", "+=" + (triangleTopPos - 1) + "px"); - $(".mainArea .errText").css("min-height", errorBoxHeight + "px").css("top", errorBoxTop + "px").css("left", errorBoxLeft + "px"); - oRoleObject.css("border-width", "2px").css("border-color", "red"); - oJQueryObjects.$Loading.addClass("hide"); - $("#btnCreateMatter").removeAttr("disabled"); - $(".ms-ChoiceField-field").removeClass("disable-checkbox"); - } - } - - /* Function to sort drop downs */ - function sortDropDownListByText() { - // Loop for each select element on the page. - $("select").each(function () { //// Here we sort all the dropdowns present on DOM thus general selector is used - - // Keep track of the selected option. - var selectedValue = $(this).val(); - - // Sort all the options by text. I could easily sort these by val. - $(this).html($("option", $(this)).sort(function (a, b) { - return a.text === b.text ? 0 : a.text < b.text ? -1 : 1; - })); - - // Select one option. - $(this).val(selectedValue); - }); - } - - /* Function to populate pop-up data */ - function populateContentTypes() { - var iCount = 0, iLength = serviceConstants.oTermStoreJson.PGTerms.length, sFolderNames, sPracticeGroupId; - localStorage.removeItem("iSelectedPG"); - localStorage.removeItem("iSelectedAOL"); - - for (iCount = 0; iCount < iLength; iCount++) { - sFolderNames = serviceConstants.oTermStoreJson.PGTerms[iCount].FolderNames ? serviceConstants.oTermStoreJson.PGTerms[iCount].FolderNames : ""; - sPracticeGroupId = serviceConstants.oTermStoreJson.PGTerms[iCount].Id ? serviceConstants.oTermStoreJson.PGTerms[iCount].Id : ""; - oJQueryObjects.$PracticeGroupList.append("
    " + serviceConstants.oTermStoreJson.PGTerms[iCount].TermName + "
    "); - } - $(".popUpOptions").click(function (event) { - var selectedPG = this.innerHTML, $Element = $("#popUpPG"); - $Element.val(selectedPG).attr("data-value", $(this).attr("data-value")).attr("data-foldernamespg", $(this).attr("data-foldernamespg")).attr("data-practicegroup-id", $(this).attr("data-practicegroup-id")); - $("#popUpPGList").addClass("hide"); - }); - - $(".popUpOptions").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - $(".popUpOptions").click(function () { $(".popUpMDTextArea").val(""); }); - $(".popUpOptions").click(function () { - if ($.isEmptyObject(serviceVariables.oTermStoreData)) { - serviceVariables.oTermStoreData = oMatterProvisionObject.getTermStoreData(); - } - var oAOL = $(".popUpMD"), sFolderNames, sAreaOfLawId; - $(".popUpMDContent, .popUpSALContent").remove(); - localStorage.iSelectedPG = $(".popUpPG").attr("data-value"); - for (var jIterator = 0; jIterator < serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms.length; jIterator++) { - // Addition of folder names - sFolderNames = serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].FolderNames ? serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].FolderNames : ""; - sAreaOfLawId = serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].Id ? serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].Id : ""; - oAOL.append("
    " + serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].TermName + "
    "); - } - - $(".popUpMD .popUpMDContent:first-child").click(); - }); - - $($(".popUpOptions")[0]).click(); - - oJQueryObjects.$LoadingLookUp.addClass("hide"); - oJQueryObjects.$LookUpButton.removeAttr("disabled"); - sortDropDownListByText(); - } - - /* Functions to change the tabs on menu item click */ - function navigateTab(event) { - oJQueryObjects.$ErrorPopUp.addClass("hide"); - oJQueryObjects.$MenuClick.removeClass("menuTextSelected"); - $(event.target).addClass("menuTextSelected"); - $(".sectionStep").hide(); - serviceConstants.iCurrentPage = parseInt($(event.target).attr("data-section-num"), 10); - $(".header .menuTextGroupHeader").html(oMatterProvisionConstants.Header_Display_Step.replace("{0}", serviceConstants.iCurrentPage).replace("{1}", $(".menu .menuTextGroup .menuText").length)); - localStorage.iLivePage = serviceConstants.iCurrentPage; - $("#" + $(event.target).attr("data-section-name")).show(); - oJQueryObjects.$Loading.addClass("hide"); - if (2 <= serviceConstants.iCurrentPage) { - if (localStorage.getItem("oPageTwoData")) { - var oSavedPageTwoData = JSON.parse(localStorage.getItem("oPageTwoData")); - var isPageLoad = localStorage.getItem("IsPageLoad") && $.parseJSON(localStorage.getItem("IsPageLoad")); - $("#conflictCheck, #assignTeam").removeClass("hide"); - - if (!serviceConstants.oDefaultConfiguration.IsConflictCheck) { - $("#conflictCheck, #assignTeam").addClass("hide"); - $("input[name=rdbConflictCheck][value=False]").click(); - serviceConstants.sConflictScenario = "False"; - } else { - if (isPageLoad) { - $("input[name=rdbConflictCheck][value=True]").click(); - $("#snBlockUser").show(); - serviceConstants.sConflictScenario = "True"; - } - if ("true" === oSavedPageTwoData.ConflictIdent.toLowerCase()) { - $("input[name=rdbConflictCheck][value=True]").click(); - $("#snBlockUser").show(); - serviceConstants.sConflictScenario = "True"; - } else { - $("input[name=rdbConflictCheck][value=False]").click(); - $("#snBlockUser").hide(); - serviceConstants.sConflictScenario = "False"; - } - } - if (isPageLoad) { - $("input[name=rdbSecureMatterCheck][value=True]").click(); - } else if ("False" === oSavedPageTwoData.BoolSecureMatter && $("input[name=rdbSecureMatterCheck][value=False]")) { - $("input[name=rdbSecureMatterCheck][value=False]").click(); - } else { - $("input[name=rdbSecureMatterCheck][value=True]").click(); - } - var oSendMailObject = $("#demo-checkbox-unselected2"); - if (oSendMailObject.length) { - var bSendMailCheck = localStorage.getItem("oSendMailCheckbox") && $.parseJSON(localStorage.getItem("oSendMailCheckbox")); - oSendMailObject[0].checked = bSendMailCheck; - if (bSendMailCheck) { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Notify_Button_Text); - } else { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Button_Text); - } - } - - var oCalenderObject = $("#demo-checkbox-unselected0"); - if (oCalenderObject.length) { - oCalenderObject[0].checked = localStorage.getItem("oCalenderCheckbox") && $.parseJSON(localStorage.getItem("oCalenderCheckbox")); - } - - var oRSSFeedObject = $("#demo-checkbox-unselected1"); - if (oRSSFeedObject.length) { - oRSSFeedObject[0].checked = localStorage.getItem("oRSSFeedCheckbox") && $.parseJSON(localStorage.getItem("oRSSFeedCheckbox")); - } - - var oTaskObject = $("#demo-checkbox-unselected3"); - if (oTaskObject.length && "undefined" !== localStorage.getItem("oTaskCheckbox")) { - oTaskObject[0].checked = localStorage.getItem("oTaskCheckbox") && $.parseJSON(localStorage.getItem("oTaskCheckbox")); - } - } - } - localStorage.setItem("IsPageLoad", false); - } - - - function onMenuTextClick(e) { - if (serviceConstants.isValidClient) { - serviceConstants.iPageClicked = parseInt($(e.target).attr("data-section-num"), 10); - if (2 <= serviceConstants.iPageClicked) { - serviceConstants.isNextClicked = true; - } else { - serviceConstants.isNextClicked = false; - } - sortDropDownListByText(); - /* Perform validation */ - if (null !== serviceConstants.bValidMatterName) { - serviceConstants.isNextClicked = false; - var bIsValid = false; - if (serviceConstants.iCurrentPage >= parseInt($(e.target).attr("data-section-num"), 10)) { - bIsValid = true; - } else { - bIsValid = commonFunctions.validateCurrentPage(serviceConstants.iCurrentPage); - } - if (serviceConstants.bValidMatterName) { - if (bIsValid) { - /* Maintain state of App */ - commonFunctions.maintainAppState(serviceConstants.iCurrentPage); - if (2 === serviceConstants.iCurrentPage && 2 < parseInt($(e.target).attr("data-section-num"), 10)) { - oJQueryObjects.$ConflictIdentified = $("input[name=rdbConflictCheck]:checked"); - var sConflictIdentified = (oJQueryObjects.$ConflictIdentified.length) ? oJQueryObjects.$ConflictIdentified.val() : ""; - commonFunctions.checkSecurityGroupExists(e); - } else { - navigateTab(e); - } - } - } else { - showErrorNotification("#txtMatterName", oMatterProvisionConstants.Error_Duplicate_Matter); - } - } - } - } - - /* Function to show/hide block user on conflict identified option click */ - function onConflictIdentifiedChange(e) { - var sValue = serviceConstants.sConflictScenario = $(e.target).val(), $BlockUser = $("#snBlockUser"); - if ("True" === sValue) { - $BlockUser.show(); - $(".matterCheckYes").prop("checked", true); - $("input[name=rdbSecureMatterCheck]").attr("disabled", true); - } else { - $BlockUser.hide(); - oJQueryObjects.$BlockedUsers.val("").removeAttr("data-resolved"); - $("input[name=rdbSecureMatterCheck]").removeAttr("disabled"); - } - var oSavedPageTwoData = JSON.parse(localStorage.getItem("oPageTwoData")); - oSavedPageTwoData.ConflictIdent = sValue; - localStorage.setItem("oPageTwoData", JSON.stringify(oSavedPageTwoData)); - } - - /* Function to display Look up pop up */ - function showPopup() { - $(".popupContainerBackground, .popUpContainer").removeClass("hide"); - oJQueryObjects.$ContentTypes = $("#documentTemplates > .docTemplateItem"); - oJQueryObjects.$PracticeGroup[0] ? oJQueryObjects.$PracticeGroup[0].selectedIndex = 0 : null; - $(".popUpPG")[0].selectedIndex = 0; - $(".popUpPG").change(); - - /* Display selected items in pop-up */ - var oPopUpDT = $(".popDT"); - if (oJQueryObjects.$ContentTypes[0]) { - oPopUpDT.append(oJQueryObjects.$ContentTypes.clone().removeClass("docTemplateItem").addClass("popUpDTContent")); - } - if ($(".popUpDTContent").length && !($(".popUpDTContent").hasClass("popUpSelected"))) { - setDefaultContentTypeSelectionMessage(); - } else { - removeDefaultContentTypeSelectionMessage(); - } - - } - - /* Function for search by typing on LookUp Pop up */ - function searchByTyping(sSelector, textValue) { - var oDivContent = $(sSelector); - if (oDivContent[0]) { - oDivContent.show(); - if (textValue) { - $.each(oDivContent, function () { - if (-1 === $(this).text().toLowerCase().indexOf(textValue.toLowerCase())) { - $(this).hide(); - } - }); - } - oDivContent[0].click(); - } - } - - /* Function to check valid matter name */ - function checkValidMatterName() { - var bInValid = false - , RegularExpression = new RegExp(oMatterProvisionConstants.Special_Character_Expression_Matter_Title) - , sCurrMatterName = oJQueryObjects.$MatterName.val().trim(); - if (null !== sCurrMatterName && "" !== sCurrMatterName) { - var arrValidMatch = sCurrMatterName.match(RegularExpression); - if (null === arrValidMatch || arrValidMatch[0] !== sCurrMatterName) { - bInValid = false; - } else { - bInValid = true; - } - } - if (bInValid) { - if ("1" === $(".menuText.menuTextSelected").attr("data-section-num") && serviceConstants.isValidClient) { // Check if only on Step 1 - serviceConstants.bValidMatterName = null; - var isInvalidToken = oCommonObject.getParameterByName(oGlobalConstants.TokenRequestFailedQueryString) - , sMatterName = oJQueryObjects.$MatterName.val().trim() - , sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "matter": { - "Name": sMatterName, - "MatterGuid": localStorage.getItem("matterGuid") ? localStorage.getItem("matterGuid") : serviceConstants.matterGUID - }, "hasErrorOccurred": (isInvalidToken) ? true : false - }; - if (sMatterName && sClientUrl) { - oJQueryObjects.$Loading.removeClass("hide"); - oCommonObject.callProvisioningService("CheckMatterExists", matterDetails, commonFunctions.matterNameExistsSuccess, commonFunctions.matterNameExistsFailure); - } else { - serviceConstants.bValidMatterName = true; - } - } - } else { - serviceConstants.bValidMatterName = true; // This is specifically added to fix issue with Matter name with special characters error message - } - } - - /* Function to check if user has entered valid list of blocked users */ - function isValidBlockUser() { - var arrBlockUserList = oCommonObject.getUserName(oJQueryObjects.$BlockedUsers.val().trim(), false); - for (var iIterator = 0; iIterator < arrBlockUserList.length - 1; iIterator++) { - if (-1 === $.inArray(arrBlockUserList[iIterator].trim(), oCommonObject.oSiteUser)) { - return false; - } - } - return true; - } - - /* Function to retrieve the list of folders for the specific matter */ - function retrieveFolderStructure() { - "use strict"; - var oPageOneData = JSON.parse(localStorage.oPageOneData), nCount = 0, nLength, arrContentTypes, arrFolderStructure = []; - if (oPageOneData && oPageOneData.ContentTypes) { - arrContentTypes = oPageOneData.ContentTypes; - nLength = arrContentTypes.length; - for (nCount = 0; nCount < nLength; nCount++) { - if (arrContentTypes[nCount].DataDocumentTemplate === localStorage.setDefaultContentType || 0 === nCount) { - // Check if the isNoFolderStructurePresent flag is set to true - if (arrContentTypes[nCount].DataisNoFolderStructurePresent && "false" === arrContentTypes[nCount].DataisNoFolderStructurePresent.toLowerCase()) { - // If the folder at the specific level is not present then move to the parent level - arrFolderStructure = arrContentTypes[nCount].DataFolderNamesSAL && "" !== arrContentTypes[nCount].DataFolderNamesSAL ? arrContentTypes[nCount].DataFolderNamesSAL.split(";") : arrContentTypes[nCount].DataFolderNamesAOL && "" !== arrContentTypes[nCount].DataFolderNamesAOL ? arrContentTypes[nCount].DataFolderNamesAOL.split(";") : arrContentTypes[nCount].DataFolderNamesPG && "" !== arrContentTypes[nCount].DataFolderNamesPG ? arrContentTypes[nCount].DataFolderNamesPG.split(";") : []; - } - } - - } - } - return arrFolderStructure; - } - - /* Function to handle any error scenario while provisioning a matter */ - commonFunctions.handleErrorScenarios = function (result, sValidationmessage) { - $(".ms-ChoiceField-field").removeClass("disable-checkbox"); - serviceConstants.bErrorOccured = true; - $(".notificationContainer .notification .closeNotification").click(); - oJQueryObjects.$Loading.addClass("hide"); - oJQueryObjects.$LookUpButton.removeAttr("disabled"); - oJQueryObjects.$CreateButton.removeAttr("disabled"); - if (result.code && "string" === typeof result.code && (-1 < result.code.indexOf("#|#"))) { - var arrErrorPopUpData = result.code.split("#|#") - , iErrorCode = (arrErrorPopUpData[0] && arrErrorPopUpData[0].trim()) ? arrErrorPopUpData[0] : "NA"; - if (oGlobalConstants.TokenRequestFailedErrorCode === iErrorCode) { - reauthenticateUser(); - } else { - showNotification(".notificationContainer", oMatterProvisionConstants.Error_Provisioning_Process.replace("{0}", iErrorCode), "failureBanner"); - } - } else { - showErrorNotification("#btnCreateMatter", sValidationmessage + result.value); - } - }; - - // #region Service Calls - - /* Functions for checking if matter name exists */ - commonFunctions.matterNameExistsSuccess = function (result) { - serviceConstants.isValidClient = true; - if (result) { - var arrResults = JSON.parse(result); - if (arrResults && parseInt(arrResults.code, 10)) { - if ("string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#txtMatterName", arrResults.value); - } - serviceConstants.bValidMatterName = false; - } else { - serviceConstants.bValidMatterName = true; - if (serviceConstants.isNextClicked) { - oJQueryObjects.$MenuClick[serviceConstants.iPageClicked - 1].click(); - } - } - } - oJQueryObjects.$Loading.addClass("hide"); - }; - commonFunctions.matterNameExistsFailure = function (result) { - return false; - }; - - /* Functions for creating matter */ - commonFunctions.createMatterSuccess = function (result) { - result = JSON.parse(result); - //// Remove the data from Local Storage as the Matter Library is created in SharePoint - $(".notificationContainer .notification .closeNotification").click(); - if (!result.code) { - showNotification(".notificationContainer", oMatterProvisionConstants.Success_Matter_Step_2, "successBanner"); - commonFunctions.createdMatterUrl = result.value; - commonFunctions.associateContentTypes(); - commonFunctions.assignPermission(); - commonFunctions.createMatterLandingPage(); - } else { - !(serviceConstants.bErrorOccured) && commonFunctions.handleErrorScenarios(result, oMatterProvisionConstants.Error_Create_Matter); - } - }; - commonFunctions.createMatterFailure = function (result) { - return false; - }; - commonFunctions.createMatter = function () { - //// Do the offline check here - var sClientId = oJQueryObjects.$ClientId.val() - , sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , sClientName = (oJQueryObjects.$ClientName.length) ? $(oJQueryObjects.$ClientName).val() : "" - , matterId = oJQueryObjects.$MatterId.val() - , matterName = oJQueryObjects.$MatterName.val().trim() - , matterDesc = oJQueryObjects.$MatterDescription.val().trim() - , conflictCheckBy = oCommonObject.getUserName(oJQueryObjects.$ConflictConductedBy.val().trim(), false)[0] - , conflictCheckOn = oJQueryObjects.$ConflictCheckDate.val() - , ConflictIdentified = oJQueryObjects.$ConflictIdentified.val() - , blockUserNames = "" - , boolSecureMatter = oJQueryObjects.$BoolSecureMatter - , arrUserNames = [] - , arrUserEmails = [] - , arrPermissions = [] - , arrRoles = [] - , arrFolderNames = [] - , matterDetails = {} - , oDocumentTemplates = $(".docTemplateItem") - , userId = []; - serviceConstants.isErrorOccurred = false; - serviceConstants.iShowSuccessMessage = 0; - serviceConstants.iCallsComplete = 0; - ////Store the PGList, AOLList and SAOLList - serviceConstants.sPracticeGroupList = ""; - serviceConstants.sAreaOfLawList = ""; - serviceConstants.sSubAreaOfLawList = ""; - $.each(oDocumentTemplates, function () { - if (-1 === serviceConstants.sPracticeGroupList.indexOf($(this).attr("data-practicegroup"))) { - serviceConstants.sPracticeGroupList = $(this).attr("data-practicegroup") + "; " + serviceConstants.sPracticeGroupList; - } - if (-1 === serviceConstants.sAreaOfLawList.indexOf($(this).attr("data-areaoflaw"))) { - serviceConstants.sAreaOfLawList = $(this).attr("data-areaoflaw") + "; " + serviceConstants.sAreaOfLawList; - } - if (-1 === serviceConstants.sSubAreaOfLawList.indexOf($(this).attr("data-document-template"))) { - serviceConstants.sSubAreaOfLawList = $(this).attr("data-document-template") + "; " + serviceConstants.sSubAreaOfLawList; - } - }); - - if ("True" === ConflictIdentified) { - blockUserNames = oCommonObject.getUserName(oJQueryObjects.$BlockedUsers.val().trim(), false); - } - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - arrUserEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - userId.push(this.id); - }); - $.each($("input[id^=ddlRoleAssign]"), function () { - arrRoles.push($(this).val()); - }); - $.each($("input[id^=ddlPermAssign]"), function (iPosition) { - arrPermissions.push($.trim($(this).val())); - if ($.trim($(this).val()).toLowerCase() === oGlobalConstants.User_Upload_Permissions.toLowerCase()) { - var iCurrentCount = $(this).attr("id") && $(this).attr("id").split("ddlPermAssign"); - if (1 < iCurrentCount.length) { - serviceConstants.arrReadOnlyUsers.push(trimEndChar(oCommonObject.getUserName($("input[id^=txtAssign" + iCurrentCount[1] + "]").val().trim(), false).join(";"), ";")); - } - } - }); - var isCalenderSelected = $("#demo-checkbox-unselected0")[0].checked; - var isTaskSelected = $("#demo-checkbox-unselected3")[0].checked; - - matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl, "Id": sClientId, "Name": sClientName - }, "matter": { - "Name": matterName, "Id": matterId, "Description": matterDesc, "Conflict": { "Identified": ConflictIdentified, "CheckBy": conflictCheckBy, "CheckOn": conflictCheckOn, "SecureMatter": boolSecureMatter }, "BlockUserNames": blockUserNames, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "Roles": arrRoles, "MatterGuid": serviceConstants.matterGUID - }, "matterConfigurations": { - "IsConflictCheck": serviceConstants.oDefaultConfiguration.IsConflictCheck, "IsMatterDescriptionMandatory": serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory, "IsCalendarSelected": isCalenderSelected, "IsTaskSelected": isTaskSelected - }, - "userId": userId, "hasErrorOccurred": false - }; - - /* Validate both pages */ - var bValidPage = commonFunctions.validateCurrentPage(2); - if (bValidPage) { - bValidPage = commonFunctions.validateCurrentPage(1); - if (bValidPage) { - $(".notificationContainer .notification .closeNotification").click(); - showNotification(".notificationContainer", oMatterProvisionConstants.Success_Matter_Step_1, "successBanner"); - // Addition of the Folder Structure - arrFolderNames = retrieveFolderStructure(); - matterDetails.matter.FolderNames = arrFolderNames; - localStorage.setItem("matterGuid", serviceConstants.matterGUID); //// Store the matter GUID in case an error while provisioning, will be used to delete matter landing page - oCommonObject.callProvisioningService("CreateMatter", matterDetails, commonFunctions.createMatterSuccess, commonFunctions.createMatterFailure); - } else { - $(".menuText")[0].click(); - $("#btnCreateMatter, #btnLookup").removeAttr("disabled"); - } - } else { - $(".menuText")[1].click(); - $("#btnCreateMatter, #btnLookup").removeAttr("disabled"); - } - /* Validate both pages */ - }; - - /* Functions for retrieving clients */ - commonFunctions.getClientSuccess = function (result) { - oJQueryObjects.$ClientList.html("
    - Select a client -
    "); - var arrResults = JSON.parse(result), clientItem, clientOption, iCount = 0, iLength, arrOptions = []; - if (!arrResults.code) { - serviceConstants.arrClients = JSON.parse(JSON.stringify(arrResults)); - iLength = serviceConstants.arrClients.ClientTerms.length; - for (iCount = 0; iCount < iLength; iCount++) { - clientOption = "
    " + serviceConstants.arrClients.ClientTerms[iCount].Name + "
    "; - arrOptions.push(clientOption); - } - oJQueryObjects.$ClientList.append(arrOptions.join("")); - $($(oJQueryObjects.$ClientList[0]).find(".ddlClientListItem")).attr("data-client-id"); - - $(".ddlClientListItem").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlClient"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-client-id", $(this).attr("data-client-id")); - $("#ddlClientList").addClass("hide"); - $(".ddlClientListItem").removeClass("ddListOnHover"); - commonFunctions.getDefaultValues(this); - }); - - $(".ddlClientListItem").mouseover(function () { - $(".ddlClientListItem").removeClass("ddListOnHover"); - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - $(".ddlClientListItem").click(commonFunctions.onClientChange); - $("#ddlClient").val($($(".ddlClientListItem")[0]).text()); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#txtMatterId", arrResults.value); - } - } - serviceConstants.bClient = true; - oJQueryObjects.$Loading.addClass("hide"); - oJQueryObjects.$ClientList.removeAttr("disabled"); - }; - commonFunctions.getClientFailure = function (result) { - return false; - }; - commonFunctions.getClient = function () { - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "details": { - "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Client_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Client_Custom_Properties_Url - } - }; - oJQueryObjects.$ClientName.attr("disabled", "disabled"); - oCommonObject.callProvisioningService("GetTaxonomyData", matterDetails, commonFunctions.getClientSuccess, commonFunctions.getClientFailure); - }; - - commonFunctions.getDefaultValuesSuccess = function (result) { - serviceConstants.oDefaultConfiguration = []; - $(".popupWait, .loadingImage").addClass("hide"); - var arrResults = JSON.parse(result.split("|$|")[0]); // result[1] contain item modified date which is used to handle concurrency issue on settings page - if (!arrResults.code) { - $.each(arrResults, function (key, value) { - serviceConstants.oDefaultConfiguration[key] = value; - }); - $("#txtMatterName")[0].value = serviceConstants.oDefaultConfiguration.DefaultMatterName ? serviceConstants.oDefaultConfiguration.DefaultMatterName : ""; - checkValidMatterName(); - $("#txtMatterId")[0].value = serviceConstants.oDefaultConfiguration.DefaultMatterId ? serviceConstants.oDefaultConfiguration.DefaultMatterId : ""; - if (serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory) { - $(".description").show(); - } else { - $(".description").hide(); - } - $("#txtMatterDesc").empty().focus().blur(); - $(".assignNewPerm").remove(); - if (serviceConstants.oDefaultConfiguration.MatterUsers) { - var arrUsers = serviceConstants.oDefaultConfiguration.MatterUsers.split("$|$") - , arrRoles = serviceConstants.oDefaultConfiguration.MatterRoles.split("$|$") - , arrUserEmails = [] - , arrPermissions = serviceConstants.oDefaultConfiguration.MatterPermissions.split("$|$") - , count = 1 - , iCounter - , iCount - , sEmail = ""; - if (serviceConstants.oDefaultConfiguration.MatterUserEmails && "" !== serviceConstants.oDefaultConfiguration.MatterUserEmails) { - arrUserEmails = serviceConstants.oDefaultConfiguration.MatterUserEmails.split("$|$"); - } - - - count = 1; - for (iCounter = 0; iCounter < arrUsers.length; iCounter++) { - commonFunctions.addMorePermissions(count); - var userName = "#txtAssign" + count, permissions = "#ddlPermAssign" + count; - //// Get value from default configuration and set it in text box. i.e. UserName(user email address) - if (arrUsers && 0 < arrUsers.length && arrUsers[iCounter]) { - var arrAllUsers = arrUsers[iCounter].split(";"); - if (arrUserEmails && 0 < arrUserEmails.length && arrUserEmails[iCounter]) { - var arrAllUserEmails = arrUserEmails[iCounter].split(";"); - for (iCount = 0; iCount < arrAllUsers.length; iCount++) { - if (arrAllUsers[iCount] && "" !== arrAllUsers[iCount].trim()) { - sEmail = arrAllUserEmails[iCount]; - if (serviceConstants.oEmailRegex.test(sEmail)) { - $(userName)[0].value += (trimEndChar(arrAllUsers[iCount], ";") + " (" + arrAllUserEmails[iCount] + ");"); - } else { - $(userName)[0].value += (trimEndChar(arrAllUsers[iCount], ";") + ";"); - } - } - } - - } else { - for (iCount = 0; iCount < arrAllUsers.length; iCount++) { - if (arrAllUsers[iCount] && "" !== arrAllUsers[iCount].trim()) { - $(userName).val(trimEndChar(arrAllUsers[iCount], ";") + ";"); - } - } - } - } else { - $(userName).val(""); - } - $(permissions).val(arrPermissions[iCounter]).attr("data-value", arrPermissions[iCounter]); - oCommonObject.bindAutocomplete(userName, true); - count++; - } - if (serviceConstants.oDefaultConfiguration.MatterRoles) { - count = 1; - $.each(arrPermissions, function (key, value) { - var permissions = "#ddlPermAssign" + count; - count++; - $(permissions).val(value).attr("data-value", value); - }); - } - if (serviceConstants.oDefaultConfiguration.MatterPermissions) { - count = 1; - $.each(arrRoles, function (key, value) { - var roles = "#ddlRoleAssign" + count; - count++; - if (-1 === $.inArray(value, serviceConstants.oMandatoryRoleNames)) { - $(roles).val($.trim(value)).attr("data-value", $.trim(value)).attr("data-mandatory", "false"); - } else { - $(roles).val($.trim(value)).attr("data-value", $.trim(value)).attr("data-mandatory", "true"); - } - }); - } - } else { - commonFunctions.addMorePermissions(1); - } - var arrMatterType = serviceConstants.oDefaultConfiguration.MatterTypes ? serviceConstants.oDefaultConfiguration.MatterTypes.split("$|$") : "" - , arrAreaofLaw = serviceConstants.oDefaultConfiguration.MatterAreaofLaw ? serviceConstants.oDefaultConfiguration.MatterAreaofLaw.split("$|$") : "" - , arrPracticeGroup = serviceConstants.oDefaultConfiguration.MatterPracticeGroup ? serviceConstants.oDefaultConfiguration.MatterPracticeGroup.split("$|$") : "" - , count = 0 - , iCounter = 0; - $("#documentTemplates").empty(); - localStorage.setDefaultContentType = ""; - $.each(arrMatterType, function (key, matterType) { - $.each(serviceConstants.oTermStoreJson.PGTerms, function (key, pgTerms) { - $.each(pgTerms.AreaTerms, function (key, areaTerms) { - $.each(areaTerms.SubareaTerms, function (key, subAreaTerms) { - if ($.trim(subAreaTerms.TermName) === $.trim(matterType) && $.trim(areaTerms.TermName) === $.trim(arrAreaofLaw[iCounter]) && $.trim(pgTerms.TermName) === $.trim(arrPracticeGroup[iCounter])) { - var oContentTypeContainer = $("#documentTemplates"); - var sDataDocumentTemplate = subAreaTerms.DocumentTemplates; - var sDataAssociatedDocumentTemplate = subAreaTerms.DocumentTemplateNames; - var sSelectedPracticeGroup = pgTerms.TermName; - var sSelectedPracticeGroupID = pgTerms.Id; - var sSelectedPracticeGroupFolderStructure = pgTerms.FolderNames; - var sSelectedAreaOfLaw = areaTerms.TermName; - var sSelectedAreaOfLawID = areaTerms.Id; - var sSelectedAreaOfLawFolderStructure = areaTerms.FolderNames; - var sSelectedSubAreaOfLawID = subAreaTerms.Id; - var sSelectedSubAreaOfLawFolderStructure = subAreaTerms.FolderNames; - var sSelectedSubAreaOfLawIsNofolderStructurePresent = subAreaTerms.IsNoFolderStructurePresent; - var iFoldersCount = 0; - if (sDataDocumentTemplate) { - iFoldersCount = sDataAssociatedDocumentTemplate.split(";").length; - } - if ($.trim(subAreaTerms.TermName) === $.trim(serviceConstants.oDefaultConfiguration.DefaultMatterType)) { - oContentTypeContainer.append("
    " + $.trim(matterType) + " (" + iFoldersCount + ")
    "); - localStorage.setDefaultContentType = sDataDocumentTemplate; - } else { - oContentTypeContainer.append("
    " + $.trim(matterType) + " (" + iFoldersCount + ")
    "); - count++; - } - } - }); - }); - }); - iCounter++; - }); - var data; - if (serviceConstants.oDefaultConfiguration.IsRestrictedAccessSelected) { - $("input[name=rdbSecureMatterCheck][value=True]").prop("checked", "checked"); - } else { - $("input[name=rdbSecureMatterCheck][value=False]").prop("checked", "checked"); - } - if (!serviceConstants.oDefaultConfiguration.IsConflictCheck) { - $("#conflictCheck, #assignTeam").addClass("hide"); - $("input[name=rdbConflictCheck][value=False]").prop("checked", "checked"); - serviceConstants.sConflictScenario = "False"; - } else { - $("#conflictCheck, #assignTeam").removeClass("hide"); - $("input[name=rdbConflictCheck][value=True]").prop("checked", "checked"); - $("#snBlockUser").show(); - serviceConstants.sConflictScenario = "True"; - } - if (serviceConstants.oDefaultConfiguration.IsCalendarSelected) { - $("#demo-checkbox-unselected0")[0].checked = true; - } - if (serviceConstants.oDefaultConfiguration.IsRSSSelected) { - $("#demo-checkbox-unselected1")[0].checked = true; - } - if (serviceConstants.oDefaultConfiguration.IsEmailOptionSelected) { - $("#demo-checkbox-unselected2")[0].checked = true; - $("#btnCreateMatter").html(oMatterProvisionConstants.Create_Notify_Button_Text); - } - if (serviceConstants.oDefaultConfiguration.IsTaskSelected) { - $("#demo-checkbox-unselected3")[0].checked = true; - } - localStorage.setItem("IsConflictCheck", serviceConstants.oDefaultConfiguration.IsConflictCheck); - localStorage.setItem("oCalenderCheckbox", serviceConstants.oDefaultConfiguration.IsCalendarSelected); - localStorage.setItem("oRSSFeedCheckbox", serviceConstants.oDefaultConfiguration.IsRSSSelected); - localStorage.setItem("oSendMailCheckbox", serviceConstants.oDefaultConfiguration.IsEmailOptionSelected); - localStorage.setItem("oTaskCheckbox", serviceConstants.oDefaultConfiguration.IsTaskSelected); - commonFunctions.maintainAppState(1); - commonFunctions.maintainAppState(2); - } else { - serviceConstants.bCloseErrorPopup = false; - serviceConstants.isValidClient = false; - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - arrResults.value && showErrorNotification("#ddlClient", arrResults.value); - } - } - }; - commonFunctions.getDefaultValuesFailure = function (result) { - return false; - }; - commonFunctions.getDefaultValues = function (element) { - if ($(element).attr("data-client-id")) { - $(".popupWait, .loadingImage").removeClass("hide"); - $(".loadingImage").css("position", "absolute"); - var sClientUrl = $("#ddlClient").attr("data-value") - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "siteCollectionPath": sClientUrl - }; - oJQueryObjects.$ClientName.attr("disabled", "disabled"); - oCommonObject.callProvisioningService("GetDefaultMatterConfigurations", matterDetails, commonFunctions.getDefaultValuesSuccess, commonFunctions.getDefaultValuesFailure); - } else { - $("#txtMatterName")[0].value = ""; - $("#txtMatterId")[0].value = ""; - $(".description").show(); - $("#documentTemplates").empty(); - $("#txtMatterDesc").empty().focus().blur(); - commonFunctions.maintainAppState(1); - } - }; - - commonFunctions.onClientChange = function () { - serviceConstants.bCloseErrorPopup = true; - serviceConstants.isValidClient = true; - oJQueryObjects.$ClientId.val($(oJQueryObjects.$ClientName).attr("data-client-id")); - }; - - /* Functions for retrieving roles */ - commonFunctions.getRoleSuccess = function (result) { - var $RoleObject = $("#ddlRoleAssignList1"); - $RoleObject.html(""); - var arrResults = JSON.parse(result), roleItem, roleOption, arrOptions = [], iIterator = 0, iLength; - if (!arrResults.code) { - serviceConstants.oMandatoryRoles = arrResults; - serviceConstants.arrRoles = JSON.parse(JSON.stringify(arrResults)); - for (roleItem in arrResults) { - roleOption = "
    " + arrResults[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - iLength = serviceConstants.oMandatoryRoles.length; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - $RoleObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlRoleAssignDiv").click(function (event) { - oJQueryObjects.$ErrorPopUp.addClass("hide"); - $("div input:text , textarea , select").css({ "border": "1px #c8c8c8 solid" }); - var $Element = $RoleObject; - toggleThisElement($Element); - var windowWidth = GetWidth(); - if (windowWidth <= 734) { - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 204); - - } else { - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 70); - } - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $("#ddlRoleAssignList1").addClass("hide"); - $(".assignPerm1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - // Default selection should be Responsible Attorney - $($(".assignPerm1")[0]).click(); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#txtMatterId", arrResults.value); - } - } - serviceConstants.bRole = true; - }; - commonFunctions.getRoleFailure = function (result) { - return false; - }; - commonFunctions.getRole = function () { - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - } - }; - - oCommonObject.callProvisioningService("GetRoleData", matterDetails, commonFunctions.getRoleSuccess, commonFunctions.getRoleFailure); - }; - - /* Functions for retrieving permissions */ - commonFunctions.getPermSuccess = function (result) { - var $PermissionObject = $("#ddlPermAssignList1"); - $PermissionObject.html(""); - var arrResults = JSON.parse(result), permItem, permOption, arrOptions = []; - if (!arrResults.code) { - serviceConstants.arrPermissions = JSON.parse(JSON.stringify(arrResults)); - for (permItem in arrResults) { - permOption = "
    " + arrResults[permItem].Name + "
    "; - arrOptions.push(permOption); - } - $PermissionObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlPermAssignDiv1").click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - - var windowWidth = GetWidth(); - if (windowWidth <= 734) { - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 204); - - } else { - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 70); - } - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $("#ddlPermAssignList1").addClass("hide"); - $(".permContent1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - // Default value should be full control - $($(".permValue")[0]).click(); - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#txtMatterId", arrResults.value); - } - } - serviceConstants.bPermission = true; - }; - commonFunctions.getPermFailure = function (result) { - return false; - }; - commonFunctions.getPerm = function () { - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - } - }; - - oCommonObject.callProvisioningService("GetPermissionLevels", matterDetails, commonFunctions.getPermSuccess, commonFunctions.getpermFailure); - }; - - /* Functions for stamping properties */ - commonFunctions.stampPropertiesSuccess = function (result) { - result = JSON.parse(result); - if (!result.code) { - commonFunctions.clearFields(result); - } else { - !(serviceConstants.bErrorOccured) && commonFunctions.handleErrorScenarios(result, oMatterProvisionConstants.Error_Stamp_Properties); - } - }; - commonFunctions.stampPropertiesFailure = function (result) { - return false; - }; - commonFunctions.stampProperties = function () { - $(".notificationContainer .notification .closeNotification").click(); - showNotification(".notificationContainer", oMatterProvisionConstants.Success_Matter_Step_3, "successBanner"); - var oAssignPermList = $("input[id^=txtAssign]"), iErrorFlag = 0, sResponsibleAttorney = [], sResponsibleAttorneyEmail = [], arrTeamMembers = []; - $.each(oAssignPermList, function () { - var sCurrElementID = $(this).attr("id"); - if (sCurrElementID) { - sCurrElementID = sCurrElementID.trim().split("txtAssign")[1]; - var sCurrRole = $("#ddlRoleAssign" + sCurrElementID), sCurrPermission = $("#txtAssign" + sCurrElementID); - if (sCurrRole && sCurrPermission) { - if (-1 !== $.inArray(sCurrRole.val(), serviceConstants.oMandatoryRoleNames)) { - sResponsibleAttorney.push(oCommonObject.getUserName($.trim($(this).val()), true).join(";")); - sResponsibleAttorneyEmail.push(oCommonObject.getUserName($.trim($(this).val()), false).join(";")); - } - } - } - }); - - var sClientId = oJQueryObjects.$ClientId ? oJQueryObjects.$ClientId.val() : "" - , sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , sClientName = oJQueryObjects.$ClientName ? $(oJQueryObjects.$ClientName).val() : "" - , matterId = oJQueryObjects.$MatterId ? oJQueryObjects.$MatterId.val() : "" - , matterName = oJQueryObjects.$MatterName ? oJQueryObjects.$MatterName.val().trim() : "" - , matterDesc = oJQueryObjects.$MatterDescription ? oJQueryObjects.$MatterDescription.val().trim() : "" - , conflictCheckBy = oJQueryObjects.$ConflictConductedBy ? oCommonObject.getUserName(oJQueryObjects.$ConflictConductedBy.val().trim(), false)[0] : "" - , conflictCheckOn = oJQueryObjects.$ConflictCheckDate ? oJQueryObjects.$ConflictCheckDate.val() : "" - , ConflictIdentified = oJQueryObjects.$ConflictIdentified ? oJQueryObjects.$ConflictIdentified.val() : "" - , boolSecureMatter = oJQueryObjects.$BoolSecureMatter - , arrUserNames = [] - , arrUserEmails = [] - , matterDetails = {} - , arrRoles = [] - , arrPermissions = [] - , oDocumentTemplates = $(".docTemplateItem") - , arrBlockUserNames = "" - , sBlockedUserNames = oJQueryObjects.$BlockedUsers.val() - , defaultContentType = "" - , contentTypes = [] - , arrDocumentTemplatesCount = [] - , roleInformation = {} - , subAreaofLaw = "" - , oMatterProvisionFlags = { - }; - - // getting the value of SAOL from data-display-name attribute - $.each(oDocumentTemplates, function () { - if (-1 === subAreaofLaw.indexOf($(this).attr("data-display-name"))) { - subAreaofLaw += $(this).attr("data-display-name") + "; "; - if (($(this).hasClass("popUpSelected"))) { - defaultContentType = $(this).attr("data-display-name"); - } - } - }); - - $.each(oAssignPermList, function () { - var sCurrElementID = $(this).attr("id"); - if (sCurrElementID) { - sCurrElementID = sCurrElementID.trim().split("txtAssign")[1]; - var sCurrRole = $("#ddlRoleAssign" + sCurrElementID), sCurrPermission = $("#txtAssign" + sCurrElementID); - if (sCurrRole && sCurrPermission) { - if (roleInformation.hasOwnProperty(sCurrRole.val())) { - // This role is already present. append the new role with semicolon separated value - roleInformation[sCurrRole.val()] = roleInformation[sCurrRole.val()] + sCurrPermission.val(); - } else { - // Add this role to the object - roleInformation[sCurrRole.val()] = sCurrPermission.val(); - } - - } - } - }); - - $.each(roleInformation, function (key, item) { - roleInformation[key] = trimEndChar(item.trim(), ";"); - }); - - $.each($("input[id^=ddlRoleAssign]"), function () { - arrRoles.push($(this).val()); - }); - - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - arrUserEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - arrTeamMembers.push(oCommonObject.getUserName($.trim($(this).val()), true).join(";")); - }); - - $.each($("input[id^=ddlPermAssign]"), function () { - arrPermissions.push($(this).val()); - }); - - if ("True" === ConflictIdentified) { - if (sBlockedUserNames && "" !== sBlockedUserNames && oJQueryObjects.$BlockedUsers.length) { - arrBlockUserNames = oCommonObject.getUserName(oJQueryObjects.$BlockedUsers.val().trim(), false); - } - } - contentTypes = subAreaofLaw.trim().split(";"); - - $(".docTemplateItem").each(function (iCurrentIndex, oCurrentObject) { - arrDocumentTemplatesCount.push($(oCurrentObject).attr("data-associated-document-template").split(";").length.toString()); - }); - arrDocumentTemplatesCount.reverse(); - - - oMatterProvisionFlags = { - "MatterLandingFlag": serviceConstants.bMatterLandingPage, - "SendEmailFlag": null - }; - - - if ($("#demo-checkbox-unselected2")[0].checked) { - oMatterProvisionFlags.SendEmailFlag = true; - } else { - oMatterProvisionFlags.SendEmailFlag = false; - } - - matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl, "Id": sClientId, "Name": sClientName - }, "matter": { - "Name": matterName, "Id": matterId, "Description": matterDesc, "Conflict": { "Identified": ConflictIdentified, "CheckBy": conflictCheckBy, "CheckOn": conflictCheckOn, "SecureMatter": boolSecureMatter }, "BlockUserNames": arrBlockUserNames, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "ContentTypes": contentTypes, "DefaultContentType": defaultContentType, "Permissions": arrPermissions, "Roles": arrRoles, "DocumentTemplateCount": arrDocumentTemplatesCount, "MatterGuid": serviceConstants.matterGUID - }, "matterDetails": { - "PracticeGroup": serviceConstants.sPracticeGroupList, "AreaOfLaw": serviceConstants.sAreaOfLawList, "SubareaOfLaw": trimEndChar(subAreaofLaw, ";"), "ResponsibleAttorney": sResponsibleAttorney.join(";").replace(/;;/g, ";"), "ResponsibleAttorneyEmail": sResponsibleAttorneyEmail.join(";").replace(/;;/g, ";"), "UploadBlockedUsers": serviceConstants.arrReadOnlyUsers, "TeamMembers": arrTeamMembers.join(";"), "RoleInformation": JSON.stringify(roleInformation) - }, "matterProvisionChecks": oMatterProvisionFlags, "matterConfigurations": { - "IsConflictCheck": serviceConstants.oDefaultConfiguration.IsConflictCheck, "IsMatterDescriptionMandatory": serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory - } - }; - oCommonObject.callProvisioningService("UpdateMetadataForList", matterDetails, commonFunctions.stampPropertiesSuccess, commonFunctions.stampPropertiesFailure); - - }; - - /* Functions for associating content types to matter */ - commonFunctions.associateContentTypesSuccess = function (result) { - serviceConstants.iCallsComplete++; - result = JSON.parse(result.replace(new RegExp("\r", "g"), "\\r").replace(new RegExp("\n", "g"), "\\n")); - if (!result.code) { - if (result.value && "string" === typeof result.value && "false" === result.value) { - serviceConstants.bViewCreationFailed = true; - } - serviceConstants.iShowSuccessMessage++; - (3 === parseInt(serviceConstants.iShowSuccessMessage, 10)) ? commonFunctions.stampProperties() : ""; - } else { - serviceConstants.isErrorOccurred = true; - !(serviceConstants.bErrorOccured) && commonFunctions.handleErrorScenarios(result, oMatterProvisionConstants.Error_Associate_Content_Type); - } - (3 === parseInt(serviceConstants.iCallsComplete, 10) && serviceConstants.isErrorOccurred) && commonFunctions.deleteMatterLandingPage(); - }; - commonFunctions.associateContentTypesFailure = function (result) { - return false; - }; - commonFunctions.associateContentTypes = function () { - var sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , matterName = oJQueryObjects.$MatterName.val().trim() - , matterId = oJQueryObjects.$MatterId.val() - , clientId = oJQueryObjects.$ClientId.val() - , clientName = oJQueryObjects.$ClientName[0] ? $(oJQueryObjects.$ClientName).val() : "" - , contentTypes = [], matterDetails = {}, defaultContentType; - var $Element = $("#documentTemplates .docTemplateItem.popUpSelected"); - var sPracticeGroupName = $Element.attr("data-practicegroup") - , sPracticeGroupId = $Element.attr("data-practicegroup-id") - , sAreaOfLawName = $Element.attr("data-areaoflaw") - , sAreaOfLawId = $Element.attr("data-areaoflaw-id") - , sSubareaOfLawName = $Element.attr("data-display-name") - , sSubareaOfLawId = $Element.attr("data-subareaoflaw-id"); - oJQueryObjects.$ContentTypes.each(function () { - var currDocumentTemplate = $(this).attr("data-document-template"); - if (-1 === $.inArray(currDocumentTemplate, contentTypes)) { - contentTypes.push($.trim(currDocumentTemplate)); - } - var arrAssociatedDocumentTemplates = $(this).attr("data-associated-document-template").split(";"); - for (var iIterator = 0; iIterator < arrAssociatedDocumentTemplates.length; iIterator++) { - if (-1 === $.inArray(arrAssociatedDocumentTemplates[iIterator], contentTypes)) { - contentTypes.push($.trim(arrAssociatedDocumentTemplates[iIterator])); - } - } - }); - defaultContentType = localStorage.setDefaultContentType; - - matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, - "matterMetadata": { - "Matter": { - "Name": matterName, - "Id": matterId, - "ContentTypes": contentTypes, - "DefaultContentType": defaultContentType, - "MatterGuid": serviceConstants.matterGUID - }, "Client": { - "Url": sClientUrl, - "Name": clientName, - "Id": clientId - }, "PracticeGroupTerm": { - "TermName": sPracticeGroupName, - "Id": sPracticeGroupId - }, "AreaTerm": { - "TermName": sAreaOfLawName, - "Id": sAreaOfLawId - }, "SubareaTerm": { - "TermName": sSubareaOfLawName, - "Id": sSubareaOfLawId - } - } - }; - - oCommonObject.callProvisioningService("AssignContentType", matterDetails, commonFunctions.associateContentTypesSuccess, commonFunctions.associateContentTypesFailure); - }; - - /* Functions for fetching content types */ - commonFunctions.fetchContentTypesSuccess = function (result) { - serviceConstants.bContentType = true; - serviceConstants.oTermStoreJson = JSON.parse(result); - if (!serviceConstants.oTermStoreJson.code) { - populateContentTypes(); - } else { - if (serviceConstants.oTermStoreJson.code && "string" === typeof serviceConstants.oTermStoreJson.code && (-1 < serviceConstants.oTermStoreJson.code.indexOf("#|#"))) { - showCommonErrorPopUp(serviceConstants.oTermStoreJson.code); - } else { - showErrorNotification("#txtMatterId", serviceConstants.oTermStoreJson.value); - } - } - }; - commonFunctions.fetchContentTypesFailure = function (result) { - return false; - }; - commonFunctions.fetchContentTypes = function () { - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "details": { - "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Practice_Group_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Practice_Group_Custom_Properties, "DocumentTemplatesName": oGlobalConstants.Sub_Area_Of_Law_Document_Templates - } - }; - oJQueryObjects.$LoadingLookUp.removeClass("hide"); - oCommonObject.callProvisioningService("GetTaxonomyData", matterDetails, commonFunctions.fetchContentTypesSuccess, commonFunctions.fetchContentTypesFailure); - }; - - - /* Functions for fetching content types */ - commonFunctions.assignPermissionSuccess = function (result) { - serviceConstants.iCallsComplete++; - result = JSON.parse(result); - if (!result.code) { - serviceConstants.iShowSuccessMessage++; - (3 === parseInt(serviceConstants.iShowSuccessMessage, 10)) ? commonFunctions.stampProperties() : ""; - } else { - serviceConstants.isErrorOccurred = true; - !(serviceConstants.bErrorOccured) && commonFunctions.handleErrorScenarios(result, oMatterProvisionConstants.Error_Assign_Permission); - } - (3 === parseInt(serviceConstants.iCallsComplete, 10) && serviceConstants.isErrorOccurred) && commonFunctions.deleteMatterLandingPage(); - }; - commonFunctions.assignPermissionFailure = function (result) { - return false; - }; - commonFunctions.assignPermission = function () { - var sClientUrl = oJQueryObjects.$ClientName.attr("data-value"), matterName = oJQueryObjects.$MatterName.val().trim(), arrUserNames = [], arrUserEmails = [], arrPermissions = [], matterDetails; - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - arrUserEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - }); - $.each($("input[id^=ddlPermAssign]"), function () { - arrPermissions.push($.trim($(this).val())); - }); - var isCalenderSelected = $("#demo-checkbox-unselected0")[0].checked; - var isTaskSelected = $("#demo-checkbox-unselected3")[0].checked; - matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "matter": { - "Name": matterName, "Permissions": arrPermissions, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "MatterGuid": serviceConstants.matterGUID - }, "matterConfigurations": { - "IsCalendarSelected": isCalenderSelected, - "IsTaskSelected": isTaskSelected - }, - }; - - oCommonObject.callProvisioningService("AssignUserPermissions", matterDetails, commonFunctions.assignPermissionSuccess, commonFunctions.assignPermissionFailure); - }; - - /* Functions for creating matter landing page */ - commonFunctions.createMatterLandingPageSuccess = function (result) { - serviceConstants.iCallsComplete++; - result = JSON.parse(result); - if (!result.code) { - serviceConstants.iShowSuccessMessage++; - (3 === parseInt(serviceConstants.iShowSuccessMessage, 10)) ? commonFunctions.stampProperties() : ""; - } else { - serviceConstants.isErrorOccurred = true; - serviceConstants.bMatterLandingPage = false; - !(serviceConstants.bErrorOccured) && commonFunctions.handleErrorScenarios(result, oMatterProvisionConstants.Error_Matter_Landing_Page_Creation); - } - (3 === parseInt(serviceConstants.iCallsComplete, 10) && serviceConstants.isErrorOccurred) && commonFunctions.deleteMatterLandingPage(); - }; - commonFunctions.createMatterLandingPageFailure = function (result) { - return false; - }; - commonFunctions.createMatterLandingPage = function () { - var sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , matterName = (oJQueryObjects.$MatterName.length) ? oJQueryObjects.$MatterName.val().trim() : "" - , arrBlockUserNames = "" - , sBlockedUserNames = (oJQueryObjects.$BlockedUsers.length) ? oJQueryObjects.$BlockedUsers.val() : "" - , ConflictIdentified = (oJQueryObjects.$ConflictIdentified.length) ? oJQueryObjects.$ConflictIdentified.val() : "" - , arrUserNames = [] - , arrUserEmails = [] - , conflictCheckBy = oCommonObject.getUserName(oJQueryObjects.$ConflictConductedBy.val().trim(), false)[0] - , conflictCheckOn = oJQueryObjects.$ConflictCheckDate.val() - , boolSecureMatter = oJQueryObjects.$BoolSecureMatter - , matterDesc = oJQueryObjects.$MatterDescription.val().trim() - , matterDetails = {} - , arrPermissions = []; - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - arrUserEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - }); - if ("True" === ConflictIdentified) { - if (sBlockedUserNames && "" !== sBlockedUserNames && oJQueryObjects.$BlockedUsers.length) { - arrBlockUserNames = oCommonObject.getUserName(oJQueryObjects.$BlockedUsers.val().trim(), false); - } - } - $.each($("input[id^=ddlPermAssign]"), function () { - arrPermissions.push($.trim($(this).val())); - }); - var isCalendarSelected, isRSSFeedSelected, isTaskSelected; - if ($("#demo-checkbox-unselected0")[0].checked) { - isCalendarSelected = true; - } else { - isCalendarSelected = false; - } - if ($("#demo-checkbox-unselected1")[0].checked) { - isRSSFeedSelected = true; - } else { - isRSSFeedSelected = false; - } - - if ($("#demo-checkbox-unselected3")[0].checked) { - isTaskSelected = true; - } else { - isTaskSelected = false; - } - - matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "matter": { - "Name": matterName, "Description": matterDesc, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "BlockUserNames": arrBlockUserNames, "Conflict": { "Identified": ConflictIdentified, "CheckBy": conflictCheckBy, "CheckOn": conflictCheckOn, "SecureMatter": boolSecureMatter }, "Permissions": arrPermissions, "MatterGuid": serviceConstants.matterGUID - }, "matterConfigurations": { - "IsConflictCheck": serviceConstants.oDefaultConfiguration.IsConflictCheck, "IsMatterDescriptionMandatory": serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory, "IsCalendarSelected": isCalendarSelected, "IsRSSSelected": isRSSFeedSelected, "IsTaskSelected": isTaskSelected - } - }; - - oCommonObject.callProvisioningService("CreateMatterLandingPage", matterDetails, commonFunctions.createMatterLandingPageSuccess, commonFunctions.createMatterLandingPageFailure); - }; - - /* Functions for checking if security group exists in team members list*/ - commonFunctions.checkSecurityGroupExistsSuccess = function (result) { - $(".popupWait, .loadingImage").addClass("hide"); - var event = result.oParam.currentEvent && result.oParam.currentEvent.target ? result.oParam.currentEvent : ""; - var oResult = JSON.parse(result.Result), controlId; - if (!oResult.code) { - navigateTab(event); - } else { - var sValidationResult = oResult.value; - var oValidationDetails = sValidationResult.split("$|$"), sSecurityGroupRow, sSecurityGroupError; - if (2 === oValidationDetails.length) { - sSecurityGroupError = oValidationDetails[0]; - sSecurityGroupRow = oValidationDetails[1]; - } - if ("-1" === sSecurityGroupRow) { - controlId = "#txtBlockUser"; - } else if ("-2" === sSecurityGroupRow) { - controlId = "#" + $(".inputAssignPerm")[0].id; - } else { - controlId = "#" + sSecurityGroupRow; - } - showErrorNotification(controlId, sSecurityGroupError); - - } - }; - commonFunctions.checkSecurityGroupExistsFailure = function (result) { - return false; - }; - commonFunctions.checkSecurityGroupExists = function (event) { - $(".popupWait, .loadingImage").removeClass("hide"); - $(".loadingImage").css("position", "absolute"); - oJQueryObjects.$ConflictIdentified = $("input[name=rdbConflictCheck]:checked"); - oJQueryObjects.$BlockedUsers = $("#txtBlockUser"); - var sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , sConflictIdentified = (oJQueryObjects.$ConflictIdentified.length) ? oJQueryObjects.$ConflictIdentified.val() : "" - , sBlockedUserNames = (oJQueryObjects.$BlockedUsers.length) ? oJQueryObjects.$BlockedUsers.val() : "" - , matterName = (oJQueryObjects.$MatterName.length) ? oJQueryObjects.$MatterName.val().trim() : "" - , arrUserNames = [] - , arrUserEmails = [] - , arrBlockUserNames = [] - , oSecurityGroupCheck = {} - , userId = [] - , oParam = { - }; - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - arrUserEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - userId.push(this.id); - }); - if ("True" === sConflictIdentified) { - if (sBlockedUserNames && "" !== sBlockedUserNames && oJQueryObjects.$BlockedUsers.length) { - arrBlockUserNames = oCommonObject.getUserName(oJQueryObjects.$BlockedUsers.val().trim(), false); - } - } - oParam = { - "currentEvent": event - }; - oSecurityGroupCheck = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "matter": { - "Name": matterName, "AssignUserNames": arrUserNames, "AssignUserEmails": arrUserEmails, "Conflict": { "Identified": sConflictIdentified }, "BlockUserNames": arrBlockUserNames - }, - "userId": userId - }; - oCommonObject.callProvisioningService("CheckSecurityGroupExists", oSecurityGroupCheck, commonFunctions.checkSecurityGroupExistsSuccess, commonFunctions.checkSecurityGroupExistsFailure, null, oParam); - }; - - /* Functions to delete matter landing page if error occurs */ - commonFunctions.deleteMatterLandingPage = function () { - var sMatterName = oJQueryObjects.$MatterName.val().trim() - , sClientUrl = oJQueryObjects.$ClientName.attr("data-value") - , matterDetails = { - "requestObject": { - "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken - }, "client": { - "Url": sClientUrl - }, "matter": { - "Name": sMatterName, - "MatterGuid": serviceConstants.matterGUID - }, "hasErrorOccurred": true - }; - if (sMatterName && sClientUrl) { - oCommonObject.callProvisioningService("CheckMatterExists", matterDetails, commonFunctions.deleteMatterLandingPageSuccess, commonFunctions.deleteMatterLandingPageFailure); - } - }; - - commonFunctions.deleteMatterLandingPageSuccess = function (result) { - return false; - }; - commonFunctions.deleteMatterLandingPageFailure = function (result) { - return false; - }; - - // #endregion - - /* Function to validate the entries in Blocked user field */ - function validateBlockUsers() { - var validity = true, culprit = "", arrBlockedUsers = oJQueryObjects.$BlockedUsers.val().trim().split(";"); - if (!oJQueryObjects.$BlockedUsers.val().trim()) { - return true; - } - $.each(arrBlockedUsers, function (iIndex) { - if (arrBlockedUsers[iIndex]) { - $.each($("input[id^=txtAssign]"), function () { - if (-1 !== $(this).val().trim().indexOf(arrBlockedUsers[iIndex].trim())) { - validity = false; - culprit = $(this).attr("id"); - return false; - } - }); - if (!validity) { - return false; - } - } - }); - if (validity) { - validity = true; - } - if (!validity && culprit) { - showErrorNotification("#" + culprit, oMatterProvisionConstants.Error_Invalid_User); - } - return validity; - } - - /* Function to validate Assigned Permissions */ - function validateAssignedPerm() { - "use strict"; - var oAssignPermList = $("input[id^=txtAssign]"), iErrorFlag = 0; - //// Here we have a list of ID's of Assign Permissions which are currently present in Step 2 - $.each(oAssignPermList, function (iIterator) { - var iCurrId = $(this).attr("id").trim().split("txtAssign")[1], iCurrUser = $("#txtAssign" + iCurrId), oCurrRoleItem = $("#ddlRoleAssign" + iCurrId); - if (!$.trim(iCurrUser.val())) { - iErrorFlag = 1; - showErrorNotification(iCurrUser, oGlobalConstants.Edit_Matter_Validate_User.replace("{0}", oCurrRoleItem.val())); - return false; - } - }); - if (1 === iErrorFlag) { - return false; - } - return true; - } - - /* Function to check person who is conducting conflict check is not in block user */ - function validateConflictUser() { - var arrBlockedUsers = oJQueryObjects.$BlockedUsers.val().trim().split(";") - , sConflictCheckUser = oCommonObject.getUserName(oJQueryObjects.$ConflictConductedBy.val().trim(), false)[0] - , bConflict = false; - $.each(arrBlockedUsers, function (iIndex) { - if (sConflictCheckUser === arrBlockedUsers[iIndex].trim()) { - bConflict = true; - return false; - } - }); - return (!bConflict); - } - - /* Function to validate Team Assignment line items */ - function validateTeamAssigmentRole() { - var oAssignList = $("input[id^=ddlRoleAssign]") - , iExpectedCount = 0, iActualCount = 0, iIterator = 0, iLength = serviceConstants.oMandatoryRoles.length; - serviceConstants.oMandatoryRoleNames.length = 0; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - iExpectedCount++; - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - $.each(oAssignList, function () { - if ($(this)[0]) { - if ("true" === $($(this)[0]).attr("data-mandatory")) { - iActualCount++; - } - } - }); - if (iExpectedCount <= iActualCount) { - return true; - } - return false; - } - - /* Function to validate Permission */ - function validatePermission() { - "use strict"; - var oPermissionList = $("input[id^=ddlPermAssign]"), bIsFullControl = false; - $.each(oPermissionList, function (oPermissionList, oPermissionListItem) { - if (oPermissionListItem) { - if (oMatterProvisionConstants.Edit_Matter_Mandatory_Permission_Level === $(oPermissionListItem).attr("data-value")) { - bIsFullControl = true; - } - } - }); - return bIsFullControl; - } - - /* Function to resize error pop for responsive UI */ - function resizeErrorPopup() { - "use strict"; - closeAllPopupExcept(""); - var windowWidth = GetWidth(); - var width; - $(".ui-autocomplete").hide(); - - if (windowWidth <= 734) { - $(".mainArea .errTriangleBorder").css("left", "210px"); - $(".mainArea .errTriangle").css("left", "210px"); - } - } - - /* Function to get the screen width */ - function GetWidth() { - "use strict"; - var x = 0; - if (self.innerHeight) { - x = self.innerWidth; - } else if (document.documentElement && document.documentElement.clientHeight) { - x = document.documentElement.clientWidth; - } else if (document.body) { - x = document.body.clientWidth; - } - return x; - } - - /* Function to toggle element */ - function toggleThisElement($Element) { - if ($Element.is(":visible")) { - $Element.addClass("hide"); - } else { - $Element.removeClass("hide"); - } - } - - /* Function to check if all the users entered in the list are valid User names */ - function isValidUserList(sUserList) { - var arrUserList = oCommonObject.getUserName(sUserList.trim(), false), bFlag = true; //// This will return an array with last element as "". - //// You have all the users in oCommonObject.oSiteUser JSON object and you have users entered by user in arrUserList - //// Check if each user in arrUserList is a part of oCommonObject.oSiteUser array. If at least one of it is not there return false flag - if (!arrUserList) { - return false; - } - $.each(arrUserList, function (iIterator) { - var sCurrentUser = arrUserList[iIterator] && arrUserList[iIterator].trim(); - sCurrentUser = trimEndChar(sCurrentUser, ";"); - if (sCurrentUser && -1 === $.inArray(sCurrentUser, oCommonObject.oSiteUser)) { - bFlag = false; - } - if (!bFlag) { - return; - } - }); - return bFlag; - } - - /* Function to perform validation */ - commonFunctions.validateCurrentPage = function (iCurrentPage) { - var bInValid = false - , RegularExpression = new RegExp(oMatterProvisionConstants.Special_Character_Expression_Matter_Title) - , sCurrMatterName = oJQueryObjects.$MatterName.val().trim() - , arrValidMatch = sCurrMatterName.match(RegularExpression) - , iIterator = 1; - switch (iCurrentPage) { - case 1: - if (oJQueryObjects.$ClientName.attr("data-value").length && oJQueryObjects.$ClientName.attr("data-client-id").length) { - if (oJQueryObjects.$MatterName.length && oJQueryObjects.$MatterName[0].validity.valid) { - if (null === arrValidMatch || arrValidMatch[0] !== sCurrMatterName) { - bInValid = false; - $("#txtMatterName").css("border-width", "2px").css("border-color", "red"); - } else { - bInValid = true; - $("#txtMatterName").css("border-width", "1px").css("border-color", "#c8c8c8"); - } - if (bInValid) { - /* Re-factored code */ - RegularExpression = new RegExp(oMatterProvisionConstants.Special_Character_Expression_Matter_Id); - if (oJQueryObjects.$MatterId.length && oJQueryObjects.$MatterId[0].validity.valid) { - arrValidMatch = oJQueryObjects.$MatterId.val().match(RegularExpression); - if (!arrValidMatch || arrValidMatch[0] !== oJQueryObjects.$MatterId.val()) { - bInValid = false; - $("#txtMatterId").css("border-width", "2px").css("border-color", "red"); - } else { - bInValid = true; - $("#txtMatterId").css("border-width", "1px").css("border-color", "#c8c8c8"); - } - if (bInValid) { - oJQueryObjects.$ContentTypes = $("#documentTemplates > .docTemplateItem"); - if (oJQueryObjects.$ContentTypes.length) { - if (localStorage.setDefaultContentType.length) { - RegularExpression = new RegExp(oMatterProvisionConstants.Special_Character_Expression_Matter_Description); - if (oJQueryObjects.$MatterDescription.length && oJQueryObjects.$MatterDescription[0].validity.valid && "" !== $.trim(oJQueryObjects.$MatterDescription.val())) { - arrValidMatch = oJQueryObjects.$MatterDescription.val().trim().match(RegularExpression); - if (!arrValidMatch || arrValidMatch[0] !== $.trim(oJQueryObjects.$MatterDescription.val())) { - bInValid = false; - $("#txtMatterDesc").css("border-width", "2px").css("border-color", "red"); - } else { - bInValid = true; - $("#txtMatterDesc").css("border-width", "1px").css("border-color", "#c8c8c8"); - } - if (bInValid) { - return true; - } else { - showErrorNotification("#txtMatterDesc", oMatterProvisionConstants.Error_Special_Character); - } - } else { - if (serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory) { - showErrorNotification("#txtMatterDesc", oMatterProvisionConstants.Error_Matter_Description); - } else { - return true; - } - } - } else { - showErrorNotification("#btnLookup", oMatterProvisionConstants.Error_Default_Matter_Type); - } - } else { - showErrorNotification("#btnLookup", oMatterProvisionConstants.Error_Select_Content_Type); - } - } else { - showErrorNotification("#txtMatterId", oMatterProvisionConstants.Error_Special_Character); - } - } else { - showErrorNotification("#txtMatterId", oMatterProvisionConstants.Error_Matter_ID); - } - /* Refactored code */ - } else { - showErrorNotification("#txtMatterName", oMatterProvisionConstants.Error_Valid_Matter_Name); - } - } else { - showErrorNotification("#txtMatterName", oMatterProvisionConstants.Error_Matter_Title); - } - } else { - showErrorNotification("#ddlClient", oMatterProvisionConstants.Error_Select_Client); - } - oJQueryObjects.$Loading.addClass("hide"); - break; - case 2: - oJQueryObjects.$ConflictIdentified = $("input[name=rdbConflictCheck]:checked"); - if (serviceConstants.oDefaultConfiguration.IsConflictCheck) { - if ($("#chkConflictCheck:checked").length) { - if (oJQueryObjects.$ConflictConductedBy.length && oJQueryObjects.$ConflictConductedBy[0].validity.valid && (oJQueryObjects.$ConflictConductedBy.attr("data-resolved") || isValidUserList(oJQueryObjects.$ConflictConductedBy.val()))) { - if (oJQueryObjects.$ConflictCheckDate.length && !oJQueryObjects.$ConflictCheckDate[0].validity.valueMissing) { - if (oJQueryObjects.$ConflictCheckDate.length && !oJQueryObjects.$ConflictCheckDate[0].validity.patternMismatch) { - if (oJQueryObjects.$ConflictCheckDate.length && oJQueryObjects.$ConflictCheckDate[0].validity.valid) { - if ((oJQueryObjects.$ConflictIdentified.length && "False" === oJQueryObjects.$ConflictIdentified.val()) || - (oJQueryObjects.$ConflictIdentified.length && "True" === oJQueryObjects.$ConflictIdentified.val() && (oJQueryObjects.$BlockedUsers.attr("data-resolved") || isValidUserList(oJQueryObjects.$BlockedUsers.val())))) { - //// validate if person who conducted conflict cannot be in block user - if (validateConflictUser()) { - //// validate for each Assign permission entry - if (validateAssignedPerm()) { - if (validateTeamAssigmentRole()) { - if (validatePermission()) { - if (validateBlockUsers()) { - if (isValidBlockUser()) { - return true; - } else { - showErrorNotification("#txtBlockUser", oMatterProvisionConstants.Error_Valid_Block_Users); - } - } - } else { - showErrorNotification("#" + $(".assignPermission")[0].id, oMatterProvisionConstants.Error_Edit_Matter_Mandatory_Permission); - } - } else { - showErrorNotification("#" + $(".assignRole")[0].id, oMatterProvisionConstants.Error_Mandatory_Role.replace("{0}", serviceConstants.oMandatoryRoleNames.join(","))); - serviceConstants.oMandatoryRoleNames.length = 0; - } - } - } else { - showErrorNotification("#txtBlockUser", oMatterProvisionConstants.Error_Conflict_Check_User); - } - } else { - showErrorNotification("#txtBlockUser", oMatterProvisionConstants.Error_Blocked_Users); - } - } else { - showErrorNotification("#txtConflictCheckDate", oMatterProvisionConstants.Error_Select_Date); - } - } else { - showErrorNotification("#txtConflictCheckDate", oMatterProvisionConstants.Error_Valid_Date); - } - } else { - showErrorNotification("#txtConflictCheckDate", oMatterProvisionConstants.Error_Select_Date); - } - } else { - showErrorNotification("#txtConflictCheckBy", oMatterProvisionConstants.Error_Conflict_Reviewer_User); - } - } else { - showErrorNotification(".chkConflictCheckParent", oMatterProvisionConstants.Error_Conflict_Exists); - } - } else { - if (validateAssignedPerm()) { - if (validateTeamAssigmentRole()) { - if (validatePermission()) { - return true; - } else { - showErrorNotification("#" + $(".assignPermission")[0].id, oMatterProvisionConstants.Error_Edit_Matter_Mandatory_Permission); - } - } else { - showErrorNotification("#" + $(".assignRole")[0].id, oMatterProvisionConstants.Error_Mandatory_Role.replace("{0}", serviceConstants.oMandatoryRoleNames.join(","))); - serviceConstants.oMandatoryRoleNames.length = 0; - } - } - } - oJQueryObjects.$Loading.addClass("hide"); - return false; - default: - serviceConstants.oMandatoryRoleNames.length = 0; - return true; - } - }; - - /* Function to clear all the fields once matter is created */ - commonFunctions.clearFields = function (result) { - var sClientId = (oJQueryObjects.$ClientId.length) ? oJQueryObjects.$ClientId.val() : "", - sClientName = (oJQueryObjects.$ClientName.length) ? $(oJQueryObjects.$ClientName).val() : "", - sMatterId = (oJQueryObjects.$MatterId.length) ? oJQueryObjects.$MatterId.val() : "", - sMatterName = (oJQueryObjects.$MatterName.length) ? oJQueryObjects.$MatterName.val().trim() : "", - sClientUrl = (oJQueryObjects.$ClientName.length) ? oJQueryObjects.$ClientName.attr("data-value") : ""; - - serviceConstants.iShowSuccessMessage = 0; - // #region Clear Page 1 fields - $($(".ddlClientListItem")[0]).click(); - oJQueryObjects.$ClientId.val(""); - oJQueryObjects.$MatterName.val(""); - oJQueryObjects.$MatterId.val(""); - oJQueryObjects.$MatterDescription.val(""); - oJQueryObjects.$ConflictConductedBy.val("").removeAttr("data-resolved"); - oJQueryObjects.$ConflictCheckDate.val(""); - oJQueryObjects.$BlockedUsers.val("").removeAttr("data-resolved"); - oJQueryObjects.$ContentTypes.remove(); - $($(".popUpOptions")[0]).click(); - //// #endregion - // #region Clear Page 2 fields - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - oJQueryObjects.$AssignPermissions.remove(); - commonFunctions.addMorePermissions(1); - oJQueryObjects.$AssignPermissions.find("input[id^=txtAssign]").val("").removeAttr("data-resolved"); - oJQueryObjects.$AssignPermissions.find("select[id^=ddlRoleAssign]").val(serviceConstants.oMandatoryRoleNames[0]); - $(".permContent1[data-value='Full Control']").click(); - $(".assignPerm1[data-value='Responsible Attorney']").click(); - oJQueryObjects.$AssignPermissions.find("select[id^=ddlPermAssign]").val("Full Control"); - oJQueryObjects.$ConflictCheckConducted.click(); - oJQueryObjects.$SwitchApp = $(".switchApp"); - $("input[name=rdbConflictCheck][value=True]").click(); //// Default Conflict Check to Yes - $("input[name=rdbSecureMatterCheck][value=True]").click(); //// Default Pessimistic security Check to Yes - localStorage.iLivePage = 1; - oJQueryObjects.$Loading.addClass("hide"); - $(".notificationContainer .notification .closeNotification").click(); - //// #endregion - // #region Clear Local Storage data - localStorage.removeItem("oPageOneData"); - localStorage.removeItem("oPageTwoData"); - localStorage.removeItem("setDefaultContentType"); - localStorage.removeItem("IsConflictCheck"); - localStorage.removeItem("oCalenderCheckbox"); - localStorage.removeItem("oRSSFeedCheckbox"); - localStorage.removeItem("oSendMailCheckbox"); - localStorage.removeItem("oTaskCheckbox"); - - // #endregion - //// Click first menu tab - oJQueryObjects.$LookUpButton.removeAttr("disabled"); - oJQueryObjects.$CreateButton.removeAttr("disabled"); - $(".ms-ChoiceField-field").removeClass("disable-checkbox"); - $("#demo-checkbox-unselected0")[0].checked = false; - $("#demo-checkbox-unselected1")[0].checked = false; - $("#demo-checkbox-unselected2")[0].checked = false; - if ($("#demo-checkbox-unselected2")[0].checked) { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Notify_Button_Text); - } else { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Button_Text); - } - var sSuccessMessage = commonFunctions.createdMatterUrl; - if (serviceConstants.bMatterLandingPage) { - sSuccessMessage += "/" + oGlobalConstants.Matter_Landing_Page_Repository + "/" + serviceConstants.matterGUID + ".aspx"; - } - if (serviceConstants.bViewCreationFailed) { - var sCreateViewFailureMessage = oMatterProvisionConstants.Success_Matter_Creation + " " + oMatterProvisionConstants.Create_View_Failure; - showNotification(".notificationContainer", sCreateViewFailureMessage.replace("{0}", sSuccessMessage), "warningBanner"); - } - if (result.value && "false" === result.value) { - var sShareMatterFailureMessage = oMatterProvisionConstants.Success_Matter_Creation + " " + oMatterProvisionConstants.Share_Matter_Failure; - showNotification(".notificationContainer", sShareMatterFailureMessage.replace("{0}", sSuccessMessage), "warningBanner"); //// display final success message - } else { - !(serviceConstants.bViewCreationFailed) && showNotification(".notificationContainer", oMatterProvisionConstants.Success_Matter_Creation.replace("{0}", sSuccessMessage), "successBanner"); //// display final success message - } - result && $(oJQueryObjects.$MenuClick[0]).click(); - getMatterGUID(); //// Create new GUID for next matter library - localStorage.setItem("matterGuid", serviceConstants.matterGUID); //// Store the matter GUID in case an error while provisioning, will be used to delete matter landing page - }; - /* Function to save current state of the page */ - commonFunctions.maintainAppState = function (iCurrentPage) { - var oPageOneState = { - ClientValue: [], - ClientId: "", - MatterTitle: "", - MatterId: "", - MatterDescription: "", - ContentTypes: [], - matterMandatory: "" - }, - oPageTwoState = { - BlockedSiteUsers: [], - ConfCheckCond: "", - ConfCheckCondBy: { - }, - CheckPerfOn: "", - ConflictIdent: "", - BlockUsers: { - }, - BoolSecureMatter: "", - AssignPermission: [] - }; - oJQueryObjects.$ContentTypes = $("#documentTemplates > .docTemplateItem"); - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - oJQueryObjects.$BlockedUsers = $("#txtBlockUser"); - switch (iCurrentPage) { - case 1: - ////store Page 1 data on click of step 2 - oPageOneState.ClientValue.push({ ClientName: oJQueryObjects.$ClientName.val(), value: oJQueryObjects.$ClientName.attr("data-value"), ClientId: oJQueryObjects.$ClientName.attr("data-client-id") }); - oPageOneState.ClientId = oJQueryObjects.$ClientId.val(); - oPageOneState.MatterTitle = oJQueryObjects.$MatterName.val().trim(); - oPageOneState.MatterId = oJQueryObjects.$MatterId.val(); - oPageOneState.MatterDescription = oJQueryObjects.$MatterDescription.val().trim(); - $.each(oJQueryObjects.$ContentTypes, function () { - oPageOneState.ContentTypes.push({ DataValue: $(this).attr("data-value"), DataDocumentTemplate: $(this).attr("data-document-template"), DataAssociatedDocumentTemplate: $(this).attr("data-associated-document-template"), DocumentTemplateText: $(this).text(), DataPracticeGroup: $(this).attr("data-practicegroup"), DataAreaOfLaw: $(this).attr("data-areaoflaw"), DataFolderNamesPG: $(this).attr("data-folderNamesPG"), DataFolderNamesAOL: $(this).attr("data-folderNamesAOL"), DataFolderNamesSAL: $(this).attr("data-folderNamesSAL"), DataisNoFolderStructurePresent: $(this).attr("data-isNoFolderStructurePresent"), DataDisplayName: $(this).attr("data-display-name"), DataPracticeGroupId: $(this).attr("data-practicegroup-id"), DataAreaOfLawId: $(this).attr("data-areaoflaw-id"), DataSubAreaOfLawId: $(this).attr("data-subareaoflaw-id") }); - }); - oPageOneState.matterMandatory = serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory; - localStorage.setItem("oPageOneData", JSON.stringify(oPageOneState)); - break; - case 2: - ////store Page 2 data on click of step 3 - oPageTwoState.ConfCheckCond = $("input[id=chkConflictCheck]:checked").length; - oPageTwoState.ConfCheckCondBy.Text = oJQueryObjects.$ConflictConductedBy.val(); - oPageTwoState.ConfCheckCondBy.DataResolved = oJQueryObjects.$ConflictConductedBy.attr("data-resolved") ? true : false; //// store true if 1 - oPageTwoState.CheckPerfOn = oJQueryObjects.$ConflictCheckDate.val(); - oPageTwoState.ConflictIdent = $("input[name=rdbConflictCheck]:checked").val(); //// bind this on click - oPageTwoState.BlockUsers.Text = oJQueryObjects.$BlockedUsers.val().trim(); - oPageTwoState.BlockUsers.DataResolved = oJQueryObjects.$BlockedUsers.attr("data-resolved") ? true : false; //// store true if 1 - oPageTwoState.BlockedSiteUsers = oCommonObject.oSiteUser; - if ($("input[name=rdbSecureMatterCheck]:checked")) { - oJQueryObjects.$BoolSecureMatter = $("input[name=rdbSecureMatterCheck]:checked").val(); - } - oPageTwoState.BoolSecureMatter = oJQueryObjects.$BoolSecureMatter; - $.each(oJQueryObjects.$AssignPermissions, function () { - oPageTwoState.AssignPermission.push({ NameList: $(this).find("input[id^=txtAssign]").val(), DataResolved: $(this).find("input[id^=txtAssign]").attr("data-resolved") ? true : false, Role: $(this).find("input[id^=ddlRoleAssign]").val(), Permission: $(this).find("input[id^=ddlPermAssign]").val() }); - }); - localStorage.setItem("oPageTwoData", JSON.stringify(oPageTwoState)); - break; - } - }; - - /* Function to add more team assignment line items */ - commonFunctions.addMorePermissions = function (iAssignPermCount) { - var iNextAssignPermContent = parseInt(iAssignPermCount, 10); - // For setting proper class name suffix - - if (1 === iNextAssignPermContent) { - serviceConstants.iLastRowNumber = iAssignPermCount; - } else { - iNextAssignPermContent = serviceConstants.iLastRowNumber; - } - var permItem, permOption, roleItem, roleOption, arrOptions = [] - // On click of Add more link, this chunk will be displayed - , sAssignPermContent = "
    " - + "" - + "
    " - - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - - + "
    " - + "
    " - + "delete" - + "
    " - + "
    "; - $("#addNewAssignPerm").before(sAssignPermContent); - - for (roleItem in serviceConstants.arrRoles) { - roleOption = "
    " + serviceConstants.arrRoles[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - var $RoleObject = $("#ddlRoleAssignList" + iNextAssignPermContent + ""); - $RoleObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlRoleAssignDiv" + iNextAssignPermContent + "").click(function (event) { - closeAllPopupExcept(""); - var $Element = $RoleObject; - toggleThisElement($Element); - var windowWidth = GetWidth(); - if (windowWidth <= 734) { - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 204); - - } else { - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 70); - } - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm" + iNextAssignPermContent + "").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign" + iNextAssignPermContent + ""); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $RoleObject.addClass("hide"); - $(".assignPerm" + iNextAssignPermContent + "").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".assignPerm" + iNextAssignPermContent + "")[0]).click(); - - arrOptions = []; - for (permItem in serviceConstants.arrPermissions) { - permOption = "
    " + serviceConstants.arrPermissions[permItem].Name + "
    "; - arrOptions.push(permOption); - } - var $PermissionObject = $("#ddlPermAssignList" + iNextAssignPermContent + ""); - $PermissionObject.append(arrOptions.join("")); - - // This function will display drop-down menu - $(".ddlPermAssignDiv" + iNextAssignPermContent + "").click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - var windowWidth = GetWidth(); - if (windowWidth <= 734) { - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 204); - - } else { - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 70); - } - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent" + iNextAssignPermContent + "").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign" + iNextAssignPermContent + ""); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $PermissionObject.addClass("hide"); - $(".permContent" + iNextAssignPermContent + "").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".permContent" + iNextAssignPermContent + "")[0]).click(); - - oCommonObject.bindAutocomplete("#txtAssign" + iNextAssignPermContent, true); - sortDropDownListByText(); - serviceConstants.iLastRowNumber++; - }; - - /* Function to load app state */ - commonFunctions.loadAppStateData = function (iCurrPage) { - //// Load Page 1 data - if (localStorage.getItem("oPageOneData")) { - var oSavedPageOneData = JSON.parse(localStorage.getItem("oPageOneData")) - , oContentTypeContainer = $("#documentTemplates") - , iContent = 0, oSavedPageTwoData, iCount = 0, iNextPerm, iAssignPermLength; - oJQueryObjects.$ClientName.val(oSavedPageOneData.ClientValue[0].ClientName).attr("data-value", oSavedPageOneData.ClientValue[0].value).attr("data-client-id", oSavedPageOneData.ClientValue[0].ClientId); - oJQueryObjects.$ClientId.val(oSavedPageOneData.ClientId); - oJQueryObjects.$MatterName.val(oSavedPageOneData.MatterTitle); - checkValidMatterName(); - oJQueryObjects.$MatterId.val(oSavedPageOneData.MatterId); - oJQueryObjects.$MatterDescription.val(oSavedPageOneData.MatterDescription); - for (iContent = 0; iContent < oSavedPageOneData.ContentTypes.length; iContent++) { - if (oSavedPageOneData.ContentTypes[iContent].DataDocumentTemplate === localStorage.setDefaultContentType) { - oContentTypeContainer.append("
    " + oSavedPageOneData.ContentTypes[iContent].DocumentTemplateText + "
    "); - } else { - oContentTypeContainer.append("
    " + oSavedPageOneData.ContentTypes[iContent].DocumentTemplateText + "
    "); - } - } - serviceConstants.oDefaultConfiguration.IsMatterDescriptionMandatory = oSavedPageOneData.matterMandatory; - if (oSavedPageOneData.matterMandatory) { - $(".description").show(); - } else { - $(".description").hide(); - } - if (localStorage.getItem("IsConflictCheck")) { - serviceConstants.oDefaultConfiguration.IsConflictCheck = JSON.parse(localStorage.getItem("IsConflictCheck")); - if (!serviceConstants.oDefaultConfiguration.IsConflictCheck) { - $("#conflictCheck, #assignTeam").addClass("hide"); - $("input[name=rdbConflictCheck][value=False]").prop("checked", "checked"); - serviceConstants.sConflictScenario = "True"; - } else { - $("#conflictCheck, #assignTeam").removeClass("hide"); - $("input[name=rdbConflictCheck][value=True]").prop("checked", "checked"); - $("#snBlockUser").show(); - serviceConstants.sConflictScenario = "False"; - } - } - if (localStorage.getItem("oPageTwoData")) { - oSavedPageTwoData = JSON.parse(localStorage.getItem("oPageTwoData")); - //// Load Page 2 data if iLivePage = 3 - if ("3" === iCurrPage) { - iAssignPermLength = oSavedPageTwoData.AssignPermission.length; - oJQueryObjects.$ConflictCheckConducted.click(); - oJQueryObjects.$ConflictConductedBy.val(oSavedPageTwoData.ConfCheckCondBy.Text); - if (oSavedPageTwoData.ConfCheckCondBy.DataResolved) { - oJQueryObjects.$ConflictConductedBy.attr("data-resolved", "1"); - } - oJQueryObjects.$ConflictCheckDate.val(oSavedPageTwoData.CheckPerfOn); - if ("False" === oSavedPageTwoData.ConflictIdent && $("input[name=rdbConflictCheck][value=False]")) { - $("input[name=rdbConflictCheck][value=False]").click(); - } - oJQueryObjects.$BlockedUsers.val(oSavedPageTwoData.BlockUsers.Text); - if (oSavedPageTwoData.BlockUsers.DataResolved) { - oJQueryObjects.$BlockedUsers.attr("data-resolved", "1"); - } - //// Set oSiteUser from local storage - if (oSavedPageTwoData.BlockedSiteUsers) { - oCommonObject.oSiteUser = oSavedPageTwoData.BlockedSiteUsers; - } - oJQueryObjects.$BoolSecureMatter = oSavedPageTwoData.BoolSecureMatter; - if ("False" === oSavedPageTwoData.BoolSecureMatter && $("input[name=rdbSecureMatterCheck][value=False]")) { - $("input[name=rdbSecureMatterCheck][value=False]").click(); - } - for (iCount = 0; iCount < iAssignPermLength; iCount++) { - iNextPerm = parseInt(iCount, 10) + 1; - if (iCount > 0) { - commonFunctions.addMorePermissions(iNextPerm); - } - $("#txtAssign" + iNextPerm).val(oSavedPageTwoData.AssignPermission[iCount].NameList); - if (oSavedPageTwoData.AssignPermission[iCount].DataResolved) { - $("#txtAssign" + iNextPerm).attr("data-resolved", "1"); - } - $(".assignPerm" + iNextPerm + "").each(function (index) { - if (oSavedPageTwoData.AssignPermission[iCount].Role === $(this).attr("data-value")) { - $(this).click(); - } - }); - $(".permContent" + iNextPerm + "").each(function (index) { - if (oSavedPageTwoData.AssignPermission[iCount].Permission === $(this).attr("data-value")) { - $(this).click(); - } - }); - } - var oSendMailObject = $("#demo-checkbox-unselected2"); - if (oSendMailObject.length) { - var bSendMailCheck = localStorage.getItem("oSendMailCheckbox") && $.parseJSON(localStorage.getItem("oSendMailCheckbox")); - oSendMailObject[0].checked = bSendMailCheck; - if (bSendMailCheck) { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Notify_Button_Text); - } else { - $("#btnCreateMatter").text(oMatterProvisionConstants.Create_Button_Text); - } - } - - var oCalenderObject = $("#demo-checkbox-unselected0"); - if (oCalenderObject.length) { - oCalenderObject[0].checked = localStorage.getItem("oCalenderCheckbox") && $.parseJSON(localStorage.getItem("oCalenderCheckbox")); - } - - var oRSSFeedObject = $("#demo-checkbox-unselected1"); - if (oRSSFeedObject.length) { - oRSSFeedObject[0].checked = localStorage.getItem("oRSSFeedCheckbox") && $.parseJSON(localStorage.getItem("oRSSFeedCheckbox")); - } - - var oTaskObject = $("#demo-checkbox-unselected3"); - if (oTaskObject.length && "undefined" !== localStorage.getItem("oTaskCheckbox")) { - oTaskObject[0].checked = localStorage.getItem("oTaskCheckbox") && $.parseJSON(localStorage.getItem("oTaskCheckbox")); - } - - } - } - ////Click corresponding menu tab - oJQueryObjects.$MenuClick[parseInt(iCurrPage, 10) - 1].click(); - } - }; - - /* Function to change the color of next and previous link in pagination bar */ - function setActivePagination(paginationMove) { - var currentPageNo = paginationMove ? parseInt(serviceConstants.iCurrentPage + 1, 10) : parseInt(serviceConstants.iCurrentPage - 1, 10); - var oPaginate = $(".Paginate"); - if (oPaginate && 0 < currentPageNo && 4 > currentPageNo) { //// If oPaginate object exists and current page if between 1 to 3 - if (1 === currentPageNo) { - oPaginate.first().removeClass("active"); - oPaginate.last().addClass("active"); - } else if (2 === currentPageNo) { - serviceConstants.isNextClicked = true; - oPaginate.addClass("active"); - } else if (3 === currentPageNo) { - oPaginate.first().addClass("active"); - oPaginate.last().removeClass("active"); - } - } - } - - /* Function to remove team assignment row on click of delete image */ - function closePermissionRow(event) { - if (1 < $(".assignNewPerm").length) { - $("." + event.currentTarget.parentElement.className.split(" ")[0]).remove(); - $(".ddlPermAssignList, .ddlRoleAssignList").addClass("hide"); - $(oJQueryObjects.$ErrorPopUp).addClass("hide"); - event.stopPropagation(); - } else { - showErrorNotification(".close", "Assign permission to at least one team member"); - } - } - - /* Function to determine search template pop-up size */ - function popupSize() { - "use strict"; - var iSize = $(window).width(); - iSize *= 0.2; - - } - - /* Function to close all pop up except the passed one */ - function closeAllPopupExcept(divClass) { - "use strict"; - if ("ddlClientList" !== divClass) { - $("#ddlClientList").addClass("hide"); - $(".ddlClientListItem").removeClass("ddListOnHover"); - } - if ("popUpPGList" !== divClass) { - $("#popUpPGList").addClass("hide"); - } - // Hide assign permission role drop-down - $(".ddlRoleAssignList").addClass("hide"); - // Hide Permission level drop-down - $(".ddlPermAssignList").addClass("hide"); - } - - /* Function to perform operations on page load */ - $(document).ready(function () { - /* Set current page to 4 */ - oPageConfig.currentPage = 4; - oCommonObject.sCurrentPage = oGlobalConstants.App_Name_Provision_Matters; - getContextualHelpData(4); - //// Update the validation for HTML fields - $("#txtMatterName").attr("maxlength", oGlobalConstants.Matter_Name_Max_Length); - $("#txtMatterId").attr("maxlength", oGlobalConstants.Matter_Id_Max_Length); - $("#txtMatterDesc").attr("maxlength", oGlobalConstants.Matter_Description_Max_Length); - /* Display the header */ - $(".AppHeader").removeClass("hide"); - $(".matterCheckYes").prop("checked", true); - $("input[name=rdbSecureMatterCheck]").attr("disabled", true); - - $(".ddClientIcon, .ddlClientDiv").click(function (event) { - var $Element = $("#ddlClientList"); - var oSelectedDataValue = $(this).find("input").attr("data-value"); - var oSelectedClientID = $(this).find("input").attr("data-client-id"); - - - toggleThisElement($Element); - - event.stopPropagation(); - }); - - - $(".ddpopUpPGIcon, .popUpPGDiv").click(function (event) { - var $Element = $("#popUpPGList"); - toggleThisElement($Element); - event.stopPropagation(); - }); - - - $("#demo-checkbox-unselected2").click(function () { - var oSendMailCheckbox = $("#demo-checkbox-unselected2")[0], checkChange; - - if ($(oSendMailCheckbox).is(":checked")) { - localStorage.setItem("oSendMailCheckbox", true); - checkChange = oMatterProvisionConstants.Create_Notify_Button_Text; - } else { - localStorage.setItem("oSendMailCheckbox", false); - checkChange = oMatterProvisionConstants.Create_Button_Text; - } - - $("#btnCreateMatter").html(checkChange); - }); - - $("#demo-checkbox-unselected0").click(function () { - var oCalenderCheckbox = $("#demo-checkbox-unselected0")[0]; - changeCheckbox("oCalenderCheckbox", oCalenderCheckbox); - }); - - $("#demo-checkbox-unselected1").click(function () { - var oRSSFeedCheckbox = $("#demo-checkbox-unselected1")[0]; - changeCheckbox("oRSSFeedCheckbox", oRSSFeedCheckbox); - }); - - $("#demo-checkbox-unselected3").click(function () { - var oTaskCheckbox = $("#demo-checkbox-unselected3")[0]; - changeCheckbox("oTaskCheckbox", oTaskCheckbox); - }); - - function changeCheckbox(value, element) { - if ($(element).is(":checked")) { - localStorage.setItem(value, true); - } else { - localStorage.setItem(value, false); - } - } - $.ajax({ - url: "filterpanel.html?ver=25.0.0.0", - success: function (response) { - // App switcher - oCommonObject.getAppSwitcher(oGlobalConstants.App_Name_Provision_Matters); - $(".appSwitch .appSwitchMenu ul li:nth-child(3) ").addClass("selected"); - $(".TryAgainLink").attr("href", "javascript:window.top.location.reload()"); - commonFunction.onLoadActions(false); - } - }); - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oCommonObject.sCurrentPage, true); - popupSize(); - - //// #region JQuery Objects binding - - oJQueryObjects.$Loading = $(".loading"); - oJQueryObjects.$ClientList = $("#ddlClientList"); - oJQueryObjects.$ClientName = $("#ddlClient"); - oJQueryObjects.$ClientId = $("#txtClientId"); - oJQueryObjects.$MatterName = $("#txtMatterName"); - oJQueryObjects.$MatterId = $("#txtMatterId"); - oJQueryObjects.$MatterDescription = $("#txtMatterDesc"); - oJQueryObjects.$ContentTypes = $("#documentTemplates > .docTemplateItem"); - oJQueryObjects.$ConflictCheckConducted = $("#chkConflictCheck"); - oJQueryObjects.$ConflictConductedBy = $("#txtConflictCheckBy"); - oJQueryObjects.$ConflictCheckDate = $("#txtConflictCheckDate"); - oJQueryObjects.$ConflictIdentified = $("input[name=rdbConflictCheck]:checked"); - oJQueryObjects.$BlockedUsers = $("#txtBlockUser"); - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - oJQueryObjects.$CreateButton = $("#btnCreateMatter"); - oJQueryObjects.$LookUpButton = $("#btnLookup"); - oJQueryObjects.$ErrorPopUp = $(".mainArea .errorPopUp"); - oJQueryObjects.$LoadingLookUp = $(".loadingLookUp"); - oJQueryObjects.$MenuClick = $(".menuText"); - oJQueryObjects.$PracticeGroup = $(".popUpPG"); - oJQueryObjects.$PracticeGroupList = $("#popUpPGList"); - oJQueryObjects.$Paginate = $(".Paginate"); - //// #endregion - // #region Service calls - commonFunctions.getClient(); - commonFunctions.getRole(); - commonFunctions.getPerm(); - commonFunctions.fetchContentTypes(); - //// #endregion - // #region Bindings - // #region jQuery UI auto-complete - oCommonObject.bindAutocomplete("#txtConflictCheckBy", false); //// Bind the jQuery UI auto-complete to single user text field - oCommonObject.bindAutocomplete("#txtBlockUser", true); //// Bind the jQuery UI auto-complete to multi user text field - oCommonObject.bindAutocomplete("#txtAssign1", true); //// Bind the jQuery UI auto-complete to multi user text field - // #endregion - oJQueryObjects.$MenuClick.click(function (e) { onMenuTextClick(e); }); - oJQueryObjects.$CreateButton.click(function () { - $(".ms-ChoiceField-field").addClass("disable-checkbox"); - $(this).attr("disabled", "disabled"); - $(".loading").removeClass("hide"); - serviceConstants.bMatterLandingPage = true; - serviceConstants.bErrorOccured = false; - serviceConstants.bViewCreationFailed = false; - commonFunctions.createMatter(); - }); - oJQueryObjects.$LookUpButton.click(function () { - showPopup(); - }); - oJQueryObjects.$Paginate.click(function (e) { - var toMove = $(this).attr("data-move"); - toMove = parseInt(toMove, 10); - setActivePagination(toMove); - var iPageToClick = toMove ? parseInt(serviceConstants.iCurrentPage + 1, 10) : parseInt(serviceConstants.iCurrentPage - 1, 10); - $("span[data-section-num=" + iPageToClick + "]").click(); - e.stopPropagation(); - }); - $("input[name=rdbConflictCheck]").click(function (e) { onConflictIdentifiedChange(e); }); - oJQueryObjects.$ConflictCheckConducted.click(); - $(document).on("click", ".notificationContainer .notification .closeNotification", function () { - $(this).parent().remove(); - }); - $(document).on("keypress, input", "#txtConflictCheckBy, #txtBlockUser, input[id^=txtAssign]", function () { - $(this).removeAttr("data-resolved"); - }); - $("#addMoreLink").click(function () { - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - var iAssignPermCount = oJQueryObjects.$AssignPermissions.length; - commonFunctions.addMorePermissions(parseInt(iAssignPermCount, 10) + 1); - }); - oJQueryObjects.$ConflictCheckDate.datepicker({ maxDate: "+0d" }); - //// hide the error tooltip - $(document).on("click", ".content, .roleValue", function () { - if (serviceConstants.bCloseErrorPopup) { - oJQueryObjects.$ErrorPopUp.addClass("hide"); - $("div input:text , textarea , select").css({ "border": "1px #c8c8c8 solid" }); - } - }); - $(document).on("click", ".close", function (e) { - closePermissionRow(e); - }); - $("#txtMatterName").focusout(function () { - checkValidMatterName(); - serviceConstants.isValidClient = true; - }); - $(window).on("resize", function () { - "use strict"; - resizeErrorPopup(); - $(".errorPopUp").addClass("hide"); - $.datepicker._hideDatepicker(); - $("#hasDatepicker").blur(); - popupSize(); - }); - $(document).on("click", document, function (event) { - "use strict"; - if ("ddClientIcon" === $($(event.target)[0]).attr("class") || "ddlClient" === $(event.target)[0].id) { - closeAllPopupExcept("ddlClientList"); - } else if ($($(event.target)[0]).hasClass("popUpPGDiv")) { - closeAllPopupExcept("popUpPGList"); - } else { - closeAllPopupExcept(""); - } - }); - //// #endregion - // #region Search By Typing - //// Search by typing for Area of Law - $(document).on("input", ".popUpMatterDescription .popUpMDTextArea", function () { searchByTyping(".popUpMD .popUpMDContent", $(this).val()); }); - //// Search by typing for Sub Area of Law - $(document).on("input", ".popUpSubAreaOfLaw .popUpMDTextArea", function () { searchByTyping(".popUpSAL .popUpSALContent", $(this).val()); }); - //// #endregion - // #region Maintain State of App - if (localStorage.getItem("iLivePage")) { - ////Wait till data is fetched from SharePoint - var iInterval = setInterval(function () { - if (serviceConstants.bClient && serviceConstants.bRole && serviceConstants.bPermission && serviceConstants.bContentType) { - clearInterval(iInterval); - serviceConstants.bClient = serviceConstants.bRole = serviceConstants.bPermission = serviceConstants.bContentType = false; - var currentPage = localStorage.iLivePage; - if ("2" === currentPage) { - localStorage.setItem("IsPageLoad", true); - } else { - localStorage.setItem("IsPageLoad", false); - } - ////Fill data from local storage - commonFunctions.loadAppStateData(currentPage); - } - }, 500); - } - //// #endregion - getMatterGUID(); - }); - // #region Return exposed Functions and Variables - return ({ - getTermStoreData: function () { - return serviceConstants.oTermStoreJson; - }, //// Function which will be called through popUp.js - showErrorNotification: function (sElement, sMsg) { - return showErrorNotification(sElement, sMsg); - }, //// Function which will be called through common.js - sConflictScenario: function () { - return serviceConstants.sConflictScenario; - } - }); - // #endregion -}()); - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchDocument.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchDocument.js deleted file mode 100644 index b20e9c87..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchDocument.js +++ /dev/null @@ -1,620 +0,0 @@ -/// JS1003,JS2032,JS2074,JS2076,JS2024,JS3116,JS3085,JS3058,JS3092,JS3057,JS3054,JS2073,JS2005,JS3056 - -var oDocumentConstants = { - bAttachDocumentFailed: false, - iAsyncCallsCompleted: 0 -}; - -//// Office.js Initialization -(function () { - "use strict"; - //// The Office initialize function must be run each time a new page is loaded - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Outlook) { - Office.initialize = function (reason) { - enableAttachIfComposeMode(); - }; - } -})(); - -/* Function to notify the user about success/failure for attachment documents */ -function notifyAttachmentResult() { - "use strict"; - $(".warningPopUpHolder, .attachedSuccessPopUp, .attachedProgressPopUp, .attachedFailedPopUp").addClass("hide"); - if (oDocumentConstants.bAttachDocumentFailed) { - ////show failure message - $(".attachedFailedPopUp").removeClass("hide"); - } else { - //// show success message - $(".attachedSuccessPopUp").removeClass("hide"); - } - $(".warningPopUpHolder").removeClass("hide"); - var oAllSelector = $("#CheckBox .ms-ChoiceField-input"); - if (oAllSelector && oAllSelector.length) { - oAllSelector[0].checked = false; - } -} - -/* Send asynchronous calls to send each document as attachment */ -function sendAttachmentAsync(sDocumentPath, sDocumentName) { - "use strict"; - Office.context.mailbox.item.addFileAttachmentAsync(sDocumentPath, sDocumentName, { - asyncContext: { - sCurrentDocumentPath: sDocumentPath, sCurrentDocumentName: sDocumentName - } - }, - function (asyncResult) { - if (asyncResult.status === Office.AsyncResultStatus.Failed) { - $(".failureDocumentList").append("
    " + asyncResult.asyncContext.sCurrentDocumentName + "
    "); - oDocumentConstants.bAttachDocumentFailed = true; - } - oDocumentConstants.iAsyncCallsCompleted++; - if ($(".is-selectedRow").length === oDocumentConstants.iAsyncCallsCompleted) { - notifyAttachmentResult(); - } else { - $("#currentDocumentCount").text(parseInt(oDocumentConstants.iAsyncCallsCompleted, 10) + 1); - } - }); -} - -/* Send selected documents as attachments to email */ -function sendDocumentAsAttachment(event) { - "use strict"; - $(".errorAttachDocument").addClass("hide"); - $(".failureDocumentList").empty(); - var oSelectedRows = $(".is-selectedRow"); - if (oSelectedRows && oSelectedRows.length) { - if (5 < oSelectedRows.length) { - $(".errorAttachDocument").removeClass("hide"); - } else { - //// Display the in progress pop up - $(".attachedProgressPopUp, .warningPopUpHolder").removeClass("hide"); - ////$("#totalDocumentCount").text(oSelectedRows.length); - $(".progressPopUpDetails").html(oFindDocumentConstants.AttachInProgressMessage.replace("{0}", oSelectedRows.length)); - $("#currentDocumentCount").text(1); - //// Send the call to attach the document - var sDocumentURL = (4 === oCommonObject.iCurrentGridViewData()) ? "data-" + oGlobalConstants.GridViewPinnedDocumentUrl : "data-" + oGlobalConstants.Path - , oNameColumn = $(".is-selectedRow .nameColumn") - , sUrlArray = []; - if (oNameColumn.length) { - $.each(oNameColumn, function () { - var sCurrentDocumentPath = trimEndChar($(this).attr(sDocumentURL), "/"), sCurrentDocumentName; - if (sCurrentDocumentPath) { - sCurrentDocumentPath = trimEndChar(sCurrentDocumentPath.trim(), "/"); - sCurrentDocumentName = sCurrentDocumentPath.substring(sCurrentDocumentPath.lastIndexOf("/") + 1); - if (sCurrentDocumentPath && sCurrentDocumentName) { - sendAttachmentAsync(decodeURIComponent(sCurrentDocumentPath), decodeURIComponent(sCurrentDocumentName)); - } - } - }); - } - } - event && event.stopPropagation(); - } -} - -/* Function to enable attach document if email is opened in compose mode */ -function enableAttachIfComposeMode() { - "use strict"; - if (Office.context && Office.context.mailbox && Office.context.mailbox.item) { - //// If email is opened in Compose mode then show the Send as attachment button - var oCurrentEmailItem = Office.context.mailbox.item.get_data(); - var sEmailCreatedTime, sEmailModifiedTime; - if (oCurrentEmailItem && (oCurrentEmailItem.hasOwnProperty("$0_0") || oCurrentEmailItem.hasOwnProperty("_data$p$0"))) { - // If $0_0 property is not available, use _data$p$0 to get email item details - if (oCurrentEmailItem.hasOwnProperty("$0_0")) { - sEmailCreatedTime = oCurrentEmailItem.$0_0.dateTimeCreated - , sEmailModifiedTime = oCurrentEmailItem.$0_0.dateTimeModified; - } else { - sEmailCreatedTime = oCurrentEmailItem._data$p$0.dateTimeCreated - , sEmailModifiedTime = oCurrentEmailItem._data$p$0.dateTimeModified; - } - //// Created time and Modified time are undefined if email is opened in compose mode - if ("undefined" === typeof (sEmailCreatedTime) && "undefined" === typeof (sEmailModifiedTime)) { - $("#attachDocuments").attr("data-applicable", true); - $("#attachDocuments").click(function (event) { - var bIsDisabled = $(this).hasClass("is-disabled"); - if (!bIsDisabled) { - //// Log event - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oFindDocumentConstants.Event_Name_Attach_Document, true); - oDocumentConstants.bAttachDocumentFailed = false; - oDocumentConstants.iAsyncCallsCompleted = 0; - sendDocumentAsAttachment(event); - } - event && event.preventDefault(); - }); - } - } - } -} - -/* Function to update dynamic text on page */ -function updateDynamicText() { - "use strict"; - $(".warningMessageText").text(oFindDocumentConstants.MaxAttachedMessage).attr("title", oFindDocumentConstants.MaxAttachedMessage); - $(".warningPopUpDetails").text(oFindDocumentConstants.AttachSuccessMessage).attr("title", oFindDocumentConstants.AttachSuccessMessage); - $(".attachedPopUpDetails").text(oFindDocumentConstants.AttachFailureMessage).attr("title", oFindDocumentConstants.AttachFailureMessage); - ////$(".progressPopUpDetails").html(oFindDocumentConstants.AttachInProgressMessage); - $("#attachButtonText").text(oFindDocumentConstants.AttachButtonText).attr("title", oFindDocumentConstants.AttachButtonText); -} - -/* Function to be called before search matter */ -function getSearchDocumentsBeforeSend(result) { - "use strict"; - var container = result.oParam.container; - $("#gridViewContainer_Grid").find(".lazyLoading").removeClass("hide"); - oCommonObject.isServiceCallComplete = false; -}; - -/* Function for success of search document */ -function getSearchDocumentsSuccess(result) { - "use strict"; - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - $("#gridViewContainer .jsonGridHeader").removeAttr("disabled").removeClass("disableHeader"); //// Enable the grid header - oCommonObject.isServiceCallComplete = true; - if (result && $.trim(result.Result) && result.oParam) { - var sData = result.Result.split("$|$") - , bIsPageLoad; - - var searchDocuments = JSON.parse(sData[0]); - var totalResults = parseInt(sData[1], 10) || 0; - if (!searchDocuments.code || "0" === searchDocuments.code) { - //// Pinned matters exists for the current logged in user - if ("undefined" !== typeof sData[1] && totalResults) { - //// Check if the data is loaded for page load or lazy load - if (1 === oGridViewObject.pageNumber) { - bIsPageLoad = true; - oGridViewObject.searchResultCount = totalResults; - if ($("#attachDocuments").attr("data-applicable")) { - $("#attachDocuments").removeClass("hide"); - } - $("#attachDocuments").addClass("is-disabled"); - } else { - bIsPageLoad = false; - } - oGridView.loadGridView(sData[0], bIsPageLoad); - oCommonObject.updatePinnedStatus(); - oCommonObject.updateSortingNotification(); - oCommonObject.enableSearch(); - } else { - // No documents exists - oGridView.loadGridView(sData[0], true); - $("#attachDocuments").addClass("is-disabled"); - oCommonObject.updateSortingNotification(); - $("#loadingImageContainer").addClass("hide"); - $("#gridViewContainer_Grid tbody tr").removeClass("hide").addClass("invisible"); - $("#gridViewContainer_Grid tbody").append(oGlobalConstants.No_Results_Message); - oGridViewObject.searchResultCount = 0; - oCommonObject.enableSearch(); - oCommonObject.closeAllPopupExcept("", event); - } - } else { - showCommonErrorPopUp(searchDocuments.code); - } - } -} - -/* Function for failure of search document */ -function getSearchDocumentsFailure(result) { - "use strict"; - oCommonObject.isServiceCallComplete = true; - oGridViewObject.waitTillDataLoaded = false; - if (result.Result && result.Result.statusText && "abort" === result.Result.statusText) { - return; - } - oCommonObject.enableSearch(); - showCommonErrorPopUp(result.Result); -} - -/* Function to get the matters on page load */ -function getSearchDocuments(oContainer, bIsFilterFlyoutCall) { - "use strict"; - oCommonObject.disableSearch(); - var ofilterSearchText = oCommonObject.sSearchedKeyword - , sSearchTerm = (ofilterSearchText && ofilterSearchText !== "") ? oCommonObject.formatSearchText(ofilterSearchText.trim(), oGlobalConstants.Document_ID) : "" - , oFilterDetails = { ClientsList: [], FromDate: "", ToDate: "", FilterByMe: 1 } - , oParam = { "container": oContainer, "bIsFilterFlyoutCall": bIsFilterFlyoutCall } - , oSearchDetails; - - if (1 === oCommonObject.iCurrentGridViewData()) { //// If All Documents section (flag is 1) is selected, then set filter by me flag to 0 - oFilterDetails.FilterByMe = 0; - } - - oCommonObject.getSortDetails(bIsFilterFlyoutCall); - - if (bIsFilterFlyoutCall) { - $.extend(oFilterDetails, oCommonObject.oFlyoutFilters()); - } - - oSearchDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oCommonObject.getDeployedUrl() }, "searchObject": { "PageNumber": oGridViewObject.pageNumber, "ItemsPerPage": oGridViewObject.itemsPerPage, "SearchTerm": sSearchTerm, "Filters": oFilterDetails, "Sort": oCommonObject.oSortDetails() } }; - - oCommonObject.callSearchService("FindDocument", oSearchDetails, getSearchDocumentsSuccess, getSearchDocumentsFailure, getSearchDocumentsBeforeSend, oParam); -} - -//// #endregion - -//// #region Pin Unpin functionality - -/* Function for failure of pin document */ -function pinDocumentFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function for success of pin document */ -function pinDocumentSuccess(result) { - "use strict"; - if (result && result.Result && $.parseJSON(result.Result.toLowerCase())) { - $(result.oParam.container).attr("data-ispinned", "true"); //// Update the property of current element - oCommonObject.userPinnedData.push(result.oParam.sCurrentDocumentUrl); - oCommonObject.updatePinnedStatus(); - } else if (-1 < result.indexOf("code")) { //// Display error pop up in case of exception - var oErrorPopUpData = JSON.parse(result); - showCommonErrorPopUp(oErrorPopUpData.code); - } else { - // Reason: Something went wrong - $("#gridViewContainer").empty().html("" + oGlobalConstants.Failure_Message + ""); /// Remove the data from the grid view - $("#loadingImageContainer").addClass("hide"); - } -} - -/* Function to call service to pin matter to user favorites */ -function pinDocument(oCurrentRow) { - "use strict"; - var sDocumentName, sDocumentVersion, sDocumentClient, sDocumentClientID, sDocumentClientUrl, sDocumentMatter, sDocumentMatterID, sDocumentOwner, sDocumentUrl, sDocumentOWAUrl, sDocumentExtension, sDocumentCreatedDate, sDocumentModifiedDate, sDocumentCheckoutUser, sDocumentMatterUrl, sDocumentParentUrl, sDocumentID, sLibraryName; - if (oCurrentRow && oCurrentRow.length) { - //// Get the meta data required for pinning a document - sDocumentName = oCurrentRow.text() ? oCurrentRow.text() : "NA"; - sDocumentVersion = oCurrentRow.attr("data-" + oGlobalConstants.Managed_Property_Document_Version + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Managed_Property_Document_Version + "")) : "NA"; - sDocumentClient = oCurrentRow.attr("data-" + oGlobalConstants.Document_Client_Name + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_Client_Name + "")) : "NA"; - sDocumentClientID = oCurrentRow.attr("data-" + oGlobalConstants.Document_Client_ID + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_Client_ID + "").replace(/\(/g, "").replace(/\)/g, "")) : "NA"; - sDocumentClientUrl = oCurrentRow.attr("data-" + oGlobalConstants.SP_Web_Url + "") ? decodeURIComponent(checkNull(oCurrentRow.attr("data-" + oGlobalConstants.SP_Web_Url + ""))) : "NA"; - sDocumentMatter = oCurrentRow.attr("data-" + oGlobalConstants.Document_Matter_Name + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_Matter_Name + "")) : "NA"; - sDocumentMatterID = oCurrentRow.attr("data-" + oGlobalConstants.Document_Matter_ID + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_Matter_ID + "").replace(/\(/g, "").replace(/\)/g, "")) : "NA"; - sDocumentOwner = oCurrentRow.attr("data-" + oGlobalConstants.Author + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Author + "")) : "NA"; - sDocumentUrl = oCurrentRow.attr("data-" + oGlobalConstants.Path + "") ? checkNull(decodeURIComponent(trimEndChar(oCurrentRow.attr("data-" + oGlobalConstants.Path + ""), "/").toLowerCase())) : "NA"; - sDocumentExtension = oCurrentRow.attr("data-" + oGlobalConstants.File_Extension + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.File_Extension + "")) : "NA"; - sDocumentCreatedDate = oCurrentRow.attr("data-" + oGlobalConstants.Created + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Created + "")) : "NA"; - sDocumentModifiedDate = oCurrentRow.attr("data-" + oGlobalConstants.Document_Last_Modified_Time + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_Last_Modified_Time + "")) : "NA"; - sDocumentOWAUrl = getDocumentUrl(oCurrentRow); - sDocumentCheckoutUser = oCurrentRow.attr("data-" + oGlobalConstants.Managed_Property_Document_CheckOutuser + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Managed_Property_Document_CheckOutuser + "")) : "NA"; - sDocumentParentUrl = oCurrentRow.attr("data-" + oGlobalConstants.Parent_Link + "") ? decodeURIComponent(checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Parent_Link + "")).replace(oGlobalConstants.All_Items_Extension, "")) : "NA"; - sDocumentMatterUrl = oCurrentRow.attr("data-" + oGlobalConstants.SP_Web_Url + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.SP_Web_Url + "")) : "NA"; - sLibraryName = sDocumentParentUrl.replace(sDocumentMatterUrl, "").split("/")[1]; - sDocumentMatterUrl = decodeURIComponent(sDocumentMatterUrl + "/" + sLibraryName); - sDocumentID = oCurrentRow.attr("data-" + oGlobalConstants.Document_ID + "") ? checkNull(oCurrentRow.attr("data-" + oGlobalConstants.Document_ID + "")) : "NA"; - - //// Generate the JSON structure of the input to service - var oPinParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "documentData": { "DocumentName": sDocumentName, "DocumentVersion": sDocumentVersion, "DocumentClient": sDocumentClient, "DocumentClientId": sDocumentClientID, "DocumentClientUrl": sDocumentClientUrl, "DocumentMatter": sDocumentMatter, "DocumentMatterId": sDocumentMatterID, "DocumentOwner": sDocumentOwner, "DocumentUrl": sDocumentUrl, "DocumentOWAUrl": sDocumentOWAUrl, "DocumentExtension": sDocumentExtension, "DocumentCreatedDate": sDocumentCreatedDate, "DocumentModifiedDate": sDocumentModifiedDate, "DocumentCheckoutUser": sDocumentCheckoutUser, "DocumentMatterUrl": sDocumentMatterUrl, "DocumentParentUrl": sDocumentParentUrl, "DocumentID": sDocumentID } }, oParam = { "container": oCurrentRow, "sCurrentDocumentUrl": sDocumentUrl }; - oCommonObject.callSearchService("PinDocumentForUser", oPinParameters, pinDocumentSuccess, pinDocumentFailure, null, oParam); - } -} - -/* Function to check for null as string */ -function checkNull(sOriginalString) { - "use strict"; - if ("null" === sOriginalString) { - sOriginalString = "NA"; - } - return sOriginalString; -} - -/* Function for success of unpin matter */ -function unpinDocumentSuccess(result) { - "use strict"; - if (result && result.Result && $.parseJSON(result.Result.toLowerCase())) { - $(result.oParam.container).attr("data-ispinned", "false"); //// Update the property of current element - /* Pop out the value of document which is currently unpinned */ - oCommonObject.userPinnedData = $.grep(oCommonObject.userPinnedData, function (sCurrentValue) { - return sCurrentValue !== result.oParam.sDocumentUrl; - }); - if (4 === oCommonObject.iCurrentGridViewData()) { - oGridViewObject.pageNumber = 1; //// Reset the page number for grid view control - $("#gridViewContainer").empty(); /// Remove the data from the grid view - getPinnedDocument($("#pinnedDocuments")); //// Refresh the grid view control to show new pinned data only in case of pinned section - } - } else if (-1 < result.indexOf("code")) { //// Display error pop up in case of exception - var oErrorPopUpData = JSON.parse(result); - showCommonErrorPopUp(oErrorPopUpData.code); - } else { - // Reason: Matter is not pinned. Hence, cannot be unpinned. - $("#gridViewContainer").empty().html("" + oFindDocumentConstants.Failure_Invalid_Unpin + ""); /// Remove the data from the grid view - $("#loadingImageContainer").addClass("hide"); - } -} - -/* Function for failure of unpin matter */ -function unpinDocumentFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function to call service to unpin matter to user favorites */ -function unpinDocument(oCurrentRow) { - "use strict"; - var sDocumentUrl = ""; - if (oCurrentRow && oCurrentRow.length) { - //// Get the meta data required for unpinning the matter - if (4 === oCommonObject.iCurrentGridViewData()) { - sDocumentUrl = oCurrentRow.attr("data-" + oGlobalConstants.GridViewPinnedDocumentUrl); - } else { - sDocumentUrl = oCurrentRow.attr("data-" + oGlobalConstants.Path); - } - sDocumentUrl = decodeURIComponent(trimEndChar($.trim(sDocumentUrl), "/").toLowerCase()); - sDocumentUrl = oCommonObject.htmlEncode(sDocumentUrl); - //// Generate the JSON structure of the input to service - var oUnpinParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "documentData": { "DocumentUrl": sDocumentUrl } }, oParam = { "container": oCurrentRow, "sCurrentDocumentUrl": sDocumentUrl }; - - oCommonObject.callSearchService("RemovePinnedDocument", oUnpinParameters, unpinDocumentSuccess, unpinDocumentFailure, null, oParam); - } -} - -/* Function to be called before getting pinned documents */ -function getPinnedDocumentBeforeSend(result) { - "use strict"; - var container = result.oParam.container; - $("#loadingImageContainer").removeClass("hide"); -} - -/* Function for success of getting pinned document */ -function getPinnedDocumentSuccess(result) { - "use strict"; - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - if (result && $.trim(result.Result)) { - var sData = result.Result.split("$|$"); //// sData[0] = Pinned Documents collection, sData[1] = count of pinned documents - var pinnedDocuments = JSON.parse(sData[0]); - if (!pinnedDocuments.code || "0" === pinnedDocuments.code) { - //// Pinned documents exists for the current logged in user - oCommonObject.pinnedData = []; - oCommonObject.pinnedData.push(sData[0]); - if ("undefined" !== typeof sData[1] && parseInt(sData[1], 10)) { - oCommonObject.userPinnedData.length = 0; //// Refresh the array which holds the user pinned matter - //// Add user's pinned documents name in the array - $.each(pinnedDocuments, function (iCurrentIndex, oCurrentObject) { - if (oCurrentObject) { - var sDocumentUrl = $.trim(oCurrentObject.DocumentUrl); - if (sDocumentUrl) { - oCommonObject.userPinnedData.push(sDocumentUrl); - } - } - }); - oCommonObject.updatePinnedStatus(); - - //// Show the pinned data in grid view only if, user selects from drop down - (4 === oCommonObject.iCurrentGridViewData()) && oGridView.loadGridView(sData[0], true); //// Always pass true as no lazy loading expected in pinned section - $("#attachDocuments").addClass("is-disabled"); - } else { - // No pinned documents exists for user. - sData[1] = 0; - oCommonObject.userPinnedData.length = 0; - (4 === oCommonObject.iCurrentGridViewData()) && $("#gridViewContainer").html("" + oFindDocumentConstants.No_Pinned_Documents + ""); - $("#loadingImageContainer").addClass("hide"); - } - } else { - showCommonErrorPopUp(pinnedDocuments.code); - } - } -} - -/* Function for failure of getting pinned document */ -function getPinnedDocumentFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function to get the pinned documents on page load */ -function getPinnedDocument(oContainer) { - "use strict"; - var oPinnedDocumentDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url } } - , oParam = { "container": oContainer }; - - oCommonObject.callSearchService("FindUserPinnedDocument", oPinnedDocumentDetails, getPinnedDocumentSuccess, getPinnedDocumentFailure, getPinnedDocumentBeforeSend, oParam); -} -////#endregion - -//// #region Common Functions -/* Returns the document URL. For documents supported by OWA, it returns OWA URL. Otherwise, the document path. */ -function getDocumentUrl(oCurrentRow) { - "use strict"; - var sDocumentPath, sDocumentExtension, sDocumentSPWebUrl; - if (oCurrentRow && oCurrentRow.length) { - sDocumentPath = trimEndChar(oCurrentRow.attr("data-" + oGlobalConstants.Path), "/"); - sDocumentExtension = oCurrentRow.attr("data-" + oGlobalConstants.File_Extension); - sDocumentSPWebUrl = oCurrentRow.attr("data-" + oGlobalConstants.SP_Web_Url); - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentPath = commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentPath); - } - } - return sDocumentPath; -} - -/* Function to update the ECB actions in the ECB menu */ -function updateECBforDocument(oContextualMenu, oSelectedElement) { - "use strict"; - var sClientUrl = "", sMatterName = "", sParentLink = "", isPinned = ""; - - if (4 === oCommonObject.iCurrentGridViewData()) { //// Get different field values for pinned view (flag = 4) - sClientUrl = oSelectedElement.attr("data-documentclienturl"); //// These properties will not come from resource files as these are key names of pinned JSON object which will not change - sParentLink = oSelectedElement.attr("data-documentparenturl"); - isPinned = true; - } else { - sClientUrl = oSelectedElement.attr("data-" + oGlobalConstants.SP_Web_Url); - sParentLink = oSelectedElement.attr("data-" + oGlobalConstants.Parent_Link); - isPinned = oSelectedElement.attr("data-ispinned"); - } - //// Changes for URL consolidation - sMatterName = sParentLink.replace(sClientUrl, ""); - sMatterName = sMatterName && sMatterName.split("/"); - sMatterName = sMatterName[1] ? sMatterName[1] : ""; - //// Disable the pin/unpin options based on the status of pinned document - if (isPinned && $.parseJSON(isPinned)) { - oContextualMenu.find(".pin").parent().addClass("removeECBItem"); - oContextualMenu.find(".unpin").parent().removeClass("removeECBItem"); - } else { - oContextualMenu.find(".pin").parent().removeClass("removeECBItem"); - oContextualMenu.find(".unpin").parent().addClass("removeECBItem"); - } - - //// Update the location of matter landing page for go to Matter Sites action - if ($.trim(sMatterName)) { - var sAbsoluteClientUrl = sClientUrl.replace(oGlobalConstants.Site_Url, "") - , sLandingPageName = "/" + sMatterName + ".aspx" - , sMatterLandingPageUrl = sAbsoluteClientUrl + "/" + oGlobalConstants.Matter_Landing_Page_Repository + sLandingPageName + "$|$" - + sAbsoluteClientUrl + "/" + sMatterName + "/" + sMatterName + sLandingPageName; - - //// Set the URL for go to Matter Sites - oCommonObject.checkMatterLandingURL(sClientUrl, sMatterLandingPageUrl, sMatterLandingPageUrl, sParentLink, oContextualMenu); - } else { - var oGoToMatterSitesElement = oContextualMenu.find(".gotoMatterSites"); - //// Set the hyper link property of go to Matter Sites - oGoToMatterSitesElement.attr({ "data-matterlink": sParentLink, "onclick": "viewMatter(this);" }); - } -} - -/* Function to display Document flyout */ -function showMatterDetailPopup(element, event, bUpload) { - "use strict"; - var flyoutExist = $("#gridViewContainer .InfoFlyout"); - if (!flyoutExist.length) { - var sFlyoutHTMLChunk = $(".InfoFlyout").length && $(".InfoFlyout").clone() && $(".InfoFlyout").clone()[0]; - $("#gridViewContainer").append(sFlyoutHTMLChunk); - } - $("#gridViewContainer .InfoFlyout").find(".ms-Callout-inner").addClass("hide"); - $("#gridViewContainer .InfoFlyout").removeClass("hide"); - $("#gridViewContainer .InfoFlyout").find("#FlyoutPopupLoading").removeClass("hide"); - var matterPopData = $(".InfoFlyout .ms-Callout-inner"), $Element = $(element); - if (matterPopData.length && $Element) { - if (4 === oCommonObject.iCurrentGridViewData()) { - var documentName = $Element.attr("title") ? $Element.attr("title").trim() : "NA", - matterName = $Element.attr("data-documentmatter") ? oCommonObject.renderAsText($Element.attr("data-documentmatter").trim()) : "NA", - clientName = $Element.attr("data-documentclient") ? oCommonObject.renderAsText($Element.attr("data-documentclient").trim()) : "NA", - author = $Element.attr("data-documentowner") ? oCommonObject.renderAsText($Element.attr("data-documentowner").trim()) : "NA", - documentUrl = $Element.attr("data-" + oFindDocumentConstants.GridViewDocumentOWAUrl) ? oCommonObject.renderAsText($Element.attr("data-" + oFindDocumentConstants.GridViewDocumentOWAUrl).trim()) : "", - dateModified = $Element.attr("data-documentmodifieddate") ? oCommonObject.renderAsText($Element.attr("data-documentmodifieddate").trim()) : "NA", - documentID = $Element.attr("data-documentid") ? oCommonObject.renderAsText($Element.attr("data-documentid").trim()) : "NA"; - } else { - var documentName = $Element.attr("title") ? $Element.attr("title").trim() : "NA", - matterName = $Element.attr("data-" + oGlobalConstants.Document_Matter_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Document_Matter_Name).trim()) : "NA", - documentPath = $($Element.find("a")[0]).attr("href").trim(), - clientName = $Element.attr("data-" + oGlobalConstants.Document_Client_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Document_Client_Name).trim()) : "NA", - author = $Element.attr("data-" + oGlobalConstants.Author) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Author).trim()) : "NA", - documentUrl = documentPath ? oCommonObject.renderAsText(documentPath) : "", - dateModified = $Element.attr("data-" + oGlobalConstants.Document_Last_Modified_Time) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Document_Last_Modified_Time).trim()) : "NA", - documentID = $Element.attr("data-" + oGlobalConstants.Document_ID) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Document_ID).trim()) : "NA"; - } - var libraryName = documentUrl.split("/"); - //// Add html chunk of flyout. - matterPopData.find(".FlyoutHeadingText").text(documentName); - matterPopData.find("#openDocument").attr({ "data-link": trimEndChar(documentUrl.trim(), "/"), "data-documentname": documentName, "data-clientName": clientName }); - matterPopData.find(".FlyoutMatterName").attr({ "data-matter": matterName }).html("
    Matter:
    " + decodeURIComponent(matterName) + "
    "); - matterPopData.find(".FlyoutClientName").attr({ "data-client": clientName }).html("
    Client:
    " + decodeURIComponent(clientName) + "
    "); - matterPopData.find(".FlyoutDocumentID").attr({ "data-clientid": documentID, "data-matterid": documentID }).html("
    Document ID:
    " + documentID + "
    "); - matterPopData.find(".FlyoutAuthor").attr({ "data-matterAuthor": author }).html("
    Author:
    " + author + "
    "); - matterPopData.find(".FlyoutCreatedDate").attr({ "data-modifieddate": oGridView.formatDate(dateModified) }).html("
    Modified date:
    " + oGridView.formatDate(dateModified) + "
    "); - $("#gridViewContainer .InfoFlyout").find(".FlyoutUrlHeading").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find(".FlyoutUrl").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find("#uploadToMatter").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find("#viewMatters").addClass("hide"); - - //// Set the attributes for view document landing button - oCommonObject.updateDocumentLandingAttributes($Element); - } - placeMatterDetailsPopup(element, event); -}; - -/* Function to adjust position of flyout according to word view and outlook view*/ -function placeMatterDetailsPopup(element, event) { - "use strict"; - ////Check if current view is word view and set data accordingly - ////Following code is written in Java Script because we already have QueryString Implementation for word and outlook, and to avoid code Repetition in CSS. - var nWindowWidth = $(window).width(); - if (nWindowWidth <= 660) { - $("#gridViewContainer .InfoFlyout").find(".FlyoutContentHeading").css("float", "none"); - $("#gridViewContainer .InfoFlyout").find(".FlyoutHeading").addClass("FlyoutHeadingWordMargin"); - $("#gridViewContainer .InfoFlyout").find(".ms-Callout-inner").addClass("FlyoutBoxContent"); - $("#gridViewContainer .InfoFlyout").find(".FlyoutBox").addClass("DocumentFlyoutWordSize"); - var flyoutArrowExist = $("#gridViewContainer .InfoFlyout").find(".flyoutToparrow"); - if (!flyoutArrowExist.length) { - $("#gridViewContainer .InfoFlyout").prepend("
    "); - } - $("#gridViewContainer .InfoFlyout").css({ top: ($(element).position().top + 20) }); - } else { - $("#gridViewContainer .InfoFlyout").find(".FlyoutBox").addClass("DocumentFlyoutOutlookSize"); - var flyoutArrowExist = $("#gridViewContainer .InfoFlyout").find(".flyoutLeftarrow"); - if (!flyoutArrowExist.length) { - $("#gridViewContainer .InfoFlyout").prepend("
    "); - $("#gridViewContainer .InfoFlyout").addClass("DocumentFlyoutLeftMove"); - } - if ($(element).offset().top < 220) { - $("#gridViewContainer .InfoFlyout").find(".flyoutLeftarrow").css("top", $(element).offset().top - 75); - $("#gridViewContainer .InfoFlyout").css({ "top": (($(element).position().top - $(element).offset().top)) + 83 }); - } else { - $("#gridViewContainer .InfoFlyout").find(".flyoutLeftarrow").css("top", "128"); // If we use ADD and REMOVE class CSS won't override calculated top - $("#gridViewContainer .InfoFlyout").css("top", Math.floor($(element).position().top) - 122); - } - } - event.stopPropagation(); -}; - -////#endregion - -$(document).ready(function () { - "use strict"; - oCommonObject.isMatterView = false; //// Flag to identify Search Document page - oCommonObject.sCurrentPage = oGlobalConstants.App_Name_Search_Documents; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oCommonObject.sCurrentPage, true); - $(".AppHeader").removeClass("hide"); //// Display the app header - getContextualHelpData(2); - $.ajax({ - url: "CommonControls.html?ver=25.0.0.0", - success: function (response) { - $("#HeaderPlaceHolder").html($(response).find("#commonSearchBar").html()); - $("#autoCompletePlaceHolder").attr("title", oFindDocumentConstants.AutoComplete_Placeholder).text(oFindDocumentConstants.AutoComplete_Placeholder); - $("#gridView").html($(response).find("#gridViewContent").html()); - $("#SendToOneDrive").html($(response).find("#buttonContent").html()); - $("#EmailDocumentLinks").html($(response).find("#buttonContent").html()); - $("#SendToOneDrive .ms-Button-label").text("Send to OneDrive"); - $("#EmailDocumentLinks .ms-Button-label").text("Email document links"); - $(".textFlyoutContent").html($(response).find("#textFlyoutContent").html()); - $(".dateFlyoutContent").html($(response).find("#dateFlyoutContent").html()); - $(".clearFilterContent").html($(response).find("#clearFilterContent").html()); - $(".textFlyoutContent .clearFilterContent").find(".clearFilterText").attr("data-clearFilterType", "text"); - $(".dateFlyoutContent .clearFilterContent").find(".clearFilterText").attr("data-clearFilterType", "date"); - $(".InfoFlyout").html($(response).find(".commonFlyout").html()); - commonFunction.setOWADocumentExtension(); - //// Generate the common drop down and place it on page - oCommonObject.generateCommonDropdown("#searchPanelDropdown", oFindDocumentConstants.SearchDropdownFields); - //// Generate the column picker and place it on page - oCommonObject.generateColumnPicker("#columnPickerPanel #columnPickerBlock #columnOptions", oFindDocumentConstants.GridViewColumnPickerFields); - oCommonObject.addDropdownBindings(); - oCommonObject.addAutoCompleteBindings(); - oCommonObject.addColumnPickerBindings(); - oGridView.loadECBControl(); - oGridView.adjustGridViewHeight(); - oGridView.applyMapContainerHeight(); - $(".ms-Dropdown-title, #gridViewPageHeader").attr("title", oGlobalConstants.My_Documents_Message).text(oGlobalConstants.My_Documents_Title); //// Set the drop down title and page header to My Matters on page load - oCommonObject.addFilterFlyoutBindings(); - } - }); - $(document).on("click", ".nameColumn", function (event) { - showMatterDetailPopup(this, event, "false"); - oCommonObject.getDocumentLandingAssets(this); - oCommonObject.closeAllPopupExcept("InfoFlyout", event); - }); - $(document).on("click", ".warningPopUpCloseIconContainer , .attachedPopUpCloseIconContainer", function (event) { - $(".warningPopUpHolder, .attachedSuccessPopUp, .attachedProgressPopUp, .attachedFailedPopUp").addClass("hide"); - var oGridRow = $(".GridRow, .GridRowAlternate"); - oGridView.highlightGridViewRow(oGridRow, false); - $("#attachDocuments").addClass("is-disabled"); - }); - $(document).on("click", ".errorAttachDocument", function (event) { - $(this).addClass("hide"); - }); - $(document).on("click", ".warningPopUpContainer", function (event) { - oCommonObject.closeAllPopupExcept("warningPopUpHolder", event); - event && event.stopPropagation(); - }); - updateDynamicText(); -}); diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchMatter.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchMatter.js deleted file mode 100644 index 3c83c79e..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SearchMatter.js +++ /dev/null @@ -1,664 +0,0 @@ -/// JS1003,JS2032,JS2074,JS2076,JS2024,JS3116,JS3085,JS3058,JS3092,JS3057,JS3054,JS2073,JS2005,JS3056 - -var oSearchGlobal = { - matterUrl: "", - oServiceRequest: {}, - dataArray: [], //// This and its occurrences needs to be removed from actual implementation, placed it for testing purpose -}; - -//// #region Search Matters section - -/* Function to be called before search matter */ -function getSearchMattersBeforeSend(result) { - "use strict"; - var container = result.oParam.container; - $("#gridViewContainer_Grid").find(".lazyLoading").removeClass("hide"); - oCommonObject.isServiceCallComplete = false; -}; - -/* Function for success of search matter */ -function getSearchMattersSuccess(result) { - "use strict"; - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - $("#gridViewContainer .jsonGridHeader").removeAttr("disabled").removeClass("disableHeader"); //// Enable the grid header - oCommonObject.isServiceCallComplete = true; - if (result && $.trim(result.Result) && result.oParam) { - var sData = result.Result.split("$|$") - , bIsPageLoad; - - var searchMatters = JSON.parse(sData[0]); - var totalResults = parseInt(sData[1], 10) || 0; - if (!searchMatters.code || "0" === searchMatters.code) { - //// Pinned matters exists for the current logged in user - if ("undefined" !== typeof sData[1] && totalResults) { - //// Check if the data is loaded for page load or lazy load - if (1 === oGridViewObject.pageNumber) { - bIsPageLoad = true; - oGridViewObject.searchResultCount = totalResults; - } else { - bIsPageLoad = false; - } - oGridView.loadGridView(sData[0], bIsPageLoad); - oCommonObject.updatePinnedStatus(); - oCommonObject.updateSortingNotification(); - oCommonObject.enableSearch(); - } else { - // No matters exists - oGridView.loadGridView(sData[0], true); - oCommonObject.updateSortingNotification(result.oParam.bIsFilterFlyoutCall); - $("#loadingImageContainer").addClass("hide"); - $("#gridViewContainer_Grid tbody tr").removeClass("hide").addClass("invisible"); - $("#gridViewContainer_Grid tbody").append(oGlobalConstants.No_Results_Message); - oGridViewObject.searchResultCount = 0; - oCommonObject.enableSearch(); - oCommonObject.closeAllPopupExcept("", event); - } - } else { - showCommonErrorPopUp(searchMatters.code); - } - } -} - -/* Function for failure of search matter */ -function getSearchMattersFailure(result) { - "use strict"; - oCommonObject.isServiceCallComplete = true; - oGridViewObject.waitTillDataLoaded = false; - if (result.Result && result.Result.statusText && "abort" === result.Result.statusText) { - return; - } - oCommonObject.enableSearch(); - showCommonErrorPopUp(result.Result); -} - -/* Function to get the matters on page load */ -function getSearchMatters(oContainer, bIsFilterFlyoutCall) { - "use strict"; - oCommonObject.disableSearch(); - var ofilterSearchText = oCommonObject.sSearchedKeyword - , sSearchTerm = (ofilterSearchText && ofilterSearchText !== "") ? oCommonObject.formatSearchText(ofilterSearchText.trim(), oGlobalConstants.Matter_ID) : "" - , oFilterDetails = { ClientsList: [], PGList: "", AOLList: "", FromDate: "", ToDate: "", FilterByMe: 1 } - , oParam = { "container": oContainer, "bIsFilterFlyoutCall": bIsFilterFlyoutCall } - , oSearchDetails; - - if (1 === oCommonObject.iCurrentGridViewData()) { //// If All Matters section (flag is 1) is selected, then set filter by me flag to 0 - oFilterDetails.FilterByMe = 0; - } - - oCommonObject.getSortDetails(bIsFilterFlyoutCall); - - if (bIsFilterFlyoutCall) { - $.extend(oFilterDetails, oCommonObject.oFlyoutFilters()); - } - - oSearchDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oCommonObject.getDeployedUrl() }, "searchObject": { "PageNumber": oGridViewObject.pageNumber, "ItemsPerPage": oGridViewObject.itemsPerPage, "SearchTerm": sSearchTerm, "Filters": oFilterDetails, "Sort": oCommonObject.oSortDetails() } }; - - oCommonObject.callSearchService("FindMatter", oSearchDetails, getSearchMattersSuccess, getSearchMattersFailure, getSearchMattersBeforeSend, oParam); -} - -//// #endregion - -//// #region Pin Unpin functionality - -/* Function for success of pin matter */ -function pinMatterSuccess(result) { - "use strict"; - if (result && result.Result && $.parseJSON(result.Result.toLowerCase())) { - $(result.oParam.container).attr("data-ispinned", "true"); //// Update the property of current element - oCommonObject.userPinnedData.push(result.oParam.sCurrentMatterUrl); - oCommonObject.updatePinnedStatus(); - } else if (-1 < result.indexOf("code")) { //// Display error pop up in case of exception - var oErrorPopUpData = JSON.parse(result); - showCommonErrorPopUp(oErrorPopUpData.code); - } else { - // Reason: Something went wrong - $("#gridViewContainer").empty().html("" + oGlobalConstants.Failure_Message + ""); /// Remove the data from the grid view - $("#loadingImageContainer").addClass("hide"); - } -} - -/* Function for failure of pin matter */ -function pinMatterFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function to call service to pin matter to user favorites */ -function pinMatter(oCurrentRow) { - "use strict"; - var sMatterName, sMatterID, sMatterDescription, sPracticeGroup, sAreaofLaw, sSubAreaofLaw, sResponsibleAttorney, sMatterCreatedDate, sClientName, sClientID, sClientUrl, sMatterUrl, bHideUpload, sLastModifiedDate, sMatterGuid; - - if (oCurrentRow && oCurrentRow.length) { - //// Get the meta data required for pinning a matter - sMatterName = oCurrentRow.attr("data-" + oGlobalConstants.Matter_Name + ""); - sMatterID = oCurrentRow.attr("data-" + oGlobalConstants.Matter_ID + ""); - sMatterDescription = oCurrentRow.attr("data-" + oGlobalConstants.Description + ""); - sPracticeGroup = oCurrentRow.attr("data-" + oGlobalConstants.Practice_Group + ""); - sAreaofLaw = oCurrentRow.attr("data-" + oGlobalConstants.Area_Of_Law + ""); - sSubAreaofLaw = oCurrentRow.attr("data-" + oGlobalConstants.Sub_Area_Of_Law + ""); - sResponsibleAttorney = oCurrentRow.attr("data-" + oGlobalConstants.Responsible_Attorney + ""); - sMatterCreatedDate = validateDateFormat(oCurrentRow.attr("data-" + oGlobalConstants.Open_Date + "")); - sClientName = oCurrentRow.attr("data-" + oGlobalConstants.Client_Name + ""); - sClientID = oCurrentRow.attr("data-" + oGlobalConstants.Client_ID + ""); - sClientUrl = oCurrentRow.attr("data-" + oGlobalConstants.Site_Name + ""); - sMatterUrl = oCurrentRow.attr("data-" + oGlobalConstants.Path + ""); - sLastModifiedDate = oCurrentRow.attr("data-" + oGlobalConstants.Last_Modified_Time + ""); - bHideUpload = oCurrentRow.attr("data-" + oGlobalConstants.IsReadOnly + ""); - //// Changes for URL consolidation - sMatterGuid = ("null" !== oCurrentRow.attr("data-" + oGlobalConstants.Matter_GUID + "")) ? oCurrentRow.attr("data-" + oGlobalConstants.Matter_GUID + "") : sMatterName; - - //// Generate the JSON structure of the input to service - var oPinParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "matterData": { "MatterName": sMatterName, "MatterDescription": sMatterDescription, "MatterCreatedDate": sMatterCreatedDate, "MatterUrl": sMatterUrl, "MatterPracticeGroup": sPracticeGroup, "MatterAreaOfLaw": sAreaofLaw, "MatterSubAreaOfLaw": sSubAreaofLaw, "MatterClientUrl": sClientUrl, "MatterClient": sClientName, "HideUpload": bHideUpload, "MatterID": sMatterID, "MatterClientId": sClientID, "MatterResponsibleAttorney": sResponsibleAttorney, "MatterModifiedDate": sLastModifiedDate, "MatterGuid": sMatterGuid } } - , oParam = { - "container": oCurrentRow, "sCurrentMatterUrl": sMatterUrl - }; - - oCommonObject.callSearchService("PinMatterForUser", oPinParameters, pinMatterSuccess, pinMatterFailure, null, oParam); - } -} - -/* Function for success of unpin matter */ -function unpinMatterSuccess(result) { - "use strict"; - if (result && result.Result && $.parseJSON(result.Result.toLowerCase())) { - $(result.oParam.container).attr("data-ispinned", "false"); //// Update the property of current element - /* Pop out the value of matter which is currently unpinned */ - oCommonObject.userPinnedData = $.grep(oCommonObject.userPinnedData, function (sCurrentValue) { - return sCurrentValue !== result.oParam.sCurrentMatterUrl; - }); - if (4 === oCommonObject.iCurrentGridViewData()) { - oGridViewObject.pageNumber = 1; //// Reset the page number for grid view control - $("#gridViewContainer").empty(); /// Remove the data from the grid view - getPinnedMatters($("#pinnedMatters")); //// Refresh the grid view control to show new pinned data only in case of pinned section - } - } else if (-1 < result.indexOf("code")) { //// Display error pop up in case of exception - var oErrorPopUpData = JSON.parse(result); - showCommonErrorPopUp(oErrorPopUpData.code); - } else { - // Reason: Matter is not pinned. Hence, cannot be unpinned. - $("#gridViewContainer").empty().html("" + oFindMatterConstants.Failure_Invalid_Unpin + ""); /// Remove the data from the grid view - $("#loadingImageContainer").addClass("hide"); - } -} - -/* Function for failure of unpin matter */ -function unpinMatterFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function to call service to unpin matter to user favorites */ -function unpinMatter(oCurrentRow) { - "use strict"; - var sMatterUrl = ""; - if (oCurrentRow && oCurrentRow.length) { - //// Get the meta data required for unpinning the matter - if (4 === oCommonObject.iCurrentGridViewData()) { - sMatterUrl = oCurrentRow.attr("data-matterurl"); - } else { - sMatterUrl = oCurrentRow.attr("data-path"); - } - - //// Generate the JSON structure of the input to service - var oUnpinParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url }, "matterData": { "MatterName": sMatterUrl } }, oParam = { - "container": oCurrentRow, "sCurrentMatterUrl": sMatterUrl - }; - - oCommonObject.callSearchService("RemovePinnedMatter", oUnpinParameters, unpinMatterSuccess, unpinMatterFailure, null, oParam); - } -} - -/* Function to be called before getting pinned matters */ -function getPinnedMatterBeforeSend(result) { - "use strict"; - var container = result.oParam.container; - $("#loadingImageContainer").removeClass("hide"); -} - -/* Function for success of getting pinned matters */ -function getPinnedMatterSuccess(result) { - "use strict"; - $("#gridViewContainer_Grid").find(".lazyLoading").addClass("hide"); - if (result && $.trim(result.Result)) { - var sData = result.Result.split("$|$"); //// sData[0] = Pinned Matters collection, sData[1] = count of pinned matters - var pinnedMatters = JSON.parse(sData[0]); - oCommonObject.pinnedData = []; - oCommonObject.pinnedData.push(sData[0]); - if (!pinnedMatters.code || "0" === pinnedMatters.code) { - //// Pinned matters exists for the current logged in user - if ("undefined" !== typeof sData[1] && parseInt(sData[1], 10)) { - oCommonObject.userPinnedData.length = 0; //// Refresh the array which holds the user pinned matter - //// Add user's pinned matters name in the array - $.each(pinnedMatters, function (iCurrentIndex, oCurrentObject) { - if (oCurrentObject) { - var sMatterUrl = $.trim(oCurrentObject.MatterUrl); - if (sMatterUrl) { - oCommonObject.userPinnedData.push(sMatterUrl); - } - } - }); - oCommonObject.updatePinnedStatus(); - - //// Show the pinned data in grid view only if, user selects from drop down - (4 === oCommonObject.iCurrentGridViewData()) && oGridView.loadGridView(sData[0], true); //// Always pass true as no lazy loading expected in pinned section - } else { - // No pinned matters exists for user. - sData[1] = 0; - oCommonObject.userPinnedData.length = 0; - (4 === oCommonObject.iCurrentGridViewData()) && $("#gridViewContainer").html("" + oFindMatterConstants.Failure_No_Pinned_Matters + ""); - $("#loadingImageContainer").addClass("hide"); - } - } else { - showCommonErrorPopUp(pinnedMatters.code); - } - } -} - -/* Function for failure of getting pinned matters */ -function getPinnedMatterFailure(result) { - "use strict"; - oGridViewObject.waitTillDataLoaded = false; - showCommonErrorPopUp(result.Result); -} - -/* Function to get the pinned matters on page load */ -function getPinnedMatters(oContainer) { - "use strict"; - var oPinnedMatterDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oGlobalConstants.Central_Repository_Url } } - , oParam = { - "container": oContainer - }; - - oCommonObject.callSearchService("FindUserPinnedMatter", oPinnedMatterDetails, getPinnedMatterSuccess, getPinnedMatterFailure, getPinnedMatterBeforeSend, oParam); -} -//// #endregion - -//// #region Common Functions -/* Function to update the ECB actions in the ECB menu */ -function updateECBforMatter(oContextualMenu, oSelectedElement) { - "use strict"; - var bIsReadOnlyUser = "", isPinned = "", sMatterUrl = "", matterName = "", siteName = ""; - var $Element = oSelectedElement; - if ($Element) { - if (4 === oCommonObject.iCurrentGridViewData()) { - siteName = $Element.attr("data-matterclienturl") ? oCommonObject.renderAsText($Element.attr("data-matterclienturl").trim()) : "NA"; - bIsReadOnlyUser = oSelectedElement.attr("data-hideupload"); - isPinned = true; - sMatterUrl = oSelectedElement.attr("data-matterurl"); - //// Changes for URL consolidation - matterName = (null !== $Element.attr("data-MatterGuid")) ? $Element.attr("data-MatterGuid") : ($Element.attr("data-mattername") ? $Element.attr("data-mattername").trim() : "NA"); - } else { - siteName = $Element.attr("data-" + oGlobalConstants.Site_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Site_Name).trim()) : "NA"; - bIsReadOnlyUser = oSelectedElement.attr("data-isreadonlyuser"); - isPinned = oSelectedElement.attr("data-ispinned"); - sMatterUrl = oSelectedElement.attr("data-path"); - //// Changes for URL consolidation - matterName = ("null" !== $Element.attr("data-" + oGlobalConstants.Matter_GUID)) ? $Element.attr("data-" + oGlobalConstants.Matter_GUID) : ($Element.attr("data-" + oGlobalConstants.Matter_Name) ? $Element.attr("data-" + oGlobalConstants.Matter_Name).trim() : "NA"); - } - } - var sOneNoteUrl = siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + oGlobalConstants.OneNoteLibrary_Name_Suffix + "/" + matterName + "/" + matterName + oFindMatterConstants.OneNoteTableOfContentsExtension + "$|$" + siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oFindMatterConstants.OneNoteTableOfContentsExtension - , sMatterLandingPageUrl = siteName.replace(oGlobalConstants.Site_Url, "") + "/" + oGlobalConstants.Matter_Landing_Page_Repository + "/" + matterName + oFindMatterConstants.MatterLandingPageExtension + "$|$" + siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oFindMatterConstants.MatterLandingPageExtension; - - //// Disable the upload option for read only user - if (bIsReadOnlyUser && $.parseJSON(bIsReadOnlyUser)) { - oContextualMenu.find(".upload").addClass("is-disabled"); - oContextualMenu.find(".upload").attr("disabled", "disabled"); - } else { - oContextualMenu.find(".upload").removeClass("is-disabled"); - oContextualMenu.find(".upload").removeAttr("disabled"); - } - //// Disable the pin/unpin options based on the status of pinned matter - if (isPinned && $.parseJSON(isPinned)) { - oContextualMenu.find(".pin").parent().addClass("removeECBItem"); - oContextualMenu.find(".unpin").parent().removeClass("removeECBItem"); - } else { - oContextualMenu.find(".pin").parent().removeClass("removeECBItem"); - oContextualMenu.find(".unpin").parent().addClass("removeECBItem"); - } - //// Set the URL for go to Matter Sites - oCommonObject.checkMatterLandingURL(siteName, sOneNoteUrl, sMatterLandingPageUrl, sMatterUrl, oContextualMenu); -} - -/* Converts and return date to UTC format */ -function validateDateFormat(sDateToBeProcessed) { - "use strict"; - var oDates = new Date(sDateToBeProcessed); - if (isNaN(oDates)) { - var arrSplitedDate = sDateToBeProcessed.replace(/[-]/g, "/"); - arrSplitedDate = arrSplitedDate.split("/"); - var sFormattedDate = arrSplitedDate[1] + "-" + arrSplitedDate[0] + "-" + arrSplitedDate[2]; - oDates = new Date(sFormattedDate); - } - return oDates.toISOString(); -} - -//// #endregion - -//// #region events for upload popup and drill down on folders - -// This region will be common for search matter and web dashboard. Is taken from filterPanel.js -var $MailBodyElement = $("#mailBody"); - -$MailBodyElement.on("dblclick", ".folderStructureContent ul li ul li", function (e) { - "use strict"; - e.stopPropagation(); - e.stopImmediatePropagation(); - e.preventDefault(); - oUploadGlobal.oDrilldownParameter.nCurrentLevel++; - commonFunction.drilldownNavigation(e); - $(".folderStructureContent, .parentNode").addClass("folderStructureWithBreadcrumb"); -}); - -$MailBodyElement.on("dragover", ".folderStructureContent ul li", function (e, ui) { - "use strict"; - e.stopImmediatePropagation(); - $(this).addClass("folderDragOver"); -}); - -$MailBodyElement.on("dragleave", ".folderStructureContent ul li", function (e, ui) { - "use strict"; - $(this).removeClass("folderDragOver"); -}); - -$MailBodyElement.on("click", "#rootLink", function () { - "use strict"; - commonFunction.clearGlobalVariables(); - var htmlChunk = buildNestedList(oSearchGlobal.oFolderName, null); - if ("undefined" !== typeof htmlChunk) { - $(".folderStructureContent").html(htmlChunk); - } - if ("undefined" !== typeof bindDroppable) { - bindDroppable($(".folderStructureContent ul li")); - } - $(".folderStructureContent, .parentNode").removeClass("folderStructureWithBreadcrumb"); -}); - -$MailBodyElement.on("click", "#parentFolder", function (e) { - "use strict"; - oUploadGlobal.oDrilldownParameter.nCurrentLevel--; - commonFunction.drilldownNavigation(e); -}); - -/// Office.js Initialization -(function () { - "use strict"; - // The Office initialize function must be run each time a new page is loaded - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Outlook) { - Office.initialize = function (reason) { - }; - } -})(); - -function attachmentTokenCallbackEmailClient(asyncResult, userContext) { - "use strict"; - if ("succeeded" === asyncResult.status) { - oSearchGlobal.oServiceRequest.attachmentToken = asyncResult.value; - createMailPopup(); - } else { - showNotification(oFindMatterConstants.Fail_Attachment_Token, "failNotification"); - } -} - -// Function to check if string empty or not. -function checkEmptyorWhitespace(input) { - "use strict"; - if (/\S/.test(input)) { - return input; - } - return oFindMatterConstants.No_Subject_Mail; -} - -/* Function to populate folder structure based for matter library */ -function populateFolderHierarchy(element) { - "use strict"; - $(".loadingImage").css("position", "absolute"); - - var sMatterName, sMatterUrl, oMatterFolderDetails; - //// Get the meta-data based on current view (flag = 4 for pinned view) - if (4 === oCommonObject.iCurrentGridViewData()) { - sMatterName = $(element).attr("data-mattername"); - sMatterUrl = $(element).attr("data-matterclienturl"); - } else { - //// Changes for URL consolidation - sMatterName = ($(element).attr("data-" + oGlobalConstants.Matter_Name)) ? $(element).attr("data-" + oGlobalConstants.Matter_Name).trim() : "NA"; - sMatterUrl = $(element).attr("data-sitename"); - } - - oMatterFolderDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "matterData": { "MatterName": sMatterName, "MatterUrl": sMatterUrl } - }; - - oSearchGlobal.matterUrl = sMatterUrl; - - oCommonObject.callSearchService("GetFolderHierarchy", oMatterFolderDetails, folderHierarchySuccess, folderHierarchyFailure, folderHierarchyBeforeCall, $(element)); -}; - -/* Function to display Matter flyout */ -function showMatterDetailPopup(element, event, bUpload) { - "use strict"; - var flyoutExist = $("#gridViewContainer .InfoFlyout"); - if (!(flyoutExist.length)) { - var sFlyoutHTMLChunk = $(".InfoFlyout").length && $(".InfoFlyout").clone() && $(".InfoFlyout").clone()[0]; - $("#gridViewContainer").append(sFlyoutHTMLChunk); - $(".FlyoutUrlTextbox").on("click", function (event) { - event && event.stopPropagation(); - }); - } - flyoutExist = $("#gridViewContainer .InfoFlyout"); //// Get the fly out again to get the updated chunk - flyoutExist.find(".ms-Callout-inner").addClass("hide"); - flyoutExist.removeClass("hide"); - flyoutExist.find("#FlyoutPopupLoading").removeClass("hide"); - var matterPopData = $(".InfoFlyout .ms-Callout-inner"), $Element = $(element); - if (matterPopData.length && $Element) { - if (4 === oCommonObject.iCurrentGridViewData()) { - //// Changes for URL consolidation - var matterName = (null !== $Element.attr("data-MatterGuid")) ? $Element.attr("data-MatterGuid") : ($Element.attr("data - mattername") ? $Element.attr("data - mattername").trim() : "NA"), - siteName = $Element.attr("data-matterclienturl") ? oCommonObject.renderAsText($Element.attr("data-matterclienturl").trim()) : "NA", - clientName = $Element.attr("data-matterclient") ? oCommonObject.renderAsText($Element.attr("data-matterclient").trim()) : "NA", - subAreaOfLaw = $Element.attr("data-mattersubareaoflaw") ? oCommonObject.renderAsText($Element.attr("data-mattersubareaoflaw").trim()) : "NA", - matterURL = $Element.attr("data-matterclienturl") && matterName ? oCommonObject.renderAsText(siteName + "/" + matterName) : "NA", - matterClientID = $Element.attr("data-matterclientid") ? oCommonObject.renderAsText($Element.attr("data-matterclientid").trim()) : "NA", - matterMatterID = $Element.attr("data-matterid") ? oCommonObject.renderAsText($Element.attr("data-matterid").trim()) : "NA", - matterResponsibleAttorney = $Element.attr("data-matterresponsibleattorney") ? oCommonObject.renderAsText($Element.attr("data-matterresponsibleattorney").trim()) : "NA", - //// Changes for URL consolidation - matterOriginalName = $Element.attr("data-mattername") ? oCommonObject.renderAsText($Element.attr("data-mattername").trim()) : "NA"; - } else { - var matterName = ("null" !== $Element.attr("data-" + oGlobalConstants.Matter_GUID)) ? $Element.attr("data-" + oGlobalConstants.Matter_GUID) : ($Element.attr("data-" + oGlobalConstants.Matter_Name) ? $Element.attr("data-" + oGlobalConstants.Matter_Name).trim() : "NA"), - siteName = $Element.attr("data-" + oGlobalConstants.Site_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Site_Name).trim()) : "NA", - clientName = $Element.attr("data-" + oGlobalConstants.Client_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Client_Name).trim()) : "NA", - subAreaOfLaw = $Element.attr("data-" + oGlobalConstants.Sub_Area_Of_Law) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Sub_Area_Of_Law).trim()) : "NA", - matterURL = $Element.attr("data-" + oGlobalConstants.Path) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Path).trim()) : "NA"; - matterClientID = $Element.attr("data-" + oGlobalConstants.Client_ID) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Client_ID).trim()) : "NA", - matterMatterID = $Element.attr("data-" + oGlobalConstants.Matter_ID) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Matter_ID).trim()) : "NA", - matterResponsibleAttorney = $Element.attr("data-" + oGlobalConstants.Responsible_Attorney) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Responsible_Attorney).trim()) : "NA", - //// Changes for URL consolidation - matterOriginalName = $Element.attr("data-" + oGlobalConstants.Matter_Name) ? oCommonObject.renderAsText($Element.attr("data-" + oGlobalConstants.Matter_Name).trim()) : "NA"; - } - var documentLibraryURL = matterURL; - documentLibraryURL = documentLibraryURL.replace(oFindMatterConstants.Document_Library_EndURL, "/"); - //// Trim semi colon from the end if it is present - subAreaOfLaw = trimEndChar(subAreaOfLaw, ";"); - matterResponsibleAttorney = trimEndChar(matterResponsibleAttorney, ";"); - matterPopData.find(".FlyoutHeadingText").attr({ "title": matterOriginalName, "data-mattername": matterName, "data-OriginalName": matterOriginalName, "data-client": siteName, "data-subareaoflaw": subAreaOfLaw, "data-matterurl": siteName + "/" + matterName + "/" + matterName + ".aspx", "data-clientName": clientName }).text(matterOriginalName); - matterPopData.find(".FlyoutClientName").attr({ "data-client": clientName }).html("
    Client:
    " + decodeURIComponent(clientName) + "
    "); - matterPopData.find(".FlyoutClientMatterID").attr({ "data-clientid": matterClientID, "data-matterid": matterMatterID }).html("
    Client.Matter ID:
    " + matterClientID + oGlobalConstants.ClientID_MatterID_Separator + matterMatterID + "
    "); - matterPopData.find(".FlyoutSubAreaoflaw").attr({ "data-practicegroup": subAreaOfLaw }).html("
    Sub area of law:
    " + subAreaOfLaw + "
    "); - matterResponsibleAttorney = matterResponsibleAttorney.replace(/;/g, ","); - matterResponsibleAttorney = $.trim(matterResponsibleAttorney) && trimEndChar($.trim(matterResponsibleAttorney), ","); - matterPopData.find(".FlyoutResponsibleAttorney").attr({ "data-matterresponsibleattorney": matterResponsibleAttorney }).html("
    Responsible attorney:
    " + matterResponsibleAttorney + "
    "); - matterPopData.find(".FlyoutUrlHeading").text("Save the document to this location"); - matterPopData.find(".FlyoutUrlText").text("URL:"); - matterPopData.find(".FlyoutUrlTextbox").val(documentLibraryURL); - $("#openDocument").addClass("hide"); - $("#viewDocumentLandingPage").addClass("hide"); - ////If outlook view then Show "upload to matter" Button else show textbox - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Office) { - flyoutExist.find(".FlyoutUrlHeading").removeClass("hide"); - flyoutExist.find(".FlyoutUrl").removeClass("hide"); - flyoutExist.find("#uploadToMatter").addClass("hide"); - } else { - flyoutExist.find(".FlyoutUrlHeading").addClass("hide"); - flyoutExist.find(".FlyoutUrl").addClass("hide"); - flyoutExist.find("#uploadToMatter").removeClass("hide"); - flyoutExist.find("#uploadToMatter").on("click", function () { - //// Use oGridViewObject.oCurrentMandatory object for getting current mandatory column - populateFolderHierarchy($Element); - }); - var bIsReadOnlyUser = $Element.attr("data-isreadonlyuser"); - if (bIsReadOnlyUser === "true") { - flyoutExist.find("#uploadToMatter").addClass("is-disabled"); - flyoutExist.find("#uploadToMatter").attr("disabled", "disabled"); - } else { - flyoutExist.find("#uploadToMatter").removeClass("is-disabled"); - flyoutExist.find("#uploadToMatter").removeAttr("disabled"); - } - } - var sOneNoteUrl = siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + oGlobalConstants.OneNoteLibrary_Name_Suffix + "/" + matterName + "/" + matterName + oFindMatterConstants.OneNoteTableOfContentsExtension + "$|$" + siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oFindMatterConstants.OneNoteTableOfContentsExtension - , sMatterLandingPageUrl = siteName.replace(oGlobalConstants.Site_Url, "") + "/" + oGlobalConstants.Matter_Landing_Page_Repository + "/" + matterName + oFindMatterConstants.MatterLandingPageExtension + "$|$" + siteName.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oFindMatterConstants.MatterLandingPageExtension; - placeMatterDetailsPopup(element, event); - urlExists(siteName, matterName, sOneNoteUrl, sMatterLandingPageUrl, matterURL); - } -} - -/* Function to adjust position of flyout according to word view and outlook view*/ -function placeMatterDetailsPopup(element, event) { - "use strict"; - ////Following code is written in Java Script because we already have QueryString Implementation for word and outlook, and to avoid code Repetition in CSS. - var nWindowWidth = $(window).width(); - var oFlyout = $("#gridViewContainer .InfoFlyout"); - if (nWindowWidth <= 645) { - oFlyout.find(".FlyoutHeading").addClass("FlyoutHeadingWordMargin"); - oFlyout.find(".ms-Callout-inner").addClass("FlyoutBoxContent"); - oFlyout.find(".FlyoutBox").addClass("MatterFlyoutWordSize"); - oFlyout.find(".FlyoutContentHeading").css("float", "none"); - var flyoutArrowExist = $("#gridViewContainer .InfoFlyout").find(".flyoutToparrow"); - if (!flyoutArrowExist.length) { - oFlyout.prepend("
    "); - } - oFlyout.css({ top: ($(element).position().top + 25) }); - if (!(oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Office)) { - oFlyout.find(".FlyoutBox").addClass("OutlookMatterFlyoutWordSize"); - } - } else { - oFlyout.find(".FlyoutBox").addClass("MatterFlyoutOutlookSize"); - var flyoutArrowExist = $("#gridViewContainer .InfoFlyout").find(".flyoutLeftarrow"); - if (!flyoutArrowExist.length) { - oFlyout.prepend("
    "); - oFlyout.addClass("MatterFlyoutLeftMove"); - } - if ($(element).offset().top < 220) { - oFlyout.find(".flyoutLeftarrow").css("top", $(element).offset().top - 75); - oFlyout.css({ "top": (($(element).position().top - $(element).offset().top)) + 83 }); - } else { - oFlyout.css("top", Math.floor($(element).position().top) - 122); - oFlyout.find(".flyoutLeftarrow").css("top", "128"); // If we use ADD and REMOVE class CSS won't override calculated top - } - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Office) { - oFlyout.find(".FlyoutBox").addClass("WordMatterFlyoutOutlookSize"); - } - } - if (null != event) { - event.stopPropagation(); - } -} - -/*Function to handle check if URL exist or not*/ -function urlExists(sClientURL, sMatterName, sOneNoteURL, sMatterLandingPageURL, sMatterLibraryURL) { - "use strict"; - var sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sClientURL }, requestedUrl: sOneNoteURL, requestedPageUrl: sMatterLandingPageURL }, oParam = { "sitename": sClientURL, "matterName": sMatterName, "matterLibraryURL": sMatterLibraryURL }; - oCommonObject.callSearchService("UrlExists", sParameters, onURLExistSuccess, onURLExistFailure, null, oParam); -} - -/* Function to handle success call*/ -function onURLExistSuccess(result) { - "use strict"; - //// Handle the true and false responses for the Matter Landing page and OneNote TOC - if (result && result.Result) { - var oSplitResults = result.Result.split("$|$"); - if (2 === oSplitResults.length) { - var oMatterLandingPageResult = oSplitResults[1].split("$#$"); - var anchorElement = document.createElement("a"); - anchorElement.href = result.oParam.sitename; - var oMatterPopData = $(".InfoFlyout .ms-Callout-inner"), sMatterPageLink; - //// Set the link to the Matter Landing page or to the All Items page based on the value returned - if (oMatterLandingPageResult && 2 === oMatterLandingPageResult.length) { - sMatterPageLink = "true" === oMatterLandingPageResult[0] ? anchorElement.protocol + "//" + anchorElement.hostname + oMatterLandingPageResult[1] : result.oParam.matterLibraryURL; - } else { - sMatterPageLink = result.oParam.matterLibraryURL; - } - if (oMatterPopData[0]) { - oMatterPopData.find("#viewMatters").attr({ "data-matterlink": sMatterPageLink, "onclick": "viewMatter(this);" }); - } - $("#FlyoutPopupLoading").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find(".ms-Callout-inner").removeClass("hide"); - } else { - onURLExistFailure(result); - } - } -} -/* Function to handle failed call*/ -function onURLExistFailure(result) { - "use strict"; - //// Do not display the OneNote link - if (result && result.oParam && result.oParam.matterLibraryURL) { - var oMatterPopData = $(".InfoFlyout .ms-Callout-inner"), - sMatterPageLink = result.oParam.matterLibraryURL; - if (oMatterPopData[0]) { - oMatterPopData.find("#viewMatters").attr({ "data-matterlink": sMatterPageLink, "onclick": "ViewMatter(this);" }); - } - } - //// Finally show the data - $("#FlyoutPopupLoading").addClass("hide"); - $("#gridViewContainer .InfoFlyout").find(".ms-Callout-inner").removeClass("hide"); -} -//// #endregion - -$(document).ready(function () { - "use strict"; - oCommonObject.isMatterView = true; //// Flag to identify Search Matter page - oCommonObject.sCurrentPage = oGlobalConstants.App_Name_Search_Matters; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oCommonObject.sCurrentPage, true); - $(".AppHeader").removeClass("hide"); //// Display the app header - $.event.props.push("dataTransfer"); - getContextualHelpData(1); - $.ajax({ - url: "CommonControls.html?ver=25.0.0.0", - success: function (response) { - $("#HeaderPlaceHolder").html($(response).find("#commonSearchBar").html()); - $("#autoCompletePlaceHolder").attr("title", oFindMatterConstants.AutoComplete_Placeholder).text(oFindMatterConstants.AutoComplete_Placeholder); - $("#gridView").html($(response).find("#gridViewContent").html()); - $(".textFlyoutContent").html($(response).find("#textFlyoutContent").html()); - $(".dateFlyoutContent").html($(response).find("#dateFlyoutContent").html()); - $(".clearFilterContent").html($(response).find("#clearFilterContent").html()); - $(".textFlyoutContent .clearFilterContent").find(".clearFilterText").attr("data-clearFilterType", "text"); - $(".dateFlyoutContent .clearFilterContent").find(".clearFilterText").attr("data-clearFilterType", "date"); - $(".InfoFlyout").html($(response).find(".commonFlyout").html()); - //// Generate the common drop down and place it on page - oCommonObject.generateCommonDropdown("#searchPanelDropdown", oFindMatterConstants.SearchDropdownFields); - //// Generate the column picker and place it on page - oCommonObject.generateColumnPicker("#columnPickerPanel #columnPickerBlock #columnOptions", oFindMatterConstants.GridViewColumnPickerFields); - oCommonObject.addDropdownBindings(); - oCommonObject.addAutoCompleteBindings(); - oCommonObject.addColumnPickerBindings(); - oGridView.loadECBControl(); - oGridView.adjustGridViewHeight(); - oGridView.applyMapContainerHeight(); - $(".ms-Dropdown-title, #gridViewPageHeader").attr("title", oGlobalConstants.My_Matters_Message).text(oGlobalConstants.My_Matters_Title); //// Set the drop down title and page header to My Matters on page load - oCommonObject.addFilterFlyoutBindings(); - } - }); - $.ajax({ - url: "filterpanel.html?ver=25.0.0.0", - success: function (response) { - $("#mailBody").html($(response).find("#commonMailBody").html()); - $("#popupFooterText").text(oGlobalConstants.Upload_Footer_Text); - } - }); - $(document).on("click", ".nameColumn", function (event) { - showMatterDetailPopup(this, event, "false"); - oCommonObject.closeAllPopupExcept("InfoFlyout", event); - }); -}); - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SendToOneDrive.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SendToOneDrive.js deleted file mode 100644 index cdc9c58c..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/SendToOneDrive.js +++ /dev/null @@ -1,278 +0,0 @@ -/// JS2074,JS3116,JS3092,JS2024,JS2076,JS3058,JS2032,JS2064,JS3056 -var appInsights = ""; - -var oGlobalConstants = { - sRelaxMsg: "Sit back and Relax!", - sSendToOneDriveMsg: "We are sending document(s) to OneDrive", - sOverWriteMsg: "@@FileName already exists in your OneDrive.
    Do you want to overwrite it?", - sGenericSuccessMsg: "Success!", - sGenericErrorMsg: "Failure!", - sSuccessMsg: "Documents sent to OneDrive!", - sFailureMsg: "Some Error Occurred", - sCheckOutFailMsg: "Error occurred while checking out the document", - sInvalidFilesMsg: "Please select documents only", - bOverwrite: false, - arrOverwriteFiles: [], - iCurrent: 0, - bCheckedOut: false -}; - -// Function is used to read parameter from the URL -function getParameterByName(name) { - "use strict"; - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -} - - -// Function is used to make call to service for retrieving the URL of the selected items -function callService(listId, listItemId, currentURL) { - "use strict"; - var requestObject = { "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "listId": listId, "listItemId": listItemId, "currentLocation": currentURL }; - oCommonObject.callLegalBriefcase("GetFileRelativeLocation", requestObject, onRelativeLocationSuccess, onFailure, null, null); -} - -function onRelativeLocationSuccess(msg) { - "use strict"; - var relativeLocations = msg; - oGlobalConstants.bCheckedOut = false; - if ("false" !== relativeLocations && relativeLocations) { - var requestData = formulateRequest(relativeLocations, 0); - oCommonObject.callLegalBriefcase("CheckedOutDocumentByUser", requestData, onCheckedOutDataSuccess, DiscardFailure, null, null); - callSendToOneDrive(requestData, onSendToOneDriveSuccess); - } else { - displayErrorMessage(msg); - } -} - -// Success function to be called when ajax request successfully executed -function onCheckedOutDataSuccess(msg) { - "use strict"; - if (msg && "" !== msg[0]) { - oGlobalConstants.bCheckedOut = true; - } -} - -// Failure function to be called when ajax request is not executed -function onFailure(msg) { - "use strict"; - displayErrorMessage("Error"); -} - -// Document ready function -$(document).ready(function () { - "use strict"; - displayLoading(); - var listItemId = [getParameterByName("SPListItemId")]; - var listId = getParameterByName("SPListId"); - var currentURL = getParentUrl(); - currentURL = currentURL.substring(0, currentURL.indexOf("/_layouts")); - if ("" === listId.trim()) { - var currentListItemId = listItemId[0]; - listItemId[0] = listItemId[0] && listItemId[0].split("$|$") && listItemId[0].split("$|$")[0]; - listId = currentListItemId && currentListItemId.split("$|$") && currentListItemId.split("$|$")[1]; - currentURL = currentListItemId && currentListItemId.split("$|$") && currentListItemId.split("$|$")[2]; - } - listId = listId.replace("{", "").replace("}", ""); - callService(listId, listItemId, currentURL); -}); - -// Function is used to get URL of the parent window -function getParentUrl() { - "use strict"; - var isInIframe = (parent !== window), - parentUrl = null; - - if (isInIframe) { - parentUrl = document.referrer; - } - return parentUrl; -} - -// Function is used to display error message -function displayErrorMessage(sMsg) { - "use strict"; - $(".BigMessage").html(oGlobalConstants.sGenericErrorMsg); - if ("false" === sMsg) { - $(".Question").html(oGlobalConstants.sInvalidFilesMsg); - } else { - $(".Question").html(oGlobalConstants.sFailureMsg); - } - $(".LoadingImage").hide(); -} - -// Function is used to formulate response for the service -function formulateRequest(sServiceResponse, iOverWrite) { - "use strict"; - var requestObject = { - "requestObject": { "SPAppToken": "", "RefreshToken": oSharePointContext.RefreshToken }, "mailAttachmentDetails": { "FullUrl": sServiceResponse, "IsOverwrite": iOverWrite }, "doCheckOut": true - }; - return requestObject; -} - -// Function is used to call send to One Drive -function callSendToOneDrive(requestObject, successFunction) { - "use strict"; - oCommonObject.callLegalBriefcase("SendToBriefcase", requestObject, successFunction, onFailure, null, null); -} - -function onSendToOneDriveSuccess(msg) { - "use strict"; - var sResponse = JSON.parse(msg); - if (0 !== parseInt(sResponse.code, 10)) { - displayErrorMessage("Error"); - } else { - var sValue = sResponse.value, arrOverwriteFiles = []; - oGlobalConstants.arrOverwriteFiles = checkOverwriteStatus(sValue); - if (0 !== oGlobalConstants.arrOverwriteFiles.length) { - processOverwriteFiles(); - } - } -} - -// Function to check whether all the requests are executed -function checkOverwriteStatus(sValue) { - "use strict"; - if (sValue) { - var arrValues = sValue.split(";"); - if (2 < arrValues.length) { - if (arrValues[1] === arrValues[2]) { - displaySuccessMessage(); - return []; - } else { - var iterator = 3, iCount = arrValues.length, arrOverwriteFiles = []; - for (iterator = 3; iterator < iCount; iterator++) { - arrOverwriteFiles.push(arrValues[iterator]); - } - return arrOverwriteFiles; - } - } - return []; - } else { - return []; - } -} - -// Function is used to display success message -function displaySuccessMessage() { - "use strict"; - $(".BigMessage").html(oGlobalConstants.sGenericSuccessMsg).show(); - $(".LoadingImage").hide(); - $(".Question").html(oGlobalConstants.sSuccessMsg).show(); - $(".ButtonContainer").hide(); -} - -// Function is used to display loading message on the popup for Send to One Drive -function displayLoading() { - "use strict"; - $(".BigMessage").text(oGlobalConstants.sRelaxMsg); - $(".BigMessage").addClass("LoadingBigMessage").show(); - $(".Question").text(oGlobalConstants.sSendToOneDriveMsg); - $(".Question").addClass("LoadingQuestion"); - $(".LoadingImage").show(); - $(".ButtonContainer").hide(); - $(".Container").show(); -} - - -// Function is used to close popup -function closePopup() { - "use strict"; - closeParentDialog(true); -} - - -// Function is used to close popup dialog -function closeParentDialog(refresh) { - "use strict"; - var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : "undefined"); - if (refresh) { - target.postMessage("CloseCustomActionDialogRefresh", "*"); - } else { - target.postMessage("CloseCustomActionDialogNoRefresh", "*"); - } -} - -// Function is used to process over written files -function processOverwriteFiles() { - "use strict"; - displayOverwriteMessage(); -} - -// Function is used to display over write message -function displayOverwriteMessage() { - "use strict"; - $(".LoadingImage").hide(); - var sFileName = getFileName(oGlobalConstants.iCurrent); - $(".Question").html(oGlobalConstants.sOverWriteMsg.replace("@@FileName", sFileName)); - $(".ButtonContainer").show(); - $(".ButtonContainer").addClass("AdditionalMargin"); - $(".BigMessage").hide(); -} - -// Function is used to return file name from the URL -function getFileName(iCurrent) { - "use strict"; - var sFileName = oGlobalConstants.arrOverwriteFiles[iCurrent]; - sFileName = sFileName.substring(sFileName.lastIndexOf("/") + 1, sFileName.length); - return sFileName; -} - -// Function to be called on click of over write button -function overWriteFiles(bChoice) { - "use strict"; - if (bChoice && (oGlobalConstants.arrOverwriteFiles.length - 1) > oGlobalConstants.iCurrent) { - displayLoading(); - callSendToOneDrive(formulateRequest(oGlobalConstants.arrOverwriteFiles[oGlobalConstants.iCurrent], 1), checkOverwriteComplete); - } else { - oGlobalConstants.iCurrent++; - if ((oGlobalConstants.arrOverwriteFiles.length - 1) > oGlobalConstants.iCurrent) { - processOverwriteFiles(); - } else { - if (!oGlobalConstants.bCheckedOut) { - oCommonObject.callLegalBriefcase("DiscardCheckOutChanges", formulateRequest(oGlobalConstants.arrOverwriteFiles[0], 0), DiscardSuccess, DiscardFailure, null, null); - } else { - var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : "undefined"); - target.postMessage("CloseOneDriveActionDialog", "*"); - closePopup(); - } - } - } -} - -// Function to handle success scenario of successful checkout document -function DiscardSuccess(msg) { - "use strict"; - var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : "undefined"); - target.postMessage("CloseOneDriveActionDialog", "*"); - closePopup(); -} - -// Function to handle failure scenario of successful checkout document -function DiscardFailure(msg) { - "use strict"; - $(".ButtonContainer").hide(); - $(".Question").hide(); - $(".BigMessage").show().html(oGlobalConstants.sGenericErrorMsg); - $(".Question").show().html(oGlobalConstants.sCheckOutFailMsg); - $(".LoadingImage").hide(); -} - -// Function to be called when over write of the document is complete -function checkOverwriteComplete(msg) { - "use strict"; - var oResponse = JSON.parse(msg); - if (0 === parseInt(oResponse.code, 10)) { - oGlobalConstants.iCurrent++; - if ((oGlobalConstants.arrOverwriteFiles.length - 1) > oGlobalConstants.iCurrent) { - processOverwriteFiles(); - } else { - displaySuccessMessage(); - } - } else { - displayErrorMessage("Error"); - } -} - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Settings.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Settings.js deleted file mode 100644 index 1cc50558..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Settings.js +++ /dev/null @@ -1,1242 +0,0 @@ -/// JS1003,JS2005,JS2016,JS2023,JS2024,JS2026,JS2027,JS2031,JS2032,JS2052,JS2053,JS2064,JS2073,JS2074,JS2076,JS3054,JS3056,JS3057,JS3058,JS3085,JS3092,JS3116 -//// Above exclusion list is signed off as per the Modern Cop Exclusion list. - -// #region Global Declaration -/* Object to store all the global constants */ -var serviceConstants = { - sCentralRepositoryLocation: oGlobalConstants.Central_Repository_Url, - oTermStoreJson: {}, - bRole: false, - bPermission: false, - bContentType: false, - sPracticeGroupList: "", - sAreaOfLawList: "", - sSubAreaOfLawList: "", - oMandatoryRoles: [], - oMandatoryRoleNames: [], - arrReadOnlyUsers: [], - iLastRowNumber: 2, - bIsRoleProcessed: false, - bIsPermissionProcessed: false, - bIsContentTypeProcessed: false, - bIsConfigurationsRetrieved: false, - bIsContentTypeValuesSet: false, - bIsPermissionValuesSet: false, - clientUrl: "", - clientName: "", - bClientMode: false, - sItemModifiedDate: "", - sErrorModifiedDate: "0" -}, -/* Object to store all the JQuery binding elements used */ -oJQueryObjects = { - $Loading: "", - $LoadingLookUp: "", - $ContentTypes: "", - $AssignPermissions: "", - $ErrorPopUp: "", - $PracticeGroup: "", -}, -commonFunctions = {}; - -var serviceVariables = { - oTermStoreData: {}, - oMatterConfigurations: {} -}; - -/* Function to get the screen width */ -function getWidth() { - "use strict"; - var iWidth = 0; - if (self.innerHeight) { - iWidth = self.innerWidth; - } else if (document.documentElement && document.documentElement.clientHeight) { - iWidth = document.documentElement.clientWidth; - } else if (document.body) { - iWidth = document.body.clientWidth; - } - return iWidth; -} - -// Sets the footer at the end of window -function setHeight() { - "use strict"; - var oDifference = 100; - var oFooterPosition = $(".mainContainer").height() + oDifference + 110; - if ($(window).height() >= oFooterPosition) { - $("#footer").css("margin-top", $(window).height() - oFooterPosition); - } -} - -/* Function to close all pop up except the passed one */ -function closeAllPopupExcept(divClass) { - "use strict"; - if ("ddlClientList" !== divClass) { - $("#ddlClientList").addClass("hide"); - $(".ddlClientListItem").removeClass("ddListOnHover"); - } - if ("popUpPGList" !== divClass) { - $("#popUpPGList").addClass("hide"); - } - // Hide assign permission role drop-down - $(".ddlRoleAssignList").addClass("hide"); - // Hide Permission level drop-down - $(".ddlPermAssignList").addClass("hide"); -} - -// Function is used to read parameter from the URL -function getParameterByName(name) { - "use strict"; - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(decodeURIComponent(location.search)); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -} - -/* Function to remove team assignment row on click of delete image */ -function closePermissionRow(event) { - "use strict"; - closeAllPopupExcept(""); - if (1 < $(".assignNewPerm").length) { - $("." + event.currentTarget.parentElement.className.split(" ")[0]).remove(); - $(oJQueryObjects.$ErrorPopUp).addClass("hide"); - event.stopPropagation(); - } - setHeight(); -} - -/* Function to sort drop downs */ -function sortDropDownListByText() { - "use strict"; - // Loop for each select element on the page. - $("select").each(function () { //// Here we sort all the dropdowns present on DOM thus general selector is used - - // Keep track of the selected option. - var selectedValue = $(this).val(); - - // Sort all the options by text. I could easily sort these by val. - $(this).html($("option", $(this)).sort(function (a, b) { - return a.text === b.text ? 0 : a.text < b.text ? -1 : 1; - })); - - // Select one option. - $(this).val(selectedValue); - }); -} - -/* Function for search by typing on LookUp Pop up */ -function searchByTyping(sSelector, textValue) { - "use strict"; - var oDivContent = $(sSelector); - if (oDivContent[0]) { - oDivContent.show(); - if (textValue) { - $.each(oDivContent, function () { - if (-1 === $(this).text().toLowerCase().indexOf(textValue.toLowerCase())) { - $(this).hide(); - } - }); - } - oDivContent[0].click(); - } -} - -// Function is used to set the text of fields with that read from resource file -function setTextForFieldsOnPage(bIsClientMode) { - "use strict"; - if (oSettingsConstants) { - if (!bIsClientMode) { - $(".settingLink .clientLinks").attr("href", oGlobalConstants.Site_Url + oSettingsConstants.Settings_Page_Url).attr("target", "_parent"); - $(".pageDescription").text(oSettingsConstants.Page_Default_Description); - $(".defaultSection .titleSection").text(oSettingsConstants.Default_Values_Section_Title); - $(".defaultSection .descriptionSection").text(oSettingsConstants.Default_Values_Section_Description); - $("#matterId").text(oSettingsConstants.Matter_Id_Default_Title); - $("#matterIdSection .labelSection .contentDescription").text(oSettingsConstants.Matter_Id_Default_Description); - $("#matterName").text(oSettingsConstants.Matter_Name_Default_Title); - $("#matterNameSection .labelSection .contentDescription").text(oSettingsConstants.Matter_Name_Default_Description); - $("#defaultMatterTypeDescription").text(oSettingsConstants.Matter_Type_Default_Title); - $("#restrictAccessTitle").text(oSettingsConstants.Restricted_Access_Default_Title); - $("#restrictAccessSection .contentDescription").text(oSettingsConstants.Restricted_Access_Description); - $("#assignPermissionsTitle").text(oSettingsConstants.Assign_Team_Permission_Title); - $("#labelName").text(oSettingsConstants.Name_Column_Text); - $("#labelRole").text(oSettingsConstants.Role_Column_Text); - $("#labelPermissionLevel").text(oSettingsConstants.Permission_Column_Text); - $("#addMoreLink").text(oSettingsConstants.Add_More_Link); - $("#calendarSection .labelSection").text(oSettingsConstants.Include_Calendar_Default_Title); - $("#rssSection .labelSection").text(oSettingsConstants.Include_RSS_Feeds_Default_Title); - $("#emailNotificationSection .labelSection").text(oSettingsConstants.Include_Email_Notification_Default_Title); - $("#tasksSection .labelSection").text(oSettingsConstants.Include_Tasks_Title); - $("#matterOptionsSection .titleSection").text(oSettingsConstants.Set_Matter_Options_Default_Title); - $("#matterOptionsSection .descriptionSection").text(oSettingsConstants.Set_Matter_Options_Default_Description); - $("#matterDescriptionTitle").text(oSettingsConstants.Matter_Description_Required_Title); - $("#matterDescriptionSection .contentDescription").text(oSettingsConstants.Matter_Description_Field_Description); - $("#conflictCheckTitle").text(oSettingsConstants.Matter_Conflict_Check_Title); - $("#conflictCheckSection .contentDescription").text(oSettingsConstants.Matter_Conflict_Check_Description); - $("#saveButton").text(oSettingsConstants.Save_Button_Text).attr("title", oSettingsConstants.Save_Button_Text); - $("#cancelButton").text(oSettingsConstants.Cancel_Button_Text).attr("title", oSettingsConstants.Cancel_Button_Text); - $("#successMessage").html(oSettingsConstants.Save_Success_Message); - $("#hideMatterTypeSection").html(oSettingsConstants.Matter_Type_Hidden_Message); - $("#matterTypeTitle").text(oSettingsConstants.Matter_Type_Column_Title).attr("title", oSettingsConstants.Matter_Type_Column_Title); - $(".searchByTyping").text(oSettingsConstants.Search_By_Typing_Placeholder).attr("placeholder", oSettingsConstants.Search_By_Typing_Placeholder); - $("#subAreaOfLawTitle").text(oSettingsConstants.Sub_Area_Law_Text).attr("title", oSettingsConstants.Sub_Area_Law_Text); - $("#areaOfLawTitle").text(oSettingsConstants.Area_Law_Text).attr("title", oSettingsConstants.Area_Law_Text); - $("#practiceGroupTitle").text(oSettingsConstants.Select_Practice_Group).attr("title", oSettingsConstants.Select_Practice_Group); - $(".iconForward").attr("title", oSettingsConstants.Icon_Title_Forward); - $(".iconBack").attr("title", oSettingsConstants.Icon_Title_Backward); - $("#imgDelete").attr("title", oSettingsConstants.Delete_Icon_Title); - $("#showMatterSection").html(oSettingsConstants.Show_Matter_Section); - } else { - $("#clientContainer .clientName").text(oSettingsConstants.Clients_Header); - $("#clientContainer .clientDescription").text(oSettingsConstants.Clients_View_Message); - $("#clientContainer .tableContainer").text(oSettingsConstants.Client_Name); - } - } -} - -/* Function to toggle element */ -function toggleThisElement($Element) { - "use strict"; - if ($Element.is(":visible")) { - $Element.addClass("hide"); - } else { - $Element.removeClass("hide"); - } -} - -/* Function to populate pop-up data */ -function populateMatterTypes() { - "use strict"; - var iCount = 0, iLength = serviceConstants.oTermStoreJson.PGTerms.length, sFolderNames; - localStorage.removeItem("iSelectedPG"); - localStorage.removeItem("iSelectedAOL"); - - for (iCount = 0; iCount < iLength; iCount++) { - sFolderNames = serviceConstants.oTermStoreJson.PGTerms[iCount].FolderNames ? serviceConstants.oTermStoreJson.PGTerms[iCount].FolderNames : ""; - oJQueryObjects.$PracticeGroupList.append("
    " + serviceConstants.oTermStoreJson.PGTerms[iCount].TermName + "
    "); - } - - $(".popUpOptions").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - $(".popUpOptions").click(function () { - $(".popUpMDTextArea").val(""); - var selectedPG = this.innerHTML, $Element = $("#popUpPG"); - $Element.val(selectedPG).attr("data-value", $(this).attr("data-value")).attr("data-foldernamespg", $(this).attr("data-foldernamespg")); - $("#popUpPGList").addClass("hide"); - if ($.isEmptyObject(serviceVariables.oTermStoreData)) { - serviceVariables.oTermStoreData = serviceConstants.oTermStoreJson; - } - var oAOL = $(".popUpMD"), sFolderNames; - $(".popUpMDContent, .popUpSALContent").remove(); - localStorage.iSelectedPG = $(".popUpPG").attr("data-value"); - for (var jIterator = 0; jIterator < serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms.length; jIterator++) { - // Addition of folder names - sFolderNames = serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].FolderNames ? serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].FolderNames : ""; - oAOL.append("
    " + serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[jIterator].TermName + "
    "); - } - - $(".popUpMD .popUpMDContent:first-child").click(); - }); - - $($(".popUpOptions")[0]).click(); - oJQueryObjects.$LoadingLookUp.addClass("hide"); - sortDropDownListByText(); -} - -/* Functions for retrieving roles */ -commonFunctions.getRoleSuccess = function (result) { - "use strict"; - var $RoleObject = $("#ddlRoleAssignList1"); - $RoleObject.empty(); - var arrResults = JSON.parse(result), roleItem, roleOption, arrOptions = [], iIterator = 0, iLength; - if (!arrResults.code) { - serviceConstants.oMandatoryRoles = arrResults; - serviceConstants.arrRoles = JSON.parse(JSON.stringify(arrResults)); - for (roleItem in arrResults) { - roleOption = "
    " + arrResults[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - iLength = serviceConstants.oMandatoryRoles.length; - for (iIterator = 0; iIterator < iLength; iIterator++) { - if (serviceConstants.oMandatoryRoles[iIterator].Mandatory) { - serviceConstants.oMandatoryRoleNames.push(serviceConstants.oMandatoryRoles[iIterator].Name); - } - } - $RoleObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlRoleAssignDiv").click(function (event) { - closeAllPopupExcept(""); - var $Element = $RoleObject; - toggleThisElement($Element); - var windowWidth = getWidth(); - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 10); - $RoleObject.css("left", parseInt($(this).position().left, 10) + 1); - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $("#ddlRoleAssignList1").addClass("hide"); - $(".assignPerm1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - // Default selection should be Responsible Attorney - $($(".assignPerm1")[0]).click(); - serviceConstants.bIsRoleProcessed = true; - if (serviceConstants.bIsPermissionProcessed && serviceConstants.bIsConfigurationsRetrieved) { - setDefaultPermissions(); - } - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#matterNameSection input", arrResults.value); - $(window).scrollTop(0); - } - } - serviceConstants.bRole = true; -}; -commonFunctions.getRoleFailure = function (result) { - "use strict"; - return false; -}; -commonFunctions.getRole = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { - "Url": sClientUrl - } - }; - - oCommonObject.callProvisioningService("GetRoleData", matterDetails, commonFunctions.getRoleSuccess, commonFunctions.getRoleFailure); -}; - -// Assigns the default permissions from the configurations -function setDefaultPermissions() { - "use strict"; - // Check if permissions values are not set - if (!serviceConstants.bIsPermissionValuesSet) { - $(".loadingIconAssignPermission").addClass("hide"); - serviceConstants.bIsPermissionValuesSet = !serviceConstants.bIsPermissionValuesSet; - if (serviceVariables.oMatterConfigurations.MatterUsers) { - $(".assignNewPerm").remove(); - - var arrUsers = serviceVariables.oMatterConfigurations.MatterUsers.split("$|$") -, arrUserEmails = [] - , arrRoles = serviceVariables.oMatterConfigurations.MatterRoles.split("$|$") - , arrPermissions = serviceVariables.oMatterConfigurations.MatterPermissions.split("$|$") - , count = 1 - , iCounter - , iCount - , sEmail = "" - , oEmailRegex = new RegExp(oGlobalConstants.Email_Validation_Regex); - if (serviceVariables.oMatterConfigurations.MatterUserEmails && "" !== serviceVariables.oMatterConfigurations.MatterUserEmails) { - arrUserEmails = serviceVariables.oMatterConfigurations.MatterUserEmails.split("$|$"); - } - for (iCounter = 0; iCounter < arrUsers.length; iCounter++) { - commonFunctions.addMorePermissions(count); - var userName = "#txtAssign" + count; - if (arrUsers && 0 < arrUsers.length && arrUsers[iCounter]) { - if (arrUserEmails && 0 < arrUserEmails.length && arrUserEmails[iCounter]) { - var arrAllUsers = arrUsers[iCounter].split(";"), arrAllUserEmails = arrUserEmails[iCounter].split(";"); - for (iCount = 0; iCount < arrAllUsers.length; iCount++) { - if (arrAllUsers[iCount] && "" !== arrAllUsers[iCount].trim()) { - sEmail = arrAllUserEmails[iCount]; - if (oEmailRegex.test(sEmail)) { - $(userName)[0].value += (trimEndChar(arrAllUsers[iCount], ";") + " (" + arrAllUserEmails[iCount] + ");"); - } else { - $(userName)[0].value += (trimEndChar(arrAllUsers[iCount], ";") + ";"); - } - } - } - } else { - $(userName).val(trimEndChar(arrUsers[iCounter], ";") + ";"); - } - } else { - $(userName).val(""); - } - oCommonObject.bindAutocomplete(userName, true); - count++; - } - if (serviceVariables.oMatterConfigurations.MatterPermissions) { - count = 1; - $.each(arrRoles, function (key, value) { - var roles = "#ddlRoleAssign" + count; - count++; - if (-1 === $.inArray(value, serviceConstants.oMandatoryRoleNames)) { - $(roles).val($.trim(value)).attr("data-value", $.trim(value)).attr("data-mandatory", "false"); - } else { - $(roles).val($.trim(value)).attr("data-value", $.trim(value)).attr("data-mandatory", "true"); - } - }); - } - if (serviceVariables.oMatterConfigurations.MatterRoles) { - count = 1; - $.each(arrPermissions, function (key, value) { - var permissions = "#ddlPermAssign" + count; - count++; - $(permissions).val(value).attr("data-value", value); - }); - } - } - enableSaveButton(); - setHeight(); - } -} - -// Sets the value in Matter Type section from the value in the Configurations -function setDefaultMatterTypes() { - "use strict"; - // Check if the matter types values are not set - if (!serviceConstants.bIsContentTypeValuesSet) { - serviceConstants.bIsContentTypeValuesSet = !serviceConstants.bIsContentTypeValuesSet; - if (serviceVariables.oMatterConfigurations.MatterTypes && serviceVariables.oMatterConfigurations.MatterAreaofLaw && serviceVariables.oMatterConfigurations.MatterPracticeGroup) { - var arrMatterType = serviceVariables.oMatterConfigurations.MatterTypes.split("$|$") - , arrAreaofLaw = serviceVariables.oMatterConfigurations.MatterAreaofLaw.split("$|$") - , arrPracticeGroup = serviceVariables.oMatterConfigurations.MatterPracticeGroup.split("$|$") - , count = 0 - , iCounter = 0; - $.each(arrMatterType, function (key, matterType) { - $.each(serviceConstants.oTermStoreJson.PGTerms, function (key, pgTerms) { - $.each(pgTerms.AreaTerms, function (key, areaTerms) { - $.each(areaTerms.SubareaTerms, function (key, subAreaTerms) { - if ($.trim(subAreaTerms.TermName) === $.trim(matterType) && $.trim(areaTerms.TermName) === $.trim(arrAreaofLaw[iCounter]) && $.trim(pgTerms.TermName) === $.trim(arrPracticeGroup[iCounter])) { - var oContentTypeContainer = $(".popDT"); - var sDataDocumentTemplate = subAreaTerms.DocumentTemplates; - var sDataAssociatedDocumentTemplate = subAreaTerms.DocumentTemplateNames; - var sSelectedPracticeGroup = pgTerms.TermName; - var sSelectedPracticeGroupFolderStructure = pgTerms.FolderNames; - // Fetch the folder structure from the Practice Group, Area of Law and Sub Area of Law levels - - var sSelectedAreaOfLaw = areaTerms.TermName; - var sSelectedAreaOfLawFolderStructure = areaTerms.FolderNames; - var sSelectedSubAreaOfLawFolderStructure = subAreaTerms.FolderNames; - var sSelectedSubAreaOfLawIsNofolderStructurePresent = subAreaTerms.IsNoFolderStructurePresent; - var iFoldersCount = 0; - if (sDataDocumentTemplate) { - iFoldersCount = sDataAssociatedDocumentTemplate.split(";").length; - } - if ($.trim(subAreaTerms.TermName) === $.trim(serviceVariables.oMatterConfigurations.DefaultMatterType)) { - oContentTypeContainer.append("
    " + $.trim(matterType) + " (" + iFoldersCount + ")
    "); - } else { - oContentTypeContainer.append("
    " + $.trim(matterType) + " (" + iFoldersCount + ")
    "); - count++; - } - } - }); - }); - }); - iCounter++; - }); - } - $(".loadingIconContentType").addClass("hide"); - enableSaveButton(); - } -} - -// Enables the save button when all the values are loaded -function enableSaveButton() { - "use strict"; - if (serviceConstants.bIsConfigurationsRetrieved && serviceConstants.bIsContentTypeValuesSet && serviceConstants.bIsPermissionValuesSet) { - $("#saveButton").removeAttr("disabled"); - } -} - -// Navigate to clients page or dashboard page -function navigateToPage(bClient) { - "use strict"; - var sClientUrl = ""; - if (bClient) { - sClientUrl = oGlobalConstants.Site_Url + oSettingsConstants.Settings_Page_Url; - } else { - sClientUrl = oGlobalConstants.Site_Url + oSettingsConstants.WebDashboard_Page_Url; - } - window.open(sClientUrl, "_parent"); -} - -/* Functions for retrieving permissions */ -commonFunctions.getPermSuccess = function (result) { - "use strict"; - var $PermissionObject = $("#ddlPermAssignList1"); - $PermissionObject.empty(); - var arrResults = JSON.parse(result), permItem, permOption, arrOptions = []; - if (!arrResults.code) { - serviceConstants.arrPermissions = JSON.parse(JSON.stringify(arrResults)); - for (permItem in arrResults) { - permOption = "
    " + arrResults[permItem].Name + "
    "; - arrOptions.push(permOption); - } - $PermissionObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlPermAssignDiv1").click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - var windowWidth = getWidth(); - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 10); - $PermissionObject.css("left", parseInt($(this).position().left, 10) + 1); - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent1").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign1"); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $("#ddlPermAssignList1").addClass("hide"); - $(".permContent1").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - // Default value should be full control - $($(".permValue")[0]).click(); - serviceConstants.bIsPermissionProcessed = true; - if (serviceConstants.bIsRoleProcessed && serviceConstants.bIsConfigurationsRetrieved) { - setDefaultPermissions(); - } - } else { - if (arrResults.code && "string" === typeof arrResults.code && (-1 < arrResults.code.indexOf("#|#"))) { - showCommonErrorPopUp(arrResults.code); - } else { - showErrorNotification("#matterNameSection input", arrResults.value); - $(window).scrollTop(0); - } - } - serviceConstants.bPermission = true; -}; -commonFunctions.getPermFailure = function (result) { - "use strict"; - return false; -}; -commonFunctions.getPerm = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { - "Url": sClientUrl - } - }; - - oCommonObject.callProvisioningService("GetPermissionLevels", matterDetails, commonFunctions.getPermSuccess, commonFunctions.getpermFailure); -}; - -// Function is used to set fields based on configurations retrieved from service -function setFields(oMatterConfigurations) { - "use strict"; - if (oMatterConfigurations.DefaultMatterName) { - $("#matterNameSection .ms-TextField-field").val(oMatterConfigurations.DefaultMatterName); - } - - if (oMatterConfigurations.DefaultMatterId) { - $("#matterIdSection .ms-TextField-field").val(oMatterConfigurations.DefaultMatterId); - } - makeFieldSelected("#includeCalendarTrue", "#includeCalendarFalse", oMatterConfigurations.IsCalendarSelected); - makeFieldSelected("#includeRSSTrue", "#includeRSSFalse", oMatterConfigurations.IsRSSSelected); - makeFieldSelected("#includeEmailTrue", "#includeEmailFalse", oMatterConfigurations.IsEmailOptionSelected); - makeFieldSelected("#matterRequiredTrue", "#matterRequiredFalse", oMatterConfigurations.IsMatterDescriptionMandatory); - makeFieldSelected("#matterConflictTrue", "#matterConflictFalse", oMatterConfigurations.IsConflictCheck); - makeFieldSelected("#assignTeamTrue", "#assignTeamFalse", oMatterConfigurations.IsRestrictedAccessSelected); - makeFieldSelected("#includeTasksTrue", "#includeTasksFalse", oMatterConfigurations.IsTaskSelected); - if (serviceConstants.bIsPermissionProcessed && serviceConstants.bIsRoleProcessed) { - setDefaultPermissions(); - } - - if (serviceConstants.bIsContentTypeProcessed) { - setDefaultMatterTypes(); - } -} - -// Make the field selected -function makeFieldSelected(sOptionYesElementId, sOptionNoElementId, bIsSelected) { - "use strict"; - if (bIsSelected) { - $(sOptionYesElementId).prop("checked", "checked"); - } else { - $(sOptionNoElementId).prop("checked", "checked"); - } -} - -/* Functions for retrieving permissions */ -commonFunctions.getConfigurationsSuccess = function (result) { - "use strict"; - if (null != result) { - var arrResult = result.split("|$|"); - if (0 < arrResult.length) { - if (serviceConstants.sErrorModifiedDate == arrResult[1]) { // New configurations created - serviceConstants.sItemModifiedDate = serviceConstants.sErrorModifiedDate; - } else { - serviceConstants.sItemModifiedDate = arrResult[1]; - } - var matterConfigurations = JSON.parse(arrResult[0]); - setHeight(); - serviceConstants.bIsConfigurationsRetrieved = true; - serviceVariables.oMatterConfigurations = JSON.parse(arrResult[0]); - if (!matterConfigurations.code) { - setFields(matterConfigurations); - enableSaveButton(); - } else { - if (matterConfigurations.code && "string" === typeof matterConfigurations.code && (-1 < matterConfigurations.code.indexOf("#|#"))) { - showCommonErrorPopUp(matterConfigurations.code); - } else { - showErrorNotification("#matterNameSection input", matterConfigurations.value); - $(window).scrollTop(0); - } - } - } - } -}; -commonFunctions.getConfigurationsFailure = function (result) { - "use strict"; - serviceConstants.bIsConfigurationsRetrieved = true; - return false; -}; -commonFunctions.getConfigurations = function (sClientUrl) { - "use strict"; - var matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "siteCollectionPath": sClientUrl - }; - - oCommonObject.callProvisioningService("GetDefaultMatterConfigurations", matterDetails, commonFunctions.getConfigurationsSuccess, commonFunctions.getConfigurationsFailure); -}; - -/* Functions for fetching content types */ -commonFunctions.fetchMatterTypesSuccess = function (result) { - "use strict"; - serviceConstants.bContentType = true; - serviceConstants.oTermStoreJson = JSON.parse(result); - if (!serviceConstants.oTermStoreJson.code) { - populateMatterTypes(); - serviceConstants.bIsContentTypeProcessed = true; - if (serviceConstants.bIsConfigurationsRetrieved) { - setDefaultMatterTypes(); - } - } else { - if (serviceConstants.oTermStoreJson.code && "string" === typeof serviceConstants.oTermStoreJson.code && (-1 < serviceConstants.oTermStoreJson.code.indexOf("#|#"))) { - showCommonErrorPopUp(serviceConstants.oTermStoreJson.code); - } else { - showErrorNotification("#matterNameSection input", serviceConstants.oTermStoreJson.value); - $(window).scrollTop(0); - } - } -}; -commonFunctions.fetchMatterTypesFailure = function (result) { - "use strict"; - return false; -}; -commonFunctions.fetchMatterTypes = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sClientUrl }, "details": { - "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Practice_Group_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Practice_Group_Custom_Properties, "DocumentTemplatesName": oGlobalConstants.Sub_Area_Of_Law_Document_Templates - } - }; - oJQueryObjects.$LoadingLookUp.removeClass("hide"); - oCommonObject.callProvisioningService("GetTaxonomyData", matterDetails, commonFunctions.fetchMatterTypesSuccess, commonFunctions.fetchMatterTypesFailure); -}; - -/* Function to add more team assignment line items */ -commonFunctions.addMorePermissions = function (iAssignPermCount) { - "use strict"; - var iNextAssignPermContent = parseInt(iAssignPermCount, 10); - // For setting proper class name suffix - - if (1 === iNextAssignPermContent) { - serviceConstants.iLastRowNumber = iAssignPermCount; - } else { - iNextAssignPermContent = serviceConstants.iLastRowNumber; - } - var permItem, permOption, roleItem, roleOption, arrOptions = [] - // On click of Add more link, this chunk will be displayed - , sAssignPermContent = "
    " - + "" - + "
    " - - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - - + "
    " - + "
    " - + "" - + "" - + "
    " - + "
    " - + "
    " - - + "
    " - + "
    " - + "delete" - + "
    " - + "
    "; - $("#addNewAssignPerm").before(sAssignPermContent); - - for (roleItem in serviceConstants.arrRoles) { - roleOption = "
    " + serviceConstants.arrRoles[roleItem].Name + "
    "; - arrOptions.push(roleOption); - } - var $RoleObject = $("#ddlRoleAssignList" + iNextAssignPermContent + ""); - $RoleObject.append(arrOptions.join("")); - // This function will display drop-down menu - $(".ddlRoleAssignDiv" + iNextAssignPermContent + "").click(function (event) { - closeAllPopupExcept(""); - var $Element = $RoleObject; - toggleThisElement($Element); - var windowWidth = getWidth(); - $RoleObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 10); - $RoleObject.css("left", parseInt($(this).offset().left, 10)); - event.stopPropagation(); - }); - - $(".roleValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".assignPerm" + iNextAssignPermContent + "").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlRoleAssign" + iNextAssignPermContent + ""); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")).attr("data-mandatory", $(this).attr("data-mandatory")); - $RoleObject.addClass("hide"); - $(".assignPerm" + iNextAssignPermContent + "").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".assignPerm" + iNextAssignPermContent + "")[0]).click(); - - arrOptions = []; - for (permItem in serviceConstants.arrPermissions) { - permOption = "
    " + serviceConstants.arrPermissions[permItem].Name + "
    "; - arrOptions.push(permOption); - } - var $PermissionObject = $("#ddlPermAssignList" + iNextAssignPermContent + ""); - $PermissionObject.append(arrOptions.join("")); - - // This function will display drop-down menu - $(".ddlPermAssignDiv" + iNextAssignPermContent + "").click(function (event) { - closeAllPopupExcept(""); - var $Element = $PermissionObject; - toggleThisElement($Element); - var windowWidth = getWidth(); - $PermissionObject.css("top", parseInt($(this).offset().top, 10) + $(this).height() - 10); - $PermissionObject.css("left", parseInt($(this).offset().left, 10)); - event.stopPropagation(); - }); - - $(".permValue").mouseover(function () { - $(this).addClass("ddListOnHover"); - }).mouseout(function () { - $(this).removeClass("ddListOnHover"); - }); - - // This function will select the item from drop-down list - $(".permContent" + iNextAssignPermContent + "").click(function (event) { - var selectedClient = this.innerHTML, $Element = $("#ddlPermAssign" + iNextAssignPermContent + ""); - $Element.val(selectedClient).attr("data-value", $(this).attr("data-value")); - $PermissionObject.addClass("hide"); - $(".permContent" + iNextAssignPermContent + "").removeClass("ddListOnHover"); - event.stopPropagation(); - }); - - $($(".permContent" + iNextAssignPermContent + "")[0]).click(); - - oCommonObject.bindAutocomplete("#txtAssign" + iNextAssignPermContent, true); - sortDropDownListByText(); - serviceConstants.iLastRowNumber++; - setHeight(); -}; - -/* Functions for retrieving clients */ -commonFunctions.getClientSuccess = function (result) { - "use strict"; - var arrResults = JSON.parse(result), clientItem, clientOption, iCount = 0, iLength, arrOptions = []; - $(".loadingImage").addClass("hide"); - $(".mainContainer").removeClass("hide"); - $("#clientContainer").removeClass("hide"); - if (!arrResults.code) { - serviceConstants.arrClients = JSON.parse(JSON.stringify(arrResults)); - iLength = serviceConstants.arrClients.ClientTerms.length; - for (iCount = 0; iCount < iLength; iCount++) { - clientOption = ""; - arrOptions.push(clientOption); - } - - if (0 === arrOptions.length) { - $("#clientsList").text(oSettingsConstants.No_Clients_Message); - } else { - $("#clientsList").append(arrOptions); - } - } - setHeight(); -}; -commonFunctions.getClientFailure = function (result) { - "use strict"; - return false; -}; -commonFunctions.getClient = function () { - "use strict"; - var sClientUrl = serviceConstants.sCentralRepositoryLocation - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sClientUrl }, "details": { - "TermGroup": oGlobalConstants.Common_Term_Set_Group_Name, "TermSetName": oGlobalConstants.Client_Term_Set_Name, "CustomPropertyName": oGlobalConstants.Client_Custom_Properties_Url - } - }; - oCommonObject.callProvisioningService("GetTaxonomyData", matterDetails, commonFunctions.getClientSuccess, commonFunctions.getClientFailure); -}; - -// Get configuration values from the list -function getConfigurationsFromFields() { - "use strict"; - var oMatterConfigurations = { - "DefaultMatterName": "", - "DefaultMatterId": "", - "DefaultMatterType": "", - "MatterTypes": "", - "MatterUsers": "", - "MatterUserEmails": "", - "MatterRoles": "", - "MatterPermissions": "", - "IsCalendarSelected": null, - "IsRSSSelected": null, - "IsEmailOptionSelected": null, - "IsRestrictedAccessSelected": null, - "IsConflictCheck": null, - "IsMatterDescriptionMandatory": null, - "IsTaskSelected": null, - "MatterPracticeGroup": "", - "MatterAreaofLaw": "" - }; - - var sMatterName = $("#matterNameSection input").val(); - if (sMatterName) { - oMatterConfigurations.DefaultMatterName = sMatterName; - } - - var sMatterId = $("#matterIdSection input").val(); - if (sMatterId) { - oMatterConfigurations.DefaultMatterId = sMatterId; - } - - oMatterConfigurations.MatterUsers = getUsers(); - oMatterConfigurations.MatterUserEmails = getUserEmails(); - if (oMatterConfigurations.MatterUsers) { - oMatterConfigurations.MatterPermissions = getPermissionsOrRoles("ddlPermAssign"); - oMatterConfigurations.MatterRoles = getPermissionsOrRoles("ddlRoleAssign"); - } - oMatterConfigurations = getMatterTypes(oMatterConfigurations); - oMatterConfigurations.IsCalendarSelected = getFieldValue("#includeCalendarTrue"); - oMatterConfigurations.IsRSSSelected = getFieldValue("#includeRSSTrue"); - oMatterConfigurations.IsEmailOptionSelected = getFieldValue("#includeEmailTrue"); - oMatterConfigurations.IsRestrictedAccessSelected = getFieldValue("#assignTeamTrue"); - oMatterConfigurations.IsConflictCheck = getFieldValue("#matterConflictTrue"); - oMatterConfigurations.IsMatterDescriptionMandatory = getFieldValue("#matterRequiredTrue"); - oMatterConfigurations.IsTaskSelected = getFieldValue("#includeTasksTrue"); - return oMatterConfigurations; -} - -// Gets the checked property of the checkbox -function getFieldValue(sComponentId) { - "use strict"; - return $(sComponentId).prop("checked"); -} - -// Gets the matter types attributes -function getMatterTypes(oMatterConfigurations) { - "use strict"; - var arrMatterTypes = [], arrPracticeGroup = [], arrAreaofLaw = [], sDefaultMatter = "", sMatterType = ""; - $.each($(".popDT div"), function () { - sMatterType = $.trim($(this).text()); - sMatterType = sMatterType.substring(0, sMatterType.indexOf("(") - 1); - arrMatterTypes.push(sMatterType); - arrPracticeGroup.push($.trim($(this).attr("data-practicegroup"))); - arrAreaofLaw.push($.trim($(this).attr("data-areaoflaw"))); - if ($(this).hasClass("popUpSelected")) { - sDefaultMatter = sMatterType; - } - }); - - if (arrMatterTypes.length) { - oMatterConfigurations.MatterTypes = arrMatterTypes.join("$|$"); - oMatterConfigurations.MatterPracticeGroup = arrPracticeGroup.join("$|$"); - oMatterConfigurations.MatterAreaofLaw = arrAreaofLaw.join("$|$"); - oMatterConfigurations.DefaultMatterType = sDefaultMatter; - } - - return oMatterConfigurations; -} - -// Gets the permission level for each of the user -function getPermissionsOrRoles(sId) { - "use strict"; - var arrPermissionsOrRoles = []; - $.each($("input[id^=" + sId + "]"), function () { - arrPermissionsOrRoles.push($.trim($(this).attr("data-value"))); - }); - if (arrPermissionsOrRoles.length) { - return arrPermissionsOrRoles.join("$|$"); - } else { - return ""; - } -} - -// Gets the list of users from the textboxes -function getUsers() { - "use strict"; - var arrUserNames = []; - $.each($("input[id^=txtAssign]"), function () { - arrUserNames.push(oCommonObject.getUserName($(this).val().trim(), true)); - }); - if (arrUserNames.length) { - return arrUserNames.join("$|$").replace(/,/g, ";"); - } else { - return ""; - } -} - -// Gets the list of users from the textboxes -function getUserEmails() { - "use strict"; - var arrUseEmails = []; - $.each($("input[id^=txtAssign]"), function () { - arrUseEmails.push(oCommonObject.getUserName($(this).val().trim(), false)); - }); - if (arrUseEmails.length) { - return arrUseEmails.join("$|$").replace(/,/g, ";"); - } else { - return ""; - } -} - -// Gets the user ids of the divs containing the User names -function getUserIds() { - "use strict"; - var userId = []; - $.each($("input[id^=txtAssign]"), function () { - userId.push(this.id); - }); - return userId; -} - -// Save configurations functions -commonFunctions.saveConfigurationsSuccess = function (result) { - "use strict"; - $(".loadingImage").addClass("hide"); - if (null != result) { - var arrResult = result.split("|$|"); - serviceConstants.sItemModifiedDate = arrResult[1]; - var oResult = JSON.parse(arrResult[0]), controlId; - if (!oResult.code) { - $("#successMessage").removeClass("hide"); - setHeight(); - $(window).scrollTop($("#container").height()); - } else { - if (oResult.code && "string" === typeof oResult.code && (-1 < oResult.code.indexOf("#|#"))) { - showCommonErrorPopUp(oResult.code); - } else { - var sValidationResult = oResult.value; - var oValidationDetails = sValidationResult.split("$|$"), sSecurityGroupRow, sSecurityGroupError; - if (2 === oValidationDetails.length) { - sSecurityGroupError = oValidationDetails[0]; - sSecurityGroupRow = oValidationDetails[1]; - } - if ("" !== sSecurityGroupRow) { - controlId = "#" + sSecurityGroupRow; - } else { - controlId = "#saveButton"; - sSecurityGroupError = oSettingsConstants.Already_Edited_Message; - } - showErrorNotification(controlId, sSecurityGroupError); - } - } - } -}; -commonFunctions.saveConfigurationsFailure = function () { - "use strict"; - return false; -}; -commonFunctions.saveConfigurations = function () { - "use strict"; - var oMatterConfigurations = getConfigurationsFromFields(); - $("#successMessage").addClass("hide"); - setHeight(); - $(".loadingImage").removeClass("hide"); - var userIds = []; - if ("" !== oMatterConfigurations.MatterUsers) { - userIds = getUserIds(); - } - var sClientUrl = serviceConstants.sCentralRepositoryLocation, clientUrl = serviceConstants.clientUrl - , matterDetails = { - "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "siteCollectionPath": clientUrl, "matterConfigurations": oMatterConfigurations, "userId": userIds, "cachedItemModifiedDate": serviceConstants.sItemModifiedDate - }; - - oCommonObject.callProvisioningService("SaveMatterConfigurations", matterDetails, commonFunctions.saveConfigurationsSuccess, commonFunctions.saveConfigurationsFailure); -}; -/* Function to display error tool tip */ -function showErrorNotification(sElement, sMsg) { - "use strict"; - var windowWidth = getWidth(); - var removeTop = 67, removeLeft = 115; - var posLeft = "50px"; - var triangleTopPos = 42; - var errorBoxHeight = 55; - var errorBoxTop = 7; - var errorBoxLeft = 24; - var oRoleObject = $(sElement); - if (oRoleObject) { - var iLeftPos = oRoleObject.offset().left - , iTopPos = oRoleObject.offset().top - , iCurrentWidth = oRoleObject.outerWidth(); - iLeftPos = parseInt(iLeftPos, 10) + parseInt(iCurrentWidth, 10) - 20; - iTopPos = parseInt(iTopPos, 10) - 20; - $("#container .errorPopUp").css("left", iLeftPos - removeLeft).css("top", iTopPos - removeTop).removeClass("hide").find(".errText").text(sMsg); - $("#container .errTriangleBorder").css("left", posLeft); - $("#container .errTriangle").css("left", posLeft); - if ("#saveButton" !== sElement) { - $("#container .errTriangleBorder").css("top", "calc(50% - -" + (triangleTopPos - 1) + "px)"); - $("#container .errTriangle").css("top", "calc(50% - -" + (triangleTopPos) + "px)"); - } else { - $("#container .errTriangleBorder").css("top", "66px"); - $("#container .errTriangle").css("top", "67px"); - } - $("#container .errText").css("min-height", errorBoxHeight + "px").css("top", errorBoxTop + "px").css("left", errorBoxLeft + "px"); - oRoleObject.addClass("redBorder"); - $("#container .errorPopup").removeClass("hide"); - } -} -$("#searchMatterTab").click(function () { - "use strict"; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Settings_Page + oGlobalConstants.View_Matter, true); - window.top.parent.location.href = oGlobalConstants.Site_Url + oGlobalConstants.TenantWebDashboard + "?section=1"; -}); - -$("#searchDocumentTab").click(function () { - "use strict"; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Settings_Page + oGlobalConstants.View_Document, true); - window.top.parent.location.href = oGlobalConstants.Site_Url + oGlobalConstants.TenantWebDashboard + "?section=2"; -}); -// Document ready function -$(document).ready(function () { - "use strict"; - oCommonObject.sCurrentPage = oGlobalConstants.App_Name_Settings_Page; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oCommonObject.sCurrentPage, true); - var bIsClientMode = true; - var clientDetails = getParameterByName("clientdetails"); - $("#MasterPageContainer").removeClass("MasterPageContent"); - if ("" !== clientDetails) { - bIsClientMode = false; - } - if (!bIsClientMode) { - var clientUrl = decodeURIComponent(clientDetails.split("$|$")[0]), clientName = ""; - if (2 === clientDetails.split("$|$").length) { - clientName = decodeURIComponent(clientDetails.split("$|$")[1]); - } - setTextForFieldsOnPage(bIsClientMode); - serviceConstants.clientUrl = clientUrl; - $(".loadingImage").addClass("hide"); - $(".mainContainer").removeClass("hide"); - $("#container").removeClass("hide"); - setHeight(); - $(".ddpopUpPGIcon, .popUpPGDiv").click(function (event) { - var $Element = $("#popUpPGList"); - toggleThisElement($Element); - event.stopPropagation(); - }); - if ("" !== clientName) { - $(".clientName").text(oSettingsConstants.Client_Name_PlaceHolder.replace("{0}", clientName)); - } else { - $(".clientName").text(oSettingsConstants.Client_Name_PlaceHolder.replace("{0}", "Client")); - } - oJQueryObjects.$ContentTypes = $("#documentTemplates > .docTemplateItem"); - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - oJQueryObjects.$ErrorPopUp = $(".mainArea .errorPopUp"); - oJQueryObjects.$LoadingLookUp = $(".loadingLookUp"); - oJQueryObjects.$PracticeGroup = $(".popUpPG"); - oJQueryObjects.$PracticeGroupList = $("#popUpPGList"); - - // #region Service calls - commonFunctions.getConfigurations(clientUrl); - commonFunctions.getRole(); - commonFunctions.fetchMatterTypes(); - commonFunctions.getPerm(); - oCommonObject.bindAutocomplete("#txtAssign1", true); //// Bind the jQuery UI auto-complete to multi user text field - - // #region Search By Typing - //// Search by typing for Area of Law - $(document).on("input", ".popUpMatterDescription .popUpMDTextArea", function () { searchByTyping(".popUpMD .popUpMDContent", $(this).val()); }); - //// Search by typing for Sub Area of Law - $(document).on("input", ".popUpSubAreaOfLaw .popUpMDTextArea", function () { searchByTyping(".popUpSAL .popUpSALContent", $(this).val()); }); - //// #endregion - - $(document).on("click", ".popUpSALContent", function () { - $(".popUpSALContent").removeClass("popUpSelected"); - $(this).addClass("popUpSelected"); - }); - - $(document).on("click", ".popUpDTContent", function () { - $(".popUpDTContent").removeClass("popUpSelected"); - $(this).addClass("popUpSelected"); - }); - - $(".popUpLeftClick").click(function () { - var oSelected = $(".popUpSAL .popUpSelected"); - /* Add Practice Groups and Area of Laws */ - var oPopUpPG = $(".popUpPG"); - if (oPopUpPG[0]) { - var oSelectedPGOption = oPopUpPG; - var oSelectedAreaOfLaw = $(".popUpMDContent.popUpSelected"); - var oSelectedSubAreaOfLaw = $(".popUpSALContent.popUpSelected"); - - var sSelectedPracticeGroup = oSelectedPGOption.val(); - var sSelectedPracticeGroupFolderStructure = oSelectedPGOption.attr("data-folderNamesPG"); - // Fetch the folder structure from the Practice Group, Area of Law and Sub Area of Law levels - - var sSelectedAreaOfLaw = oSelectedAreaOfLaw.text(); - var sSelectedAreaOfLawFolderStructure = oSelectedAreaOfLaw.attr("data-folderNamesAOL"); - var sSelectedSubAreaOfLawFolderStructure = oSelectedAreaOfLaw.attr("data-folderNamesSAL"); - var sSelectedSubAreaOfLawIsNofolderStructurePresent = oSelectedAreaOfLaw.attr("data-isNoFolderStructurePresent"); - - // Practice Group - oSelected.attr("data-PracticeGroup", sSelectedPracticeGroup); - oSelected.attr("data-folderNamesPG", sSelectedPracticeGroupFolderStructure); - - // Area of Law - oSelected.attr("data-AreaOfLaw", sSelectedAreaOfLaw); - oSelected.attr("data-folderNamesAOL", sSelectedAreaOfLawFolderStructure); - - // Sub Area of Law - oSelected.attr("data-folderNamesSAL", sSelectedSubAreaOfLawFolderStructure); - oSelected.attr("data-isNoFolderStructurePresent", sSelectedSubAreaOfLawIsNofolderStructurePresent); - } - - var bPresent = false; - if (oSelected) { - /*Fixed duplicate issue*/ - var oIterate = $(".popUpDTContent"); - $.each(oIterate, function () { - if ($(this).attr("data-document-template") === oSelected.attr("data-document-template")) { - bPresent = true; - return false; - } - }); - if (!bPresent) { - $(".popUpSAL > div, .popDT > div").removeClass("popUpSelected"); - $(".popDT").append(oSelected.clone().removeClass("popUpSALContent").addClass("popUpDTContent popUpSelected")); - var currentSelectedSubAreaOfLaw = $(".popDT .popUpSelected"); - if (currentSelectedSubAreaOfLaw.length) { - var arrAssociatedDocumentTemplates = currentSelectedSubAreaOfLaw.attr("data-associated-document-template").split(";"); - currentSelectedSubAreaOfLaw.html(currentSelectedSubAreaOfLaw.text() + " (" + arrAssociatedDocumentTemplates.length + ")"); - } - } - } - $(".popUpDTContent").removeClass("popUpSelected"); - }); - - $(".popUpRightClick").click(function () { - var oSelected = $(".popDT .popUpSelected"); - if (oSelected) { - $(".popUpSAL > div, .popDT > div").removeClass("popUpSelected"); - oSelected.remove(); - } - }); - - $(document).on("click", ".popUpMDContent", function () { - var oSAL = $(".popUpSAL"), sFolderNames, boolIsFolderStructurePresent; - oSAL.find(".popUpSALContent").remove(); - $(".popUpMDContent").removeClass("popUpSelected"); - $(this).addClass("popUpSelected"); - localStorage.iSelectedAOL = $(this).attr("data-value"); - for (var iIterator = 0; iIterator < serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms.length; iIterator++) { - sFolderNames = serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms[iIterator].FolderNames ? serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms[iIterator].FolderNames : ""; - boolIsFolderStructurePresent = serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms[iIterator].IsNoFolderStructurePresent ? serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms[iIterator].IsNoFolderStructurePresent : ""; - oSAL.append("
    " + serviceVariables.oTermStoreData.PGTerms[localStorage.iSelectedPG].AreaTerms[localStorage.iSelectedAOL].SubareaTerms[iIterator].TermName + "
    "); - } - $(".popUpSAL .popUpSALContent:first-child").click(); - }); - - $("#addMoreLink").click(function () { - oJQueryObjects.$AssignPermissions = $(".assignNewPerm"); - var iAssignPermCount = oJQueryObjects.$AssignPermissions.length; - commonFunctions.addMorePermissions(parseInt(iAssignPermCount, 10) + 1); - }); - //// hide the error tooltip - $(document).on("click", "#container", function () { - var oErrorPopup = $("#container .errorPopup"); - if (!$(oErrorPopup).hasClass("hide")) { - $(oErrorPopup).addClass("hide"); - $("div input:text , textarea , select").removeClass("redBorder"); - } - }); - - $(document).on("click", ".close", function (event) { - closePermissionRow(event); - }); - - $(document).on("click", "#saveButton", function (event) { - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oGlobalConstants.App_Name_Settings_Page + oGlobalConstants.Save_Settings, true); - commonFunctions.saveConfigurations(); - event.stopPropagation(); - }); - - $(document).on("click", "#cancelButton", function (event) { - navigateToPage(true); - event.stopPropagation(); - }); - - $(document).on("click", "#goToClients", function (event) { - navigateToPage(true); - event.stopPropagation(); - }); - - $(document).on("click", "#hideSection", function (event) { - $(".hideMatterType").removeClass("hide"); - $(".contentMatterType").addClass("hide"); - setHeight(); - }); - - $(document).on("click", "#showMatterType", function (event) { - $(".contentMatterType").removeClass("hide"); - $(".hideMatterType").addClass("hide"); - setHeight(); - }); - - $(document).on("click", document, function (event) { - if ("ddClientIcon" === $($(event.target)[0]).attr("class") || "ddlClient" === $(event.target)[0].id) { - closeAllPopupExcept("ddlClientList"); - } else if ($($(event.target)[0]).hasClass("popUpPGDiv")) { - closeAllPopupExcept("popUpPGList"); - } else { - closeAllPopupExcept(""); - } - }); - setHeight(); - } - else { - serviceConstants.bClientMode = true; - setTextForFieldsOnPage(bIsClientMode); - commonFunctions.getClient(); - } - //// Update the validation for HTML fields - $(".inputMatterName").attr("maxlength", oGlobalConstants.Matter_Name_Max_Length); - $(".inputMatterId").attr("maxlength", oGlobalConstants.Matter_Id_Max_Length); -}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Upload.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Upload.js deleted file mode 100644 index d32d09ae..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/Upload.js +++ /dev/null @@ -1,903 +0,0 @@ -/// JS3057,JS3058,JS2074,JS2076,JS3092,JS3054,JS2005,JS3056,JS2073,JS2024,JS2026,JS2032,JS2064,JS3116,JS3053 - -var oUploadGlobal = { - regularInvalidCharacter: new RegExp("[\*\?\|\\\t/:\"\"'<>#{}%~&]", "g"), - regularStartEnd: new RegExp("^[\. ]|[\. ]$", "g"), - regularExtraSpace: new RegExp(" {2,}", "g"), - regularInvalidRule: new RegExp("[\.]{2,}", "g"), - oUploadParameter: [], - sClientRelativeUrl: "", - sFolderUrl: "", - arrContent: [], - arrFiles: [], - arrOverwrite: [], - src: [], - iActiveUploadRequest: 0, - oDrilldownParameter: { nCurrentLevel: 0, sCurrentParentUrl: "", sRootUrl: "" }, - sNotificationMsg: "", - bAppendOptionEnabled: false, - oXHR: new XMLHttpRequest(), - bIsAbortedCC: false, - bAllowContentCheck: false -}; - -function closeAllPopup() { - "use strict"; - $(".popUpCloseIcon").click(); - $(".errorPopUp").addClass("hide"); - oUploadGlobal.arrFiles = []; - oUploadGlobal.arrContent = []; - oUploadGlobal.sNotificationMsg = ""; - if ("object" === typeof commonFunction && jQuery.isFunction(commonFunction.clearGlobalVariables)) { - commonFunction.clearGlobalVariables(); - } - $(".folderStructureContent, .parentNode").removeClass("folderStructureWithBreadcrumb"); -} - -$(document).mousedown(function (e) { - "use strict"; - if ($(e.target).is(".mailpopupContainerBackground")) { - closeAllPopup(); - } - - if ($(e.target).is(".mailContainer")) { - $(".errorPopUp").addClass("hide"); - oUploadGlobal.arrFiles = []; - oUploadGlobal.arrContent = []; - } -}); - -function showPopupNotification(sMsg, resultClass) { - "use strict"; - var sContent = ""; - sContent = "
    " + sMsg + "
    "; - $(".mailContainer .notification").remove(); - $(".mailContainer").prepend(sContent); -} - -function buildNestedList(treeNodes, rootId) { - "use strict"; - var nodesByParent = {}; - $.each(treeNodes, function (iIndex, node) { - if (!(node.parenturl in nodesByParent)) { nodesByParent[node.parenturl] = []; } - nodesByParent[node.parenturl].push(node); - }); - - function buildTree(children) { - var $container = $("
      "), - sDataClient = "data-client", - sDataFolderName = "data-foldername", - sDataParentName = "data-parentname"; - if (!children) { return; } - $.each(children, function (iIndex, child) { - if (null !== child.parenturl) { - if (null !== oUploadGlobal.oDrilldownParameter.sCurrentParentUrl && oUploadGlobal.oDrilldownParameter.sCurrentParentUrl === child.parenturl) { - $("
    • ", { html: "
      " + child.name + "" + child.name + "
      " }) - .css({ display: "inline-block", width: "90%", padding: "0" }) - .attr(sDataClient, oUploadGlobal.oDrilldownParameter.sRootUrl) - .attr(sDataFolderName, child.url) - .attr(sDataParentName, child.parenturl) - .addClass("childNode") - .appendTo($container) - .append(buildTree(nodesByParent[child.url])); - } else if (null !== oUploadGlobal.oDrilldownParameter.sCurrentParentUrl && oUploadGlobal.oDrilldownParameter.sCurrentParentUrl === child.url) { - $("
    • ", { html: "
      " + child.name + "" + child.name + "
      " }) - .css({ display: "inline-block", width: "100%", padding: "0" }) - .attr(sDataClient, oUploadGlobal.oDrilldownParameter.sRootUrl) - .attr(sDataFolderName, child.url) - .attr(sDataParentName, child.parenturl) - .addClass("parentNode") - .appendTo($container) - .append(buildTree(nodesByParent[child.url])); - } - } else { - oUploadGlobal.oDrilldownParameter.sRootUrl = child.url; - oUploadGlobal.oDrilldownParameter.sCurrentParentUrl = child.url; - oUploadGlobal.oDrilldownParameter.nCurrentLevel++; - $("
    • ", { html: "
      " + child.name + "" + child.name + "
      " }) - .css({ display: "inline-block", width: "100%", padding: "0" }) - .attr(sDataClient, oUploadGlobal.oDrilldownParameter.sRootUrl) - .attr(sDataFolderName, child.url) - .attr(sDataParentName, child.parenturl) - .addClass("parentNode") - .appendTo($container) - .append(buildTree(nodesByParent[child.url])); - } - }); - return $container; - } - return buildTree(nodesByParent[rootId]); -} - -function folderHierarchySuccess(result) { - "use strict"; - // Dynamically decrease the height of the popup - oCommonObject.updateUploadPopupHeight(false); - oCommonObject.getContentCheckConfigurations(oSearchGlobal.matterUrl); - var nTemp = 0, - oMatter = result.oParam, - treeNodes = JSON.parse(result.Result), - htmlChunk; - if (0 < $(".notification").length) { - $(".notificationContainerForPopup").find("div:first").remove(); - } - $(".popupWait, .loadingImage").addClass("hide"); - result = result.Result; - oSearchGlobal.oFolderName = treeNodes; - if (treeNodes.code) { - showCommonErrorPopUp(treeNodes.code); - return; - } - htmlChunk = buildNestedList(treeNodes, null); - $(".folderStructureContent").html(htmlChunk); - - // Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - $("#attachmentHeader").removeClass("hide"); - if (oCommonObject.getParameterByName("appType") === oGlobalConstants.Querystring_Outlook) { - uploadMailClient(); - } else { - $(".maildata").html("
      " + oGlobalConstants.No_Files_Uploaded + "
      "); - } - if (oMatter && oMatter[0]) { - var sOriginalName, sMatterGUID; - if (4 === oCommonObject.iCurrentGridViewData()) { - sOriginalName = $(oMatter[0]).attr("data-mattername"); - sMatterGUID = $(oMatter[0]).attr("data-matterguid"); - } else { - sOriginalName = $(oMatter[0]).attr("data-" + oGlobalConstants.Matter_Name); - sMatterGUID = $(oMatter[0]).attr("data-" + oGlobalConstants.Matter_GUID); - } - oCommonObject.addUploadAttributes(sOriginalName, sMatterGUID); - if ("undefined" !== typeof oMatter[0]) { - $("#rootLink").attr("title", oMatter[0].innerHTML); - } - - bindDroppable($(".folderStructureContent ul li")); - } - $("#mailBody").on("drop", ".folderStructureContent ul li", function (e, ui) { - var sDataClient = "data-client", - sDataFolderName = "data-foldername", - clientRelativeUrl = "", - folderUrl = "", - isOverwrite = "", - count = 0; - e.stopPropagation(); - e.stopImmediatePropagation(); - e.preventDefault(); - if ($(this).hasClass("folderDragOver")) { - $(this).removeClass("folderDragOver"); - } - if ($(this).parent().parent().hasClass("folderDragOver")) { - $(this).parent().parent().removeClass("folderDragOver"); - } - - if (e.dataTransfer && e.dataTransfer.files && 0 !== e.dataTransfer.files.length) { - oSearchGlobal.files = e.dataTransfer.files; - oSearchGlobal.dataArray.length = 0; - - clientRelativeUrl = "undefined" !== typeof $(e.target).attr(sDataClient) ? $(e.target).attr(sDataClient) : $(e.target).parent().attr(sDataClient); - folderUrl = "undefined" !== typeof $(e.target).attr(sDataFolderName) ? $(e.target).attr(sDataFolderName) : $(e.target).parent().attr(sDataFolderName); - isOverwrite = "False"; - for (count = 0; count < e.dataTransfer.files.count; count++) { - oUploadGlobal.arrOverwrite[count] = "False"; - } - // upload dropped file - uploadFile(clientRelativeUrl, folderUrl, isOverwrite); - } else { - // upload mail/attachment - uploadAttachment(e, ui); - } - }); - - $(".mailpopupContainerBackground, .mailContainer, .commonMailBody").removeClass("hide"); - -} - -function bindDroppable($Element) { - "use strict"; - $Element.droppable({ - greedy: true, - tolerance: "pointer", - }); - - $(".parentNode").on("dropover", function (event, ui) { - var first = $(".childNode:first"); - var last = $(".childNode:last"); - if (first.length && last.length) { - if ((event.originalEvent.pageX > first.offset().left) && - (event.originalEvent.pageY > first.offset().top) && - (event.originalEvent.pageX < (last.offset().left + last.width())) && - (event.originalEvent.pageY < (last.offset().top + last.height()))) { - $(this).removeClass("folderDragOver"); - } else { - $(this).addClass("folderDragOver"); - $(".childNode").removeClass("folderDragOver"); - } - } - }).on("dropout", function () { - $(this).removeClass("folderDragOver"); - }); - - $(".childNode").on("dropover", function () { - $(".parentNode, .childNode").removeClass("folderDragOver"); - $(this).addClass("folderDragOver"); - }).on("dropout", function () { - $(this).removeClass("folderDragOver"); - }); -} - -$(".popUpCloseIcon").click(function () { - "use strict"; - $(".mailContainer .notification").remove(); - $(".mailpopupContainerBackground, .mailContainer").addClass("hide"); - $(".errorPopUp").addClass("hide"); - $(".folderStructureContent, .parentNode").removeClass("folderStructureWithBreadcrumb"); - if ("undefined" !== typeof commonFunction.clearGlobalVariables) { - commonFunction.clearGlobalVariables(); - } -}); - -function folderHierarchyBeforeCall() { - "use strict"; - $(".popupWait, .loadingImage").removeClass("hide"); -} - -function folderHierarchyFailure(result) { - "use strict"; - $(".popupWait, .loadingImage").addClass("hide"); - showCommonErrorPopUp(result); -} - -function populateFolderHierarchy(element) { - "use strict"; - $(".loadingImage").css("position", "absolute"); - var matterName = $(element).siblings(".matterTitle").attr("data-mattername"), matterUrl = $(element).siblings(".matterTitle").attr("data-client"), MatterFolderDetails = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "matterData": { "MatterName": matterName, "MatterUrl": matterUrl } }; - oSearchGlobal.matterUrl = matterUrl; - var oMatter = $(element).siblings(".matterTitle"); - oCommonObject.callSearchService("GetFolderHierarchy", MatterFolderDetails, folderHierarchySuccess, folderHierarchyFailure, folderHierarchyBeforeCall, oMatter); -} - -// Upload Mail -function uploadMailClient() { - "use strict"; - if (Office.context.mailbox) { - // Init mail app - oSearchGlobal.oServiceRequest.attachmentToken = ""; - oSearchGlobal.oServiceRequest.ewsUrl = Office.context.mailbox.ewsUrl; - oSearchGlobal.oServiceRequest.subject = Office.context.mailbox.item.subject; - oSearchGlobal.oServiceRequest.MailId = Office.context.mailbox.item.itemId; - oSearchGlobal.oServiceRequest.attachments = new Array(); - var iCounter = 0; - if (Office.context.mailbox.item.attachments) { - var attachmentLength = Office.context.mailbox.item.attachments.length; - for (iCounter = 0; iCounter < attachmentLength; iCounter++) { - if (Office.context.mailbox.item.attachments[iCounter].hasOwnProperty("$0_0")) { - oSearchGlobal.oServiceRequest.attachments[iCounter] = JSON.parse(JSON.stringify(Office.context.mailbox.item.attachments[iCounter].$0_0)); - } else if (Office.context.mailbox.item.attachments[iCounter].hasOwnProperty("_data$p$0")) { - oSearchGlobal.oServiceRequest.attachments[iCounter] = JSON.parse(JSON.stringify(Office.context.mailbox.item.attachments[iCounter]._data$p$0)); - } - } - Office.context.mailbox.getCallbackTokenAsync(attachmentTokenCallbackEmailClient); - showAttachmentLoading(); - } else { - $(".maildata").html("
      " + oGlobalConstants.No_Files_Uploaded + "
      "); - } - } -} - -function showAttachmentLoading() { - "use strict"; - var sHTMLChunk = ""; - sHTMLChunk += "
      Loading
      "; - $(".maildata").html(sHTMLChunk); -} - -function createMailPopup() { - "use strict"; - var sHTMLChunk = "", sImageChunk = "", nIDCounter = 0; - sHTMLChunk += "
      "; - var attachmentName = "", sAttachmentFileName = "", bHasEML = false, attachmentType = "", sContentType = "", sExtension = "", iconSrc = ""; - var mailSubject = checkEmptyorWhitespace(oSearchGlobal.oServiceRequest.subject); - mailSubject = mailSubject.replace(oUploadGlobal.regularExtraSpace, "").replace(oUploadGlobal.regularInvalidCharacter, "").replace(oUploadGlobal.regularInvalidRule, ".").replace(oUploadGlobal.regularStartEnd, ""); - - sHTMLChunk += "
      "; - sHTMLChunk += "
      EditSave
      attachment icon
      " + mailSubject + "
      "; - sHTMLChunk += "
      "; - sHTMLChunk += "
      "; - - for (var attachment in oSearchGlobal.oServiceRequest.attachments) { - bHasEML = false; - nIDCounter++; - attachmentName = checkEmptyorWhitespace(oSearchGlobal.oServiceRequest.attachments[attachment].name); - attachmentName = attachmentName.replace(oUploadGlobal.regularExtraSpace, "").replace(oUploadGlobal.regularInvalidCharacter, "").replace(oUploadGlobal.regularInvalidRule, ".").replace(oUploadGlobal.regularStartEnd, ""); - if (attachmentName.lastIndexOf(".eml") === attachmentName.length - 4) { - sAttachmentFileName = attachmentName.substring(0, attachmentName.lastIndexOf(".eml")); - bHasEML = true; - } else { - sAttachmentFileName = attachmentName; - } - attachmentType = oSearchGlobal.oServiceRequest.attachments[attachment].hasOwnProperty("attachmentType") ? oSearchGlobal.oServiceRequest.attachments[attachment].attachmentType : ""; - sContentType = oSearchGlobal.oServiceRequest.attachments[attachment].hasOwnProperty("contentType") ? oSearchGlobal.oServiceRequest.attachments[attachment].contentType : ""; - sExtension = -1 < attachmentName.lastIndexOf(".") ? attachmentName.substring(attachmentName.lastIndexOf(".") + 1) : 1 === parseInt(attachmentType) ? "msg" : ""; - iconSrc = oCommonObject.getIconSource(sExtension); - - if (-1 < sContentType.indexOf(oGlobalConstants.Image_ContentType)) { - sImageChunk += "
      "; - sImageChunk += "
      EditSave
      " + sAttachmentFileName + "
      "; - sImageChunk += "
      "; - sImageChunk += "
      "; - } else { - sHTMLChunk += "
      "; - sHTMLChunk += "
      EditSave
      " + sAttachmentFileName + "
      "; - sHTMLChunk += "
      "; - sHTMLChunk += "
      "; - } - } - - if (sImageChunk) { - sHTMLChunk += sImageChunk; - } - - sHTMLChunk += "
      "; - - $(".maildata").html(sHTMLChunk); - // Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - $(".popupName").draggable({ - helper: "clone", - start: function (event, ui) { - $(this).draggable("option", "cursorAt", { - left: Math.floor(this.clientWidth / 2), - }); - } - }); -} - -function dragStart(ev) { - "use strict"; - oUploadGlobal.src = ev; -} - -// Function to upload local file -function uploadFile(clientRelativeUrl, folderUrl, isOverwrite) { - "use strict"; - if (clientRelativeUrl && folderUrl) { - // App Insight Event tracking for Attachment upload - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Local_Upload, true); - //// Check if the loading image is already present or not. If the loading image is not present, then append it - var oFolderStructureContent = $(".folderStructureContent"); - var sContent = ""; - if (!oFolderStructureContent.find(".uploadDocumentLoading").length) { oFolderStructureContent.append(""); } - //// Consolidate the output element. - $("body #form2").remove(); - $("body").append("
      "); - var form = document.querySelector("#form2"); - var data = new FormData(form); - - var sDocumentLibraryName = $("#mailContent").attr("data-originalname"); - data.append("SPAppToken", oSharePointContext.SPAppToken); - data.append("ClientUrl", oGlobalConstants.Site_Url + clientRelativeUrl.substring(0, clientRelativeUrl.lastIndexOf("/"))); - data.append("RefreshToken", oSharePointContext.RefreshToken); - data.append("FolderName", folderUrl); - data.append("AllowContentCheck", oUploadGlobal.bAllowContentCheck); - if ("undefined" !== typeof sDocumentLibraryName) { - data.append("DocumentLibraryName", sDocumentLibraryName); - } - - var nCounter = 0; - for (nCounter = 0; nCounter < oSearchGlobal.files.length; nCounter++) { - if (oSearchGlobal.files[nCounter]) { - data.append(oSearchGlobal.files[nCounter].name, oSearchGlobal.files[nCounter]); - data.append("Overwrite" + nCounter, isOverwrite); - } - } - - oUploadGlobal.iActiveUploadRequest++; - oUploadGlobal.oXHR.onreadystatechange = function () { - $(".mailContainer .notification .closeNotification").click(); - if (4 === oUploadGlobal.oXHR.readyState && 200 === oUploadGlobal.oXHR.status && oUploadGlobal.oXHR.responseText) { - oUploadGlobal.iActiveUploadRequest--; - if (0 === oUploadGlobal.iActiveUploadRequest) { - $(".uploadDocumentLoading").remove(); - } - var arrResponse = $("
      ").html(oUploadGlobal.oXHR.responseText).text().split("$|$"); - var overwriteExists = false; - var errorOccured = false; - var sOptionContent = ""; - for (var responseCount = 0; responseCount < arrResponse.length - 1; responseCount++) { - var response = arrResponse[responseCount].split(":::"); - var errorResponse = arrResponse[responseCount].split("$$$"); - if (1 < errorResponse.length) { - sContent = "
      Warning Message
      " + errorResponse[0] + "
      "; - oCommonObject.updateUploadPopupHeight(true); - $(".notificationContainerForPopup").append(sContent); - - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - oUploadGlobal.sNotificationMsg = ""; - errorOccured = true; - } else { - if (response.length > 1) { - var nIDCounter = $(".maildata .attachmentSection").length; - var sExtension = response[0].substring(response[0].lastIndexOf(".") + 1); - oUploadGlobal.arrOverwrite[responseCount] = "False"; - sContent = "
      "; - var sFolderName = oCommonObject.getRootFolderForMatter(response[1]); - sContent += "
      Uploaded successfully
      attachment icon
      " + response[0] + "
      (" + sFolderName + ")
      "; - sContent += "
      "; - sContent += "
      "; - - if (0 === nIDCounter) { - $(".maildata").html("
      "); - } - $(".maildata .attachmentSection").append(sContent); - oCommonObject.showNotification(oGlobalConstants.Upload_Success_Notification, "successNotification ms-font-weight-semibold"); - oUploadGlobal.sNotificationMsg = ""; - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - } else { - oUploadGlobal.sClientRelativeUrl = clientRelativeUrl; - oUploadGlobal.sFolderUrl = folderUrl; - oUploadGlobal.arrOverwrite[responseCount] = "True"; - var duplicateNotification = response[0].split("@@@"); - var contentCheckPerformed = response[0].split("|||"); - //// Update the content as per the logic. - var fileName = "undefined" !== typeof oSearchGlobal.files[responseCount] && oSearchGlobal.files[responseCount].name ? oSearchGlobal.files[responseCount].name.trim() : "", - bAppendEnabled = oCommonObject.overwriteConfiguration(fileName); - oUploadGlobal.bAppendOptionEnabled = bAppendEnabled; - - //// True means show append button and False means hide append button - var sAppendContent = bAppendEnabled ? "" : ""; - var sContentCheckChunk = ""; - if (oUploadGlobal.bAllowContentCheck && duplicateNotification[1] && "TRUE" === duplicateNotification[1].toUpperCase()) { - sContentCheckChunk = ""; - } - - //// Capture First message from page and preserve for later usage. - if ("undefined" !== typeof oUploadGlobal.sNotificationMsg && "" === oUploadGlobal.sNotificationMsg) { - oUploadGlobal.sNotificationMsg = duplicateNotification[0]; - } - - if (duplicateNotification[1]) { - //// Potential duplicate found, show notification to perform content check or overwrite or append - sOptionContent = sContentCheckChunk + "" + sAppendContent + ""; - sContent = oCommonObject.getNotificationContent(duplicateNotification[0], "", sOptionContent); - } else if (contentCheckPerformed[1]) { - //// Content Check is performed, show notification to overwrite or append - $(".notification").remove(); - oCommonObject.updateUploadPopupHeight(false); - sContentCheckChunk = ("TRUE" === contentCheckPerformed[1].toUpperCase()) ? sContentCheckChunk : ""; - sOptionContent = sContentCheckChunk + "" + sAppendContent + ""; - sContent = oCommonObject.getNotificationContent(oUploadGlobal.sNotificationMsg, contentCheckPerformed[0], sOptionContent); - - //// clear previous stored notification - oUploadGlobal.sNotificationMsg = ""; - } - oCommonObject.updateUploadPopupHeight(true); - $(".notificationContainerForPopup").append(sContent); - - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - oUploadGlobal.arrFiles.push(oSearchGlobal.files[responseCount]); - overwriteExists = true; - } - } - } - } else if (4 === oUploadGlobal.oXHR.readyState && 200 !== oUploadGlobal.oXHR.status) { - // TODO: if upload fails, display file name and red cross icon - oUploadGlobal.iActiveUploadRequest--; - if (0 === oUploadGlobal.iActiveUploadRequest) { - $(".uploadDocumentLoading").remove(); - } - } - if (overwriteExists || errorOccured) { - //// Dynamically increase the height of the popup - oCommonObject.updateUploadPopupHeight(true); - } - }; - oUploadGlobal.oXHR.open("POST", "UploadFile.aspx"); - oUploadGlobal.oXHR.setRequestHeader("RequestValidationToken", oMasterGlobal.Tokens); - oUploadGlobal.oXHR.send(data); - } -} - -// Function to upload attachment/Email from Outlook -function uploadAttachment(e, ui) { - "use strict"; - // Get folder URL and attachment ID. - e.stopPropagation(); - e.preventDefault(); - var arrSelectedFolderUrl = [], - arrSelectedAttachment = [], - arrTempAttachments = [], - iAttachmentPos = 0, - srcElement = ("undefined" === typeof ui) ? (($(oUploadGlobal.src).length) ? oUploadGlobal.src : false) : ui.draggable[0], - targetElement = "undefined" === typeof e.target.attributes["data-foldername"] ? $(e.target).parent()[0] : e.target, - sClientURL = targetElement.attributes["data-client"].value, - sDocumentLibraryName = $("#mailContent").attr("data-originalname"), //// Pass GUID - oParam = { source: srcElement, target: targetElement, arrTempAttachments: [], arrSelectedFolderUrl: [], arrMailFolderURL: [], isMail: false, documentLibraryName: sDocumentLibraryName }, - isMail = $(srcElement).parent().hasClass("mailName"); - if (!srcElement) { - return; - } - arrSelectedFolderUrl.push(targetElement.attributes["data-foldername"].value); - arrSelectedAttachment.push(srcElement.attributes["data-attachmentId"].value); - - // If mail selected than call to service. - if (isMail) { - var arrMailFolderURL = []; - arrMailFolderURL.push(targetElement.attributes["data-foldername"].value); - oParam.arrMailFolderURL = arrMailFolderURL; - oParam.isMail = true; - oSearchGlobal.oServiceRequest.subject = srcElement.innerHTML.trim() + ".eml"; - requestMailUpload(arrMailFolderURL, oParam, false, false); - } else if (0 !== arrSelectedAttachment.length && 0 !== arrSelectedFolderUrl.length && arrSelectedAttachment.length === arrSelectedFolderUrl.length) { - // Popup out unselected attachment ID from Global Array. - for (var attachment in oSearchGlobal.oServiceRequest.attachments) { - if (-1 !== arrSelectedAttachment.indexOf(oSearchGlobal.oServiceRequest.attachments[attachment].id)) { - if ("true" === $(srcElement).attr("hasEML")) { - oSearchGlobal.oServiceRequest.attachments[attachment].name = srcElement.innerHTML.trim() + ".eml"; - } else { - oSearchGlobal.oServiceRequest.attachments[attachment].name = srcElement.innerHTML.trim(); - } - oSearchGlobal.oServiceRequest.attachments[attachment].originalName = srcElement.attributes["data-originalName"].value; - arrTempAttachments[iAttachmentPos] = oSearchGlobal.oServiceRequest.attachments[attachment]; - } - } - oParam.arrTempAttachments = arrTempAttachments; - oParam.arrSelectedFolderUrl = arrSelectedFolderUrl; - requestAttachmentUpload(arrTempAttachments, arrSelectedFolderUrl, oParam, false, false); - } -} - -/* Function to retrieve the user's choice to overwrite a document or not and depending on that either overwrite that document or not */ -function overWriteDocument(oDocument) { - "use strict"; - var $askForOverwrite = $(".askForOverwrite"), - overWriteYes = $askForOverwrite.find("#overWriteYes")[0], - overWriteNo = $askForOverwrite.find("#overWriteNo")[0], - overWriteAppend = $askForOverwrite.find("#overWriteAppend")[0], - overWriteContentCheck = $askForOverwrite.find("#contentCheck")[0]; - - if ("undefined" !== typeof overWriteYes) { overWriteYes.disabled = true; } - if ("undefined" !== typeof overWriteNo) { overWriteNo.disabled = true; } - if ("undefined" !== typeof overWriteAppend) { overWriteAppend.disabled = true; } - if ("undefined" !== typeof overWriteContentCheck) { overWriteContentCheck = true; } - - if ("overWriteNo" === $(oDocument).attr("id")) { - if ("undefined" !== typeof overWriteYes) { overWriteYes.disabled = false; } - if ("undefined" !== typeof overWriteNo) { overWriteNo.disabled = false; } - if ("undefined" !== typeof overWriteAppend) { overWriteAppend.disabled = false; } - if ("undefined" !== typeof overWriteContentCheck) { overWriteContentCheck = false; } - $(oDocument).parents(".notification").remove(); - oUploadGlobal.sNotificationMsg = ""; - } - var oUploadParameter = oUploadGlobal.hasOwnProperty("oUploadParameter") && oUploadGlobal.oUploadParameter.length ? oUploadGlobal.oUploadParameter.pop() : "", - isUploadParameterHasTempAttachmentsProp = oUploadParameter.hasOwnProperty("arrTempAttachments"), - isUploadParameterHasSelectedFolderUrlProp = oUploadParameter.hasOwnProperty("arrSelectedFolderUrl"), - isUploadParameterHasIsMailProp = oUploadParameter.hasOwnProperty("isMail"), - isUploadParameterHasMailFolderURLProp = oUploadParameter.hasOwnProperty("arrMailFolderURL"), - sOperation = $(oDocument).attr("data-operation"); - - oUploadGlobal.sNotificationMsg = ("contentCheck" !== sOperation) ? "" : oUploadGlobal.sNotificationMsg; - - if ("overwrite" === sOperation) { - if (isUploadParameterHasIsMailProp && oUploadParameter.isMail) { - if (isUploadParameterHasMailFolderURLProp) { - requestMailUpload(oUploadParameter.arrMailFolderURL, oUploadParameter, true); - } - } else { - if (isUploadParameterHasTempAttachmentsProp && isUploadParameterHasSelectedFolderUrlProp) { - requestAttachmentUpload(oUploadParameter.arrTempAttachments, oUploadParameter.arrSelectedFolderUrl, oUploadParameter, true); - } - } - } else if ("append" === sOperation) { - var date = new Date(); - date = date.toISOString(); - var reg = new RegExp(":", "g"); - date = date.replace(reg, "_").replace(".", "_"); - if (isUploadParameterHasIsMailProp && oUploadParameter.isMail) { - var subject = oSearchGlobal.oServiceRequest.subject; - var subjectNameWithoutExt = subject.substring(0, subject.lastIndexOf(".")); - var extMail = subject.substr(subject.lastIndexOf(".") + 1); - oSearchGlobal.oServiceRequest.subject = subjectNameWithoutExt + "_" + date + "." + extMail; - if (isUploadParameterHasMailFolderURLProp) { - requestMailUpload(oUploadParameter.arrMailFolderURL, oUploadParameter, true); - } - } else { - if (isUploadParameterHasTempAttachmentsProp) { - for (var attachment in oUploadParameter.arrTempAttachments) { - var fileNameWithExt = oUploadParameter.arrTempAttachments[attachment].name; - if (-1 !== fileNameWithExt.lastIndexOf(".")) { - var fileNameWithoutExt = fileNameWithExt.substring(0, fileNameWithExt.lastIndexOf(".")); - var ext = fileNameWithExt.substr(fileNameWithExt.lastIndexOf(".") + 1); - oUploadParameter.arrTempAttachments[attachment].name = fileNameWithoutExt + "_" + date + "." + ext; - } else { - oUploadParameter.arrTempAttachments[attachment].name = fileNameWithExt + "_" + date; - } - } - } - if (isUploadParameterHasTempAttachmentsProp && isUploadParameterHasSelectedFolderUrlProp) { - requestAttachmentUpload(oUploadParameter.arrTempAttachments, oUploadParameter.arrSelectedFolderUrl, oUploadParameter, true); - } - } - } else if ("contentCheck" === sOperation) { - if (isUploadParameterHasIsMailProp && oUploadParameter.isMail) { - if (isUploadParameterHasMailFolderURLProp) { - requestMailUpload(oUploadParameter.arrMailFolderURL, oUploadParameter, false, true); - } - } else { - if (isUploadParameterHasTempAttachmentsProp && isUploadParameterHasSelectedFolderUrlProp) { - requestAttachmentUpload(oUploadParameter.arrTempAttachments, oUploadParameter.arrSelectedFolderUrl, oUploadParameter, false, true); - } - } - } - - if (0 < $(".notification").length) { - if ("undefined" !== typeof overWriteYes) { overWriteYes.disabled = false; } - if ("undefined" !== typeof overWriteNo) { overWriteNo.disabled = false; } - if ("undefined" !== typeof overWriteAppend) { overWriteAppend.disabled = false; } - if ("undefined" !== typeof overWriteContentCheck) { overWriteContentCheck = false; } - $(oDocument).parents(".notification").remove(); - } - //// Dynamically decrease the height of the popup - oCommonObject.updateUploadPopupHeight(false); -} - -function onUploadSuccess(result) { - "use strict"; - $(".mailContainer .notification .closeNotification").click(); - oUploadGlobal.iActiveUploadRequest--; - var successStatusId = result.oParam.source.id + "-Status"; - var successMessageId = result.oParam.source.id + "-Message"; - var count = result.oParam.source.id.split("attachment")[0]; - var target = result.oParam.target; - var folderName = target.attributes["data-foldername"].value.substring(target.attributes["data-foldername"].value.lastIndexOf("/") + 1); - var sOptionContent = ""; - if ("True" === result.Result) { - if (0 === oUploadGlobal.iActiveUploadRequest) { - $(".uploadDocumentLoading").remove(); - } - - $("#" + successStatusId).empty(); - $("#" + successStatusId).append("Uploaded successfully"); - var thisAttachment = $("#" + count + "attachment"); - if (result.oParam.isMail) { - var subject = oSearchGlobal.oServiceRequest.subject; - subject = subject.substring(0, subject.lastIndexOf(".")); - thisAttachment.html(subject); - thisAttachment.attr("title", subject); - } else { - var extEmlOrMsg = result.oParam.arrTempAttachments[0].name.substr(result.oParam.arrTempAttachments[0].name.lastIndexOf(".") + 1); - if ("eml" === extEmlOrMsg || "msg" === extEmlOrMsg) { - thisAttachment.html(result.oParam.arrTempAttachments[0].name.substring(0, result.oParam.arrTempAttachments[0].name.lastIndexOf("."))); - thisAttachment.attr("title", result.oParam.arrTempAttachments[0].name.substring(0, result.oParam.arrTempAttachments[0].name.lastIndexOf("."))); - } else { - thisAttachment.html(result.oParam.arrTempAttachments[0].name); - thisAttachment.attr("title", result.oParam.arrTempAttachments[0].name); - } - } - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - var sFolderName = oCommonObject.getRootFolderForMatter(folderName); - $("#" + successMessageId).attr("title", sFolderName).text("(" + sFolderName + ")").removeClass("uploadFailedMessage hide").addClass("uploadSuccessMessage"); - $("#" + count + "editIcon, #" + count + "saveIcon").addClass("hide"); - oCommonObject.showNotification(oGlobalConstants.Upload_Success_Notification, "successNotification ms-font-weight-semibold"); - } else if ("False" !== result.Result) { - var errorResponse = result.Result.split("$$$"); - oUploadGlobal.oUploadParameter.push(result.oParam); - var sContent = ""; - if (1 < errorResponse.length) { - sOptionContent = ""; - sContent = oCommonObject.getNotificationContent(errorResponse[0], "", sOptionContent); - } else { - //// update the content as per the logic - var selectedOverwriteConfiguration = oGlobalConstants.Overwrite_Config_Property.trim().toLocaleUpperCase(), - bAppendEnabled = false, - fileExtension = "undefined" !== typeof result.oParam.arrTempAttachments[0] && result.oParam.arrTempAttachments[0].name ? result.oParam.arrTempAttachments[0].name.trim().substring(result.oParam.arrTempAttachments[0].name.trim().lastIndexOf(".") + 1) : ""; - var isEmail = result.oParam.isMail ? true : (1 === parseInt(result.oParam.source.attributes.attachmentType.value) || "eml" === fileExtension) ? true : false; - var duplicateNotification = result.Result.split("@@@"); - var contentCheckPerformed = result.Result.split("|||"); - - switch (selectedOverwriteConfiguration) { - case "BOTH": - bAppendEnabled = true; - break; - case "DOCUMENT ONLY": - bAppendEnabled = isEmail ? false : true; - break; - default: - bAppendEnabled = isEmail ? true : false; - break; - } - - //// True means show append button and False means hide append button - var sAppendContent = bAppendEnabled ? "" : ""; - - var sContentCheckChunk = ""; - if (oUploadGlobal.bAllowContentCheck && duplicateNotification[1] && "TRUE" === duplicateNotification[1].toUpperCase()) { - sContentCheckChunk = ""; - } - - if (!oUploadGlobal.sNotificationMsg.trim()) { - oUploadGlobal.sNotificationMsg = duplicateNotification[0]; - } - - if (duplicateNotification[1]) { - sOptionContent = sContentCheckChunk + "" + sAppendContent + ""; - sContent = oCommonObject.getNotificationContent(duplicateNotification[0], "", sOptionContent); - } else if (contentCheckPerformed[1] && !oUploadGlobal.bIsAbortedCC) { - //// Content Check is performed , remove notification message set by contentCheckNotification() - $(".notification").remove(); - oCommonObject.updateUploadPopupHeight(false); - if (contentCheckPerformed[1]) { - sContentCheckChunk = ("TRUE" === contentCheckPerformed[1].toUpperCase()) ? sContentCheckChunk : ""; - sOptionContent = "" + sAppendContent + ""; - - sContent = oCommonObject.getNotificationContent(oUploadGlobal.sNotificationMsg, contentCheckPerformed[0], sOptionContent); - //// clear previous stored notification - oUploadGlobal.sNotificationMsg = ""; - } - } - oUploadGlobal.bIsAbortedCC = false; - } - //// Dynamically increase the height of the popup - oCommonObject.updateUploadPopupHeight(true); - $(".notificationContainerForPopup").append(sContent); - - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - } else { - sOptionContent = ""; - - sContent = oCommonObject.getNotificationContent(oGlobalConstants.Upload_Failed_Message, "", sOptionContent); - $(".notificationContainerForPopup").append(sContent); - //// Making icons non draggable on upload popup - $(".mailContainer img").attr("draggable", "false"); - $("#" + successMessageId).attr("title", oGlobalConstants.Upload_Failed_Marker).text(oGlobalConstants.Upload_Failed_Marker).addClass("uploadFailedMessage").removeClass("uploadSuccessMessage"); - } - if (0 === oUploadGlobal.iActiveUploadRequest) { - $(".uploadDocumentLoading").remove(); - } -} - -function onUploadFailure(result) { - "use strict"; - var failureStatusId = result.oParam.id + "-Status"; - oUploadGlobal.iActiveUploadRequest--; - if (0 === oUploadGlobal.iActiveUploadRequest) { - $(".uploadDocumentLoading").remove(); - } - showPopupNotification(oFindMatterConstants.Mail_Upload_Failure, "failNotification"); -} - -function onUploadCallBefore() { - "use strict"; - var oFolderStructureContent = $(".folderStructureContent"); - // Check if the loading image is already present or not. If the loading image is not present, then append it - if (!oFolderStructureContent.find(".uploadDocumentLoading").length) { oFolderStructureContent.append(""); } - oUploadGlobal.iActiveUploadRequest++; -} - -function requestMailUpload(mailfolderUrl, oParam, isOverwrite, isContentCheck) { - "use strict"; - var sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oSearchGlobal.matterUrl }, "serviceRequest": { "AttachmentToken": oSearchGlobal.oServiceRequest.attachmentToken, "EwsUrl": oSearchGlobal.oServiceRequest.ewsUrl, "Attachments": oSearchGlobal.oServiceRequest.attachments, "MailId": oSearchGlobal.oServiceRequest.MailId, "FolderPath": mailfolderUrl, "Subject": oSearchGlobal.oServiceRequest.subject, "Overwrite": isOverwrite, "PerformContentCheck": isContentCheck, "DocumentLibraryName": oParam.documentLibraryName, "AllowContentCheck": oUploadGlobal.bAllowContentCheck } }; - oCommonObject.callSearchService("UploadMail", sParameters, onUploadSuccess, onUploadFailure, onUploadCallBefore, oParam); -} - -function requestAttachmentUpload(arrTempAttachments, arrSelectedFolderUrl, oParam, isOverwrite, isContentCheck) { - "use strict"; - var sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": oSearchGlobal.matterUrl }, "serviceRequest": { "AttachmentToken": oSearchGlobal.oServiceRequest.attachmentToken, "EwsUrl": oSearchGlobal.oServiceRequest.ewsUrl, "Attachments": arrTempAttachments, "MailId": oSearchGlobal.oServiceRequest.MailId, "FolderPath": arrSelectedFolderUrl, "Subject": oSearchGlobal.oServiceRequest.subject, "Overwrite": isOverwrite, "PerformContentCheck": isContentCheck, "DocumentLibraryName": oParam.documentLibraryName, "AllowContentCheck": oUploadGlobal.bAllowContentCheck } }; - oCommonObject.callSearchService("UploadAttachment", sParameters, onUploadSuccess, onUploadFailure, onUploadCallBefore, oParam); -} - -function openFileBrowser() { - "use strict"; - var fileExplorer = $("#fileExplorer"); - var files = []; - var tempFiles = fileExplorer[0].files; - fileExplorer.click(); - var selectedFiles = fileExplorer[0].files; - var isOverwrite = "False"; - if (selectedFiles.length > 0 && tempFiles !== selectedFiles) { - oSearchGlobal.files = fileExplorer[0].files; - var folderURL = oSearchGlobal.oFolderName[0].url; - // upload browsed file(s) to root folder - uploadFile(folderURL, folderURL, isOverwrite); - } -}; - -function editAttachment(oElement, count) { - "use strict"; - // App Insight Event tracking for edit Attachment name - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Rename_Mail_Attachment, true); - var thisAttachment = $("#" + count + "attachment"); - var thisAttachmentText = $("#" + count + "attachmentText"); - var thisEditIcon = $("#" + count + "editIcon"); - var thisSaveIcon = $("#" + count + "saveIcon"); - var thisAttachIcon = $("#" + count + "attachIcon"); - var attachmentText = thisAttachment[0].innerHTML; - var thisStatusMessage = $("#" + count + "attachment-Message"); - - if (thisSaveIcon.hasClass("hide")) { - thisSaveIcon.removeClass("hide"); - thisEditIcon.addClass("hide"); - thisAttachIcon.addClass("hide"); - thisStatusMessage.attr("title", "").empty().addClass("hide"); - } - - if (thisAttachmentText.hasClass("hide")) { - thisAttachmentText.removeClass("hide"); - thisAttachment.addClass("hide"); - thisAttachmentText.val(attachmentText); - } -}; - -function saveAttachment(oElement, count) { - "use strict"; - // App Insight Event tracking for saving updated attachment name - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Save_Renamed_Mail_Attachment, true); - var thisAttachment = $("#" + count + "attachment"); - var thisAttachmentText = $("#" + count + "attachmentText"); - var thisEditIcon = $("#" + count + "editIcon"); - var thisSaveIcon = $("#" + count + "saveIcon"); - var thisAttachIcon = $("#" + count + "attachIcon"); - var attachmentText = thisAttachmentText[0].value.trim(); - var oldText = thisAttachment[0].innerHTML; - if (!oUploadGlobal.regularInvalidCharacter.test(attachmentText) && !oUploadGlobal.regularExtraSpace.test(attachmentText) && !oUploadGlobal.regularInvalidRule.test(attachmentText) && !oUploadGlobal.regularStartEnd.test(attachmentText)) { - if (thisEditIcon.hasClass("hide")) { - thisEditIcon.removeClass("hide"); - thisAttachIcon.removeClass("hide"); - thisSaveIcon.addClass("hide"); - } - if (thisAttachment.hasClass("hide")) { - thisAttachment.removeClass("hide"); - thisAttachmentText.addClass("hide"); - if ("" === attachmentText) { - thisAttachment.html(oldText); - thisAttachment.attr("title", oldText); - } else { - thisAttachment.html(attachmentText); - thisAttachment.attr("title", attachmentText); - } - } - $(".errorPopUp").addClass("hide"); - } else { - oUploadGlobal.regularInvalidCharacter.lastIndex = 0; - showErrorNotification(thisAttachmentText, "Invalid character"); - } -}; - -function showErrorNotification(sElement, sMsg) { - "use strict"; - var windowWidth = oCommonObject.getWidth(); - var removeTop = 75, removeLeft = 115; - var posLeft = "50px"; - var triangleTopPos = 48; - var errorBoxHeight = 62; - var iLeftPos = $(sElement).offset().left - , iTopPos = $(sElement).offset().top - , iCurrentWidth = $(sElement).outerWidth(); - iLeftPos = parseInt(iLeftPos, 10) + parseInt(iCurrentWidth, 10) - 20; - iTopPos = parseInt(iTopPos, 10) - 20; - var errorPopUp = $("#mainContainer .errorPopUp"); - - - errorPopUp.css("left", iLeftPos - removeLeft).css("top", iTopPos - removeTop).removeClass("hide").find(".errText").text(sMsg); - $(".errorPopUp .errTriangleBorder").css("left", posLeft); - $(".errorPopUp .errTriangle").css("left", posLeft); - $(".errorPopUp .errTriangleBorder").css("top", "calc(50% - -" + triangleTopPos + "px)"); - $(".errorPopUp .errTriangle").css("top", "calc(50% - -" + (triangleTopPos + 1) + "px)"); - $(".errorPopUp .errText").css("min-height", errorBoxHeight + "px"); -} - -// Function to close the upload success notification -$(document).on("click", ".mailContainer .notification .closeNotification", function () { - "use strict"; - var minRequiredHeight = 283, updatedHeight = $(".mailContainer").height() - 30; - $(".mailContainer .successNotification").remove(); - if (minRequiredHeight <= updatedHeight) { - $(".mailContainer").height(updatedHeight); // Adjusting the height of the popup, post removing notification - } -}); \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/WebDashboard.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/WebDashboard.js deleted file mode 100644 index e4b9282c..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/WebDashboard.js +++ /dev/null @@ -1,1202 +0,0 @@ -/// JS3085.VariableDeclaredMultipleTimes,JS3058,JS3057,JS2064,JS2027,JS2032,JS2074,JS3092,JS2076,JS2024,JS2016,JS2026,JS3116,JS2005,JS2073,JS1003 - -(function () { - "use strict"; - if (window.top !== window.self) { - $("body").addClass("hideScrollSP"); - } - // Solution to force a reload when page is loaded from back-forward cache to resolve issue in Safari Browser - $(window).bind("pageshow", function (event) { - if (event.originalEvent.persisted) { - window.location.reload(); - } - }); -})(); - -$(document).on("click", ".matterName, .matterTitle", function (event) { - "use strict"; - if (!event) { - event = window.event; - event.cancelBubble = true; - } - if (event.stopPropagation) { - event.stopPropagation(); - } -}); - -$(document).ready(function (event) { - "use strict"; - /* Set current page to 3 */ - oPageConfig.currentPage = 3; - oGridConfig.bPageLoad = true; - oCommonObject.sCurrentPage = oGlobalConstants.App_Name_Web_Dashboard; - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + "/" + oCommonObject.sCurrentPage, true); - $("#MasterPageContainer").removeClass("MasterPageContent"); - $("#MasterPageForm > .mailpopupContainerBackground").remove(); - $("#MasterPageForm > .mailContainer").remove(); - - // Logic to prevent multiple service call on resize of browser height - oGridConfig.prevBrowserWidth = $(window).height(); - - $(".navDiv").addClass("divPinnedMatters"); - $(".templates").attr({ "href": oGlobalConstants.Site_Url + oWebDashboardConstants.TemplatesURL, "target": "_parent" }); - $("#settingsLink").attr({ "href": oGlobalConstants.Site_Url + oGlobalConstants.SettingsPage, "target": "_parent" }); - $(".appName").find("a").attr({ "href": oGlobalConstants.Site_Url + oGlobalConstants.TenantWebDashboard, "target": "_parent" }); - $("#optionFileNameASCForMatters, #optionFileNameDESCForMatters").attr("data-sort-value", oGlobalConstants.Matter_Name); - $("#optionCreatedDateASCForMatters, #optionCreatedDateDESCForMatters").attr("data-sort-value", oGlobalConstants.Open_Date); - $("#optionModifiedDateASCForMatters, #optionModifiedDateDESCForMatters").attr("data-sort-value", oGlobalConstants.Last_Modified_Time); - $("#optionFileNameASCForDocuments, #optionFileNameDESCForDocuments").attr("data-sort-value", oGlobalConstants.File_Name); - $("#optionCreatedDateASCForDocuments, #optionCreatedDateDESCForDocuments").attr("data-sort-value", oGlobalConstants.Created_Date); - $("#optionModifiedDateASCForDocuments, #optionModifiedDateDESCForDocuments").attr("data-sort-value", oGlobalConstants.Document_Last_Modified_Time); - var arrClientParameters = getParameterByName("clientparameters").split("$|$"); - if (1 < arrClientParameters.length) { - oSearchGlobal.sClientName = arrClientParameters[0]; - oSearchGlobal.sClientSiteUrl = arrClientParameters[1]; - } else if (1 === arrClientParameters.length && "" !== arrClientParameters[0]) { - oSearchGlobal.bIsTenantCall = true; - } - var arrSectionParameter = getParameterByName("section"); - if (arrSectionParameter && "1" === arrSectionParameter) { // if section=1 in query string, load Matter view - oGridConfig.isMatterView = true; - $("#DisplayFindMattersResults").attr("class", "fallbackFlex"); - $("#DisplaySearchDocumentsResults").attr("class", "hide"); - $("#EmailDiv").css("display", "none"); - } else if (arrSectionParameter && "2" === arrSectionParameter) { // if section=2 in query string, load Documents view - oGridConfig.isMatterView = false; - $("#DisplayFindMattersResults").attr("class", "hide"); - $("#DisplaySearchDocumentsResults").attr("class", "fallbackFlex"); - $("#footer").addClass("documentFooter"); - $("#EmailDiv").css("display", "inline"); - } - if (oGridConfig.isMatterView) { - $("#searchMatterTab").addClass("selected"); - $("#searchDocumentTab").removeClass("selected"); - } else { - $("#searchMatterTab").removeClass("selected"); - $("#searchDocumentTab").addClass("selected"); - } - - $("#feedbackandsupport").attr("href", oWebDashboardConstants.Feedback_and_Support); - if ($(".pinnedSearch").hasClass("active")) { - oGridConfig.currentView = 1; - } else if ($(".col2").hasClass("active")) { - oGridConfig.currentView = 2; - } else { - oGridConfig.currentView = 0; - } - - $(document).on("click", ".quickLinksMenuButton", function (event) { - $(".quickLinksMenuItems").toggle(); - closeAllPopupExcept("quickLinksMenuItems", event); - event.stopPropagation(); - }); - $(document).on("click", ".matterPopup", function (event) { - commonFunction.closeAllFilterExcept("matterPopup", event); - event.stopPropagation(); - }); - $(document).on("click", ".documentPopup", function (event) { - commonFunction.closeAllFilterExcept("documentPopup", event); - event.stopPropagation(); - }); - - $(".topNavMenuButton").click(function () { - - if ($(".responsiveMenu_topNavItems").is(":visible")) { - $(".responsiveMenu_topNavItems").hide(); - $(".switchApp").css("top", "10px"); - } else { - $(".responsiveMenu_topNavItems").show(); - $(".switchApp").css("top", "-147"); - } - }); - $(".LeftContent").bind("DOMNodeInserted DOMSubtreeModified DOMNodeRemoved", function (event) { - var leftContentHeight = $(".LeftContent").height(); - $(".sideNav").height(parseInt(leftContentHeight, 10) - 54); - }); - $(".TopNavElements a").click(function () { - $(".TopNavElements a").removeClass(); - $($(this).attr("href")).addClass("active"); - }); - $("#EmailDiv").click(function (event) { - if (oGridConfig.arrSelectedGridData.length !== 0) { - $("#EmailDiv").css("cursor", "pointer"); - $("#EmailDiv").css("color", "#333"); - showPopup(event); - } else { - $("#EmailDiv").css("cursor", "default"); - $("#EmailDiv").css("color", "#444"); - } - $(".content a").not(this).hide("slow"); - }); - - // for find document and find matter auto complete search - $(document).on("keyup", ".filterSearchText", function (event) { - oCommonObject.bHideAutoComplete = false; - if ($(this).val()) { - if (13 === event.which) { - oCommonObject.bHideAutoComplete = true; - // App Insight Event tracking for Textbox search - var sCurrentEvent = (oGridConfig.isMatterView ? oGlobalConstants.Matter_Textbox_Search : oGlobalConstants.Document_Textbox_Search); - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + sCurrentEvent, true); - oGridConfig.nGridPageNumber = 1; - updateSortSettings(event); - if (0 !== $(".autoCompleteSelected").length) { - var sSelectedContent = $(".autoCompleteSelected").text(); - // Removal of unwanted HTML Tags - if (sSelectedContent && "" !== sSelectedContent) { - sSelectedContent = sSelectedContent.replace(/""/g, "").replace(/"<\/span>"/g, ""); - } - $(".filterSearchText").val(sSelectedContent); - $(".filterAutoComplete").html("").addClass("hide"); - } - oGridConfig.isMatterView ? setGlobalRefiners() : $("#results").click(); - advancedSearch("grid", "tileContainer"); - advanceSearchDropdown(); - } - if ("" !== $(".filterAutoComplete").html()) { - if (0 === $(".autoCompleteSelected").length) { - if (40 === event.which) { $($(".autoCompleteRow")[0]).addClass("autoCompleteSelected"); } - if (38 === event.which) { $($(".autoCompleteRow")[parseInt($(".autoCompleteRow").length, 10) - 1]).addClass("autoCompleteSelected"); } - - } else { - var nPosition = $(".autoCompleteRow").filter(".autoCompleteSelected").index(); - - $($(".autoCompleteRow")[nPosition]).removeClass("autoCompleteSelected"); - if (40 === event.which) { - if (parseInt($(".autoCompleteRow").length, 10) - 1 !== nPosition) { - nPosition = nPosition + 1; - } else { - - $(".filterSearchText").focus(); - $(".autoCompleteRow").removeClass("autoCompleteSelected"); - return false; - } - } - if (38 === event.which) { - if (0 !== nPosition) { - nPosition = nPosition - 1; - } else { - - $(".filterSearchText").focus(); - $(".autoCompleteRow").removeClass("autoCompleteSelected"); - return false; - } - } - $($(".autoCompleteRow")[nPosition]).addClass("autoCompleteSelected"); - } - } - if (40 !== event.which && 38 !== event.which && 13 !== event.which && "" !== $(this).val()) { - autoComplete(); - } - } else { - oCommonObject.bHideAutoComplete = true; - $(".filterAutoComplete").addClass("hide"); - } - }); - - $(".mailCartCloseIcon").click(function () { - $(".popupContainerBackground").click(); - }); - - /*Function to close the popup */ - $(".popupContainerBackground").not(".popUpContainer").click(function () { - "use strict"; - $(".popupContainerBackground, .popUpContainer").addClass("hide"); - $(".popUpContainer").css("height", ""); - }); - $("#MatterCreation, #responsiveMenu_MatterCreation").attr("href", oWebDashboardConstants.Matter_Provision_App_Link); - - // For sorting the grid in matter view - - $(".sdBannerDropdown").click(function (event) { - var $Element = oGridConfig.isMatterView ? $("#sdBannerDropdownForMatters") : $("#sdBannerDropdownForDocuments"), oSearchPopup = $("#filterSearch"); - commonFunction.openSortDropdown(".sdBannerDropdown", $Element, 1, event); - if (oSearchPopup && oSearchPopup.is(":visible")) { - $(".filterSearchDD").toggle(); - } - event && event.stopPropagation(); - commonFunction.closeAllFilterExcept("sdBannerPanel", null); - }); - - $(".viewSwitcher").click(function (event) { - commonFunction.closeAllFilterExcept("switchTab", null); - }); - - $(".sdBannerPanelItem").click(function (event) { - oGridConfig.nGridPageNumber = 1; - var sortText = this.innerHTML; - var $Element = $(".sdBannerText"); - var sortTextWidth = sortText.length > 5 ? sortText.length < 9 ? 56 : (sortText.length - 2) * 8 : 35; - $Element.val(sortText).css("width", sortTextWidth + "px") - .attr("data-sort-value", $(this).attr("data-sort-value")) - .attr("data-order", $(this).attr("data-order")) - .attr("data-value", $(this).attr("data-value")) - .attr("data-ss-value", $(this).attr("data-ss-value")); - - if (1 === parseInt($Element.attr("data-result"), 10)) { - // call sorting for all search result - oCommonObject.bCalledForSort = true; - advancedSearch(); - } else if (2 === parseInt($Element.attr("data-result"), 10)) { - // Clear the filter panel - clearFilterPanel(); - - // call sorting for recent document result. - oGridConfig.isMatterView ? oCommonObject.getRecentMatters("recentMatters", 1, 1, false, event) : oCommonObject.getRecentDocuments("RecentDocumentContainer", 1, 1, false, event); - } else { - // call sorting for all pinned result - var sSelectedValue = $Element.attr("data-value"); - if (oGridConfig.arrPinnedData.length) { - oGridConfig.isMatterView ? sortPinMatter("pinnedGrid_Grid", sSelectedValue) : sortPinDocument("pinnedGrid_Grid", sSelectedValue); - } - } - $(".sdBannerPanel").addClass("hide"); - createResponsiveGrid(); - }); - - // Initialized sort by dropdown - var arrDropDownOptions = [oGlobalConstants.Sort_Type_None, oGlobalConstants.Sort_Type_Alphabetical_ASC, oGlobalConstants.Sort_Type_Alphabetical_DESC, oGlobalConstants.Sort_Type_Date_Created_ASC, oGlobalConstants.Sort_Type_Date_Created_DESC, oGlobalConstants.Sort_Type_Date_Modified_ASC, oGlobalConstants.Sort_Type_Date_Modified_DESC]; - $("#sdBannerDropdownForMatters .sdBannerPanelItem").each(function (index) { - $(this).text(arrDropDownOptions[index]); - }); - - $("#sdBannerDropdownForDocuments .sdBannerPanelItem").each(function (index) { - $(this).text(arrDropDownOptions[index]); - }); - - $("#RecentMattersHeader").click(function (event) { - // App Insight Event tracking for recent matters - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Recent_Matters, true); - }); - $("#PinnedMatters").click(function (event) { - // App Insight Event tracking for pinned matters - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Pinned_Matters, true); - }); - $("#PinnedDocuments").click(function (event) { - // App Insight Event tracking for recent matters - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Pinned_Documents, true); - }); - $("#RecentDocuments").click(function (event) { - // App Insight Event tracking for recent matters - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Recent_Documents, true); - }); -}); - -function removeAttachment(thisObject) { - "use strict"; - // App Insight Event tracking for removing mailcart documents - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Remove_From_Mail_Cart, true); - var iIterator, - iRetrieveIndex = parseInt($(thisObject).parents("li")[0].id), - iSelectedTab; - for (iIterator = 0; iIterator < $(thisObject).parents("li").siblings("li").length; iIterator++) { - var iListItemSiblings = $(thisObject).parents("li").siblings("li")[iIterator].id; - if (iListItemSiblings > $(thisObject).parents("li")[0].id) { - $(thisObject).parents("li").siblings("li")[iIterator].id = iListItemSiblings - 1; - } - } - if (1 === oGridConfig.currentView) { - iSelectedTab = "#pinnedGrid_Grid"; - for (iIterator = 0; iIterator <= oGridConfig.arrPinnedData.length - 1; iIterator++) { - if (oGridConfig.arrPinnedData[iIterator].DocumentUrl === oGridConfig.arrSelectedGridData[iRetrieveIndex].DocumentUrl || oGridConfig.arrPinnedData[iIterator].DocumentUrl === oGridConfig.arrSelectedGridData[iRetrieveIndex].Path) { - removeCheck(iSelectedTab, iIterator); - } - } - } else { - iSelectedTab = 2 === oGridConfig.currentView ? "#RecentDocumentContainer_Grid" : "#grid_Grid"; - for (iIterator = 0; iIterator <= oGridConfig.arrGridData.length - 1; iIterator++) { - if (oGridConfig.arrGridData[iIterator].Path === oGridConfig.arrSelectedGridData[iRetrieveIndex].DocumentUrl || oGridConfig.arrGridData[iIterator].Path === oGridConfig.arrSelectedGridData[iRetrieveIndex].Path) { - removeCheck(iSelectedTab, iIterator); - } - } - } - - if ($(iSelectedTab).find("#isSelectRowsActive").find("input[type='checkbox']:checked")) { - $(iSelectedTab).find("#isSelectRowsActive").prop("checked", false); - } - oGridConfig.arrSelectedGridData.splice(iRetrieveIndex, 1); - $(thisObject).parents("li").remove(); - var nCount = oGridConfig.arrSelectedGridData.length; - displayAttachmentCount(nCount); - if ($(".attachmentList").length === 0) { - $(".popupContainerBackground, .popUpContainer").addClass("hide"); - } -} - -function removeCheck(iSelectedTab, iIterator) { - "use strict"; - var $this; - if (!oGridConfig.isTileView) { - - $this = $("" + iSelectedTab + " tbody tr:nth-child(" + (iIterator + 1) + ") td div").find(".documentCheckBox"); - if ($this.is(":checked")) { - $this.attr("checked", false); - } - } else { - $this = $("" + iSelectedTab + " tbody tr:nth-child(" + (iIterator + 1) + ") td div"); - var mailCartIcon = $($this.find(".addToMailCart")).find(".mailCartRemoveIcon"); - if ($(mailCartIcon).length) { - $(mailCartIcon).removeClass("mailCartRemoveIcon").addClass("floatContentLeft mailCartAddIcon").attr("src", "../Images/add-to-cart-666.png"); - } else { - $(mailCartIcon).removeClass("floatContentLeft mailCartAddIcon").addClass("mailCartRemoveIcon").attr("src", "../Images/remove-from-cart-d24726.png"); - } - } -} - -function displayAttachmentCount(nCount) { - "use strict"; - if (nCount === 1) { - $(".popUpHeader .popUpHeaderTitle #EmailHeader").text("You have " + nCount + " attachment"); - } else { - $(".popUpHeader .popUpHeaderTitle #EmailHeader").text("You have " + nCount + " attachments"); - } - $("#EmailTextCount").text("(" + nCount + ")"); -} - -function placeDetailsPopup(element, event) { - "use strict"; - (oGridConfig.isMatterView) ? $("#matterPopupPointerPosition").removeClass("matterPopupPointerFirst matterPopupPointerOffice flyoutPositioningDefault").addClass("matterPopupPointer") : - $("#documentPopupPointerPosition").removeClass("matterPopupPointerFirst matterPopupPointerOffice flyoutPositioningDefault").addClass("matterPopupPointer"); - var popup = oGridConfig.isMatterView ? "matterPopup" : "documentPopup"; - var nAddTop = 0, left = 0; - var nWidth = getWidth(); - var iContentHeight = $(".LeftContent").height(); - var iExpectedHeight = $(element).offset().top + $("." + popup).height(); - - iExpectedHeight = iExpectedHeight + 95; - nAddTop = (nWidth >= 1200) ? 129 : 94; - left = 170; - $("." + popup).css({ top: ($(element).offset().top - nAddTop), left: ($(element).offset().left + left) }); - - if (("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) || oSearchGlobal.bIsTenantCall) { - (iContentHeight < iExpectedHeight) ? updateIframeHeight(iExpectedHeight) : updateIframeHeight(iContentHeight); - } - - $("." + popup).show(); - commonFunction.closeAllFilterExcept(popup); - if (!event) { - event = window.event; - event.cancelBubble = true; - } - if (event.stopPropagation) { - event.stopPropagation(); - } -} - -function showDetailsPopup(element, event) { - "use strict"; - (oGridConfig.isMatterView) ? $("#matterPopupLoading").removeClass("hide") : $("#documentPopupLoading").removeClass("hide"); - ////Commented this call for now, as this will be available post Document landing page changes - ////oCommonObject.getDocumentLandingAssets(this); - if ($(".filterSearchAdvance").css("display") === "block") { - $(".filterSearchDD").toggle(); - } - if (oGridConfig.isMatterView) { - $(".matterPopupData").addClass("hide"); - showMatterDetailsPopup(element, event); - } else { - oCommonObject.getDocumentLandingAssets($(element).find(".nameColumn")); - $(".documentPopupData").addClass("hide"); - showDocumentDetailsPopup(element, event); - } - placeDetailsPopup(element, event); -} - -function showMatterDetailsPopup(element, event) { - "use strict"; - var matterPopData = $(".matterPopupData"); - if (matterPopData.length) { - var arrData = [], - matterName, - matterClientUrl, - matterClientName, - matterAreaOfLaw, - matterSubAreaOfLaw, - matterPracticeGroup, - matterOpenDate, - matterContentType, - readMore, - matterLandingPageUrl, - matterUrl, - matterClientID, - matterMatterID, - matterResponsibleAttorney, - matterOriginalName, - matterIsReadOnlyUser; - var nRowIndex = $(element).parent()[0].rowIndex + (oGridConfig.nPinnedGridPageNumber * oGridConfig.itemsPerPage) - 1; - - if (1 === oGridConfig.currentView) { // Pinned Matter view - arrData = oGridConfig.arrPinnedData; - //// Changes for URL consolidation - matterName = (null !== arrData[nRowIndex].MatterGuid) ? oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterGuid)) : oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterName)); - matterClientName = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterClient)); - matterClientUrl = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterClientUrl)); - matterAreaOfLaw = oCommonObject.renderAsText(arrData[nRowIndex].MatterAreaOfLaw.slice(0, arrData[nRowIndex].MatterAreaOfLaw.trim().length - 1)); - matterSubAreaOfLaw = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterSubAreaOfLaw)); - matterPracticeGroup = oCommonObject.renderAsText(arrData[nRowIndex].MatterPracticeGroup.slice(0, arrData[nRowIndex].MatterPracticeGroup.trim().length - 1)); - matterOpenDate = oCommonObject.renderAsText(formatDate(arrData[nRowIndex].MatterCreatedDate)); - matterContentType = oCommonObject.renderAsText(arrData[nRowIndex].MatterDescription); - matterUrl = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterUrl)); - matterClientID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterClientId.trim())); - matterMatterID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterID.trim())); - matterResponsibleAttorney = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].MatterResponsibleAttorney.trim())); - //// Changes for URL consolidation - matterOriginalName = arrData[nRowIndex].MatterName ? arrData[nRowIndex].MatterName.trim() : "NA"; - matterIsReadOnlyUser = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].HideUpload.trim())); - } else { // Recent Matter and All Matter view - arrData = (oGridConfig.currentView) ? oGridConfig.arrRecentData : oGridConfig.arrGridData; - //// Changes for URL consolidation - matterName = (null !== arrData[nRowIndex][oGlobalConstants.Matter_GUID]) ? oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Matter_GUID])) : oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Matter_Name])); - matterClientName = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Client_Name])); - matterClientUrl = oCommonObject.renderAsText(arrData[nRowIndex].SiteName); - matterAreaOfLaw = oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Area_Of_Law].slice(0, arrData[nRowIndex][oGlobalConstants.Area_Of_Law].trim().length - 1)); - matterSubAreaOfLaw = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Sub_Area_Of_Law])); - matterPracticeGroup = oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Practice_Group].slice(0, arrData[nRowIndex][oGlobalConstants.Practice_Group].trim().length - 1)); - matterOpenDate = oCommonObject.renderAsText(formatDate(arrData[nRowIndex][oGlobalConstants.Open_Date])); - matterContentType = oCommonObject.renderAsText(arrData[nRowIndex].Description); - matterUrl = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].Path)); - matterClientID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Client_ID])); - matterMatterID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Matter_ID])); - matterResponsibleAttorney = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Responsible_Attorney])); - //// Changes for URL consolidation - matterOriginalName = arrData[nRowIndex][oGlobalConstants.Matter_Name] ? arrData[nRowIndex][oGlobalConstants.Matter_Name].trim() : "NA"; - matterIsReadOnlyUser = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].IsReadOnlyUser.toString())); - } - readMore = matterClientUrl + "/" + matterName; - // Trim semi colon from the end if it is present - matterPracticeGroup = trimEndChar(matterPracticeGroup, ";"); - matterSubAreaOfLaw = trimEndChar(matterSubAreaOfLaw, ";"); - matterResponsibleAttorney = trimEndChar(matterResponsibleAttorney, ";"); - - matterLandingPageUrl = readMore + "/" + matterName + oWebDashboardConstants.MatterLandingPageExtension; - matterPopData.find(":nth-child(1)").attr({ "title": matterOriginalName, "data-mattername": matterName, "data-matterOriginalName": matterOriginalName, "data-client": matterClientUrl, "data-practicegroup": matterPracticeGroup, "data-areaoflaw": matterAreaOfLaw, "data-subareaoflaw": matterSubAreaOfLaw, "data-matterurl": readMore, "href": matterLandingPageUrl }).text(matterOriginalName); - matterPopData.find(":nth-child(2)").attr({ "data-matterClientName": matterClientName }).html("
      Client:
      " + matterClientName + "
      "); - matterPopData.find(":nth-child(3)").attr({ "data-matterClientID": matterClientID, "data-matterMatterID": matterMatterID }).html("
      Client.Matter ID:
      " + matterClientID + oGlobalConstants.ClientID_MatterID_Separator + matterMatterID + "
      "); - matterPopData.find(":nth-child(4)").attr({ "data-matterAreaOfLaw": matterSubAreaOfLaw }).html("
      Sub area of law:
      " + matterSubAreaOfLaw + "
      "); - matterPopData.find(":nth-child(5)").attr({ "data-matterResponsibleAttorney": matterResponsibleAttorney }).html("
      Responsible Attorney:
      " + matterResponsibleAttorney + "
      "); - matterPopData.find("#matterLandingPage").html(oWebDashboardConstants.MatterDetailsAction); - matterPopData.find("#uploadToMatter").attr({ "onclick": "uploadElement(" + nRowIndex + ", event);" }).html(oWebDashboardConstants.MatterUploadAction); - if ("true" === matterIsReadOnlyUser) { - matterPopData.find("#uploadToMatter").addClass("is-disabled").attr("disabled", "disabled"); - } else { - matterPopData.find("#uploadToMatter").removeClass("is-disabled").removeAttr("disabled"); - } - var sOneNoteUrl = matterClientUrl.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + oGlobalConstants.OneNoteLibrary_Name_Suffix + "/" + matterName + "/" + matterName + oWebDashboardConstants.OneNoteTableOfContentsExtension + "$|$" + matterClientUrl.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oWebDashboardConstants.OneNoteTableOfContentsExtension - , sMatterLandingPageUrl = matterClientUrl.replace(oGlobalConstants.Site_Url, "") + "/" + oGlobalConstants.Matter_Landing_Page_Repository + "/" + matterName + oWebDashboardConstants.MatterLandingPageExtension + "$|$" + matterClientUrl.replace(oGlobalConstants.Site_Url, "") + "/" + matterName + "/" + matterName + "/" + matterName + oWebDashboardConstants.MatterLandingPageExtension; - // Check if the OneNote URL Exists or Not - urlExists(matterClientUrl, matterName, sOneNoteUrl, sMatterLandingPageUrl, matterUrl); - commonFunction.closeAllFilterExcept(".matterPopup"); - $("#matterLandingPage").off().on("click", function (event) { - "use strict"; - var sMatterLink = $(this).attr("matter-link"); - if (sMatterLink) { - window.open(sMatterLink, "_parent"); - } - }); - } -} - -function showDocumentDetailsPopup(element, event) { - "use strict"; - var documentPopData = $(".documentPopupData"); - if (documentPopData.length) { - var arrData = [], - documentName, - matterName, - documentClientUrl, - documentClientName, - documentID, - documentAuthor, - documentModifiedDate, - openDocument, - documentLandingPageUrl; - var nRowIndex = $(element).parent()[0].rowIndex + (oGridConfig.nPinnedGridPageNumber * oGridConfig.itemsPerPage) - 1; - - if (1 === oGridConfig.currentView) { // Pinned Documents view - arrData = oGridConfig.arrPinnedData; - documentName = oCommonObject.renderStringContent(arrData[nRowIndex].DocumentName); - matterName = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].DocumentMatter)); - documentClientUrl = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].DocumentClientUrl)); - documentClientName = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].DocumentClient)); - documentID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex].DocumentID)); - documentAuthor = oCommonObject.renderStringContent(oCommonObject.renderAsText(trimEndChar($.trim(arrData[nRowIndex].DocumentOwner), ";"))); - documentModifiedDate = oCommonObject.renderStringContent(oCommonObject.renderAsText(formatDate(arrData[nRowIndex].DocumentModifiedDate))); - openDocument = oCommonObject.renderAsText(arrData[nRowIndex].DocumentOWAUrl); - } else { // Recent Documents and All Documents view - arrData = (oGridConfig.currentView) ? oGridConfig.arrRecentData : oGridConfig.arrGridData; - documentName = oCommonObject.renderStringContent(arrData[nRowIndex][oGlobalConstants.File_Name]); - matterName = oCommonObject.renderStringContent((oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Document_Matter_Name]))); - documentClientUrl = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.DocumentSPWebUrl])); - documentClientName = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Document_Client_Name])); - documentID = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Document_ID])); - documentAuthor = oCommonObject.renderStringContent(oCommonObject.renderAsText(arrData[nRowIndex][oGlobalConstants.Author])); - documentModifiedDate = oCommonObject.renderStringContent(oCommonObject.renderAsText(formatDate(arrData[nRowIndex][oGlobalConstants.Document_Last_Modified_Time]))); - openDocument = getDocumentUrl(arrData[nRowIndex]); - } - - documentPopData.find(":nth-child(1)").attr({ "title": documentName, "data-mattername": matterName, "data-client": documentClientUrl, "href": documentLandingPageUrl }).text(documentName); - documentPopData.find(":nth-child(2)").attr({ "data-documentClientName": documentClientUrl }).html("
      Matter:
      " + matterName + "
      "); - documentPopData.find(":nth-child(3)").attr({ "data-documentClientName": documentClientName }).html("
      Client:
      " + documentClientName + "
      "); - documentPopData.find(":nth-child(4)").attr({ "data-documentID": documentID }).html("
      Document ID:
      " + documentID + "
      "); - documentPopData.find(":nth-child(5)").attr({ "data-documentAuthor": documentAuthor }).html("
      Author:
      " + documentAuthor + "
      "); - documentPopData.find(":nth-child(6)").attr({ "data-documentModifiedDate": documentModifiedDate }).html("
      Modified date:
      " + documentModifiedDate + "
      "); - documentPopData.find("#openDocument").attr({ "data-link": openDocument, "onclick": "ViewMatterandGoToOneNote(event, oGlobalConstants.View_Document);" }); - documentPopData.find("#viewDocumentLandingPage").html(oWebDashboardConstants.DocumentDetailsAction); - commonFunction.closeAllFilterExcept(".documentPopup"); - oCommonObject.updateDocumentLandingAttributes($(element).find(".nameColumn")); - } -} - -function placeMatterDetailsPopupTileView(element, event) { - "use strict"; - var nAddTop = 0; - var left = 0; - var nWidth = getWidth(); - var iContentHeight = $(".LeftContent").height(); - var iExpectedHeight = $(element).offset().top + $(".matterPopup").height(); - if (703 >= nWidth || (703 < nWidth && 1199 >= nWidth)) { - iExpectedHeight = iExpectedHeight + 95; - oGridConfig.isTileView ? nAddTop = 75 : nAddTop = 50; - oGridConfig.isTileView ? left = -35 : left = 0; - if (703 >= nWidth) { - oGridConfig.isTileView ? left = 10 : left = 0; - } - $(".matterPopup").css({ top: ($(element).offset().top + nAddTop), left: ($(element).offset().left + left) }); - } - else { - iExpectedHeight = iExpectedHeight + 10; - left = 170; - $(".matterPopup").css({ top: ($(element).offset().top - 118), left: ($(element).offset().left + left) }); - } - - if (("" !== oSearchGlobal.sClientName && "" !== oSearchGlobal.sClientSiteUrl) || oSearchGlobal.bIsTenantCall) { - (iContentHeight < iExpectedHeight) ? updateIframeHeight(iExpectedHeight) : updateIframeHeight(iContentHeight); - } - - /*---- For positioning fly out of matter-------------*/ - - $("#matterPopupPointerPosition").removeClass("flyoutPositioningDefault flyoutPositioningForRightmost flyoutPositioningMobileView"); - if (1199 < nWidth) { - positionFlyout(element, 0, 80, 100); - } else if (703 < nWidth && 1199 >= nWidth) { - positionFlyout(element, 40, 80, 90); - } else { - $("#matterPopupPointerPosition").addClass("flyoutPositioningMobileView matterPopupPointer").removeClass("matterPopupPointerFirst matterPopupPointerOffice"); - $(".matterPopup").css({ top: ($(element).offset().top + 60), left: ($(element).offset().left + $(element).width()) - 240 }).show(); - } - - $(".matterPopup").show(); - commonFunction.closeAllFilterExcept("matterPopup"); - if (!event) { - event = window.event; - event.cancelBubble = true; - } - if (event.stopPropagation) { - event.stopPropagation(); - } -} - -/* Returns the document URL. For documents supported by OWA, it returns OWA URL. Otherwise, the document path. */ -function getDocumentUrl(oCurrentRow) { - "use strict"; - var sDocumentPath, sDocumentExtension, sDocumentSPWebUrl; - if (oCurrentRow) { - sDocumentPath = trimEndChar(oCurrentRow.Path, "/"); - sDocumentExtension = oCurrentRow.FileExtension; - sDocumentSPWebUrl = oCurrentRow.SPWebUrl; - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentPath = commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentPath); - } - } - return sDocumentPath; -} - -function positionFlyout(element, contentDivOffsetLeft, leftOffsetForMatterPopupRightView, leftOffsetForMatterPopupLeftView) { - "use strict"; - var sPointerPosition = null, sPointerPrevPostiton = null, nOffsetLeft, nOffsetTop; - if (($("#contentDiv").width() - (($(element).offset().left) - ($("#contentDiv").offset().left) + ($(element).outerWidth())) + contentDivOffsetLeft) > ($(".matterPopup").width())) { - // display right - sPointerPosition = "flyoutPositioningDefault matterPopupPointerFirst"; - sPointerPrevPostiton = "matterPopupPointer matterPopupPointerOffice"; - nOffsetLeft = $(element).offset().left + $(element).width() - leftOffsetForMatterPopupRightView; - } else { - // left - sPointerPosition = "flyoutPositioningForRightmost matterPopupPointer"; - sPointerPrevPostiton = "matterPopupPointerFirst matterPopupPointerOffice"; - nOffsetLeft = $(element).offset().left - $(element).width() - leftOffsetForMatterPopupLeftView; - } - nOffsetTop = $(element).offset().top - 15; - $("#matterPopupPointerPosition").addClass(sPointerPosition).removeClass(sPointerPrevPostiton); - $(".matterPopup").css({ top: nOffsetTop, left: nOffsetLeft }).show(); -} - -/**************************Advance Search****************************/ - -/* Search based on refiners in search box.*/ -function getSortData() { - "use strict"; - var oSortDetails = { ByProperty: "", Direction: 0 }; - - var oSelectedDropdown = ".sdBannerText"; - oSortDetails.ByProperty = $(oSelectedDropdown).attr("data-sort-value"); - if ($(oSelectedDropdown).length) { - oSortDetails.Direction = parseInt($(oSelectedDropdown).attr("data-order"), 10); - oSearchGlobal.current_sorted_data_value = $(oSelectedDropdown).attr("data-value"); - } - return oSortDetails; -} - -function checkEmptyorWhitespace(input) { - "use strict"; - if (/\S/.test(input)) { - return input; - } - return oWebDashboardConstants.No_Data_String; -} - -/*********************************AUTO COMPLETE FUNCTIONALITY**********************************/ -$(document).on("click", ".filterAutoComplete", function (event) { - "use strict"; - event.stopPropagation(); -}); - -$(document).click(function (event) { - "use strict"; - if ($(".filterSearchAdvance").css("display") === "block" && (event && event.target && event.target.className !== "ui-corner-all")) { - $(".filterSearchDD").toggle(); - } - if ("sdBannerDropdown" === event.target.className || "sdBannerText" === event.target.className || "sdBannerDD" === event.target.className) { - closeAllPopupExcept("sdBannerPanel", event); - } - else { - closeAllPopupExcept("", event); - } - $(".switchTab").css("display", "none"); - $(".quickLinksMenuItems").css("display", "none"); - event.stopPropagation(); -}); - -function autoCompleteFailure(result) { - "use strict"; - return false; -} - -function autoComplete() { - "use strict"; - var sDeployUrl = oCommonObject.getDeployedUrl(); - if ($(".filterSearchAdvance").is(":hidden")) { - if (oGridConfig.isMatterView) { - var sTerm = $(".filterSearchText").val(), sSearchTerm = sTerm && sTerm !== "" ? sTerm : "", FilterDetails, SearchDetails; - if (sSearchTerm) { - sSearchTerm = "(" + oGlobalConstants.Matter_Name + ":" + sSearchTerm + "* OR " + oGlobalConstants.Matter_ID + ":" + sSearchTerm + "*)"; - FilterDetails = oCommonObject.getSearchData(); - FilterDetails.ClientsList = selectCurrentClient(FilterDetails, sDeployUrl); - SearchDetails = { "requestObject": { "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sDeployUrl }, "searchObject": { "PageNumber": "1", "ItemsPerPage": "5", "SearchTerm": sSearchTerm, "Filters": FilterDetails } }; - oCommonObject.callSearchService("FindMatter", SearchDetails, autoCompleteSuccess, autoCompleteFailure); - } else { - $(".filterAutoComplete").addClass("hide").html(""); - } - - } else { - var sSearchTerm = $(".filterSearchText").val() && $(".filterSearchText").val() !== "" ? $(".filterSearchText").val() : ""; - if (sSearchTerm) { - sSearchTerm = "(FileName:" + sSearchTerm + "* OR " + oGlobalConstants.Document_ID + ":" + sSearchTerm + "*)"; - var FilterDetails = oCommonObject.getSearchData(); - FilterDetails.ClientsList = selectCurrentClient(FilterDetails, sDeployUrl); - var SortDetails = getSortData(); - var SearchDetails = { "requestObject": { "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sDeployUrl }, "searchObject": { "PageNumber": 1, "ItemsPerPage": "5", "SearchTerm": sSearchTerm, "Filters": FilterDetails, "Sort": SortDetails } }; - - oCommonObject.callSearchService("FindDocument", SearchDetails, autoCompleteSuccess, autoCompleteFailure); - } else { - $(".filterAutoComplete").addClass("hide").html(""); - } - } - - } -} - -function selectCurrentClient(oFilterDetails, sDeployUrl) { - "use strict"; - if ("" !== oSearchGlobal.sClientName) { - if ("" === oFilterDetails.ClientsList[0]) { - oFilterDetails.ClientsList = []; - } - oFilterDetails.ClientsList.push(oSearchGlobal.sClientSiteUrl); - } - return oFilterDetails.ClientsList; -} - -function autoCompleteSuccess(result) { - "use strict"; - if (!oCommonObject.bHideAutoComplete) { - var splitResults, jsonResponse; - jsonResponse = { - }; - if (-1 !== result.indexOf("$|$")) { - splitResults = result.split("$|$"); - if (splitResults[1] && parseInt(splitResults[1], 10) > 0) { - jsonResponse = JSON.parse(splitResults[0]); - } - } - if (jsonResponse && jsonResponse.length) { - var sAssignedToMe, sTerm = $(".filterSearchText").val(); - commonFunction.closeAllFilterExcept("filterAutoComplete"); - if (oGridConfig.isMatterView) { - var autoContainer = "
      ", autoCompleteItemContainer = "
      ", regularSearchTerm = new RegExp("#SearchTerm#", "g"), lineItem, matterName, autoCompleteItemContainerClose = "#SearchTermClose#
      ", regularSearchTermClose = new RegExp("#SearchTermClose#", "g"); - for (lineItem in jsonResponse) { - if (jsonResponse.hasOwnProperty(lineItem)) { - matterName = jsonResponse[lineItem][oGlobalConstants.Matter_Name]; - if (matterName) { - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, matterName + " (" + jsonResponse[lineItem][oGlobalConstants.Matter_ID] + ")") + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(matterName + " (" + jsonResponse[lineItem][oGlobalConstants.Matter_ID] + ")", sTerm)); - } - } - } - sAssignedToMe = oWebDashboardConstants.Search_Matters_Assigned_To_Me; - } else { - var oResponseData = JSON.parse(splitResults[0]); - var autoContainer = "
      "; - var autoCompleteItemContainer = "
      "; - var regularSearchTerm = new RegExp("#SearchTerm#", "g"); - var autoCompleteItemContainerClose = "#SearchTermClose#
      ", - regularSearchTermClose = new RegExp("#SearchTermClose#", "g"); - for (lineItem in oResponseData) { - var matterName = oCommonObject.ExtractFileTitle(oResponseData[lineItem][oGlobalConstants.File_Name]); - var docId = oResponseData[lineItem][oGlobalConstants.Document_ID]; - if (0 < $.trim(docId).length) { - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, matterName + " (" + docId + ")") + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(matterName + " (" + docId + ")", sTerm)); - } else { - autoContainer = autoContainer + autoCompleteItemContainer.replace(regularSearchTerm, matterName) + autoCompleteItemContainerClose.replace(regularSearchTermClose, oCommonObject.highlightTerm(matterName, sTerm)); - } - } - sAssignedToMe = oWebDashboardConstants.Search_Assigned_To_Me; - } - $(".filterAutoComplete").removeClass("hide").html(autoContainer); - advanceSearchDropdown(); - } - else { - $(".filterAutoComplete").addClass("hide"); - } - } -} - -// Binding on onfocus event on search text box -$(document).on("click", ".autoCompleteRow", function () { - "use strict"; - $(".autoCompleteRow").removeClass("autoCompleteSelected"); - $(this).addClass("autoCompleteSelected"); - - var sSelectedContent = $(this).text(); - // Removal of unwanted HTML Tags - if (sSelectedContent && "" !== sSelectedContent) { - sSelectedContent = sSelectedContent.replace(/""/g, "").replace(/"<\/span>"/g, ""); - } - $(".filterSearchText").val(sSelectedContent); - - $(".filterAutoComplete").addClass("hide"); - advancedSearch("grid", "tileContainer"); - if (!oGridConfig.isMatterView) { - $("#results").click(); - } -}); - -// Sort the grid -function sortPinDocument(container, sortByfield) { - "use strict"; - if (sortByfield.length) { - var headerobject = document.querySelector(".jsonGridHeader"); - if (headerobject) { - var sSortOrder = parseInt($(".sdBannerText").attr("data-order"), 10) ? "desc" : "asc"; - headerobject.setAttribute("sortorder", sSortOrder); - oGrid.sortJsonGrid(headerobject, container, sortByfield); - headerobject.setAttribute("sortorder", "asc"); - sortPinnedArray(sSortOrder, sortByfield); - } - } else { - onPinnedItemSuccess(oSearchGlobal.pinnedDocumentDataPassed, event); - } -} - -function setGlobalRefiners() { - "use strict"; - oSearchGlobal.oFilterData = oCommonObject.getSearchData(); - var filterSearchText = $(".filterSearchText").val(); - oSearchGlobal.sSearchTerm = filterSearchText && filterSearchText !== "" ? filterSearchText : ""; -} - -commonFunction.switchThisApp = function (sSwitchAppName) { - "use strict"; - if ("Search Documents" === sSwitchAppName) { - $("#searchMatter").removeClass("selected"); - $("#searchDocument").addClass("selected"); - } else { - $("#searchMatter").addClass("selected"); - $("#searchDocument").removeClass("selected"); - } - $(".popupWait, #popupWaitLoadingImage, .loadingImage").addClass("hide"); -}; - -$(window).on("resize", function (event) { - "use strict"; - var nCurrentBrowserWidth = getWidth(); - if (oGridConfig.hasOwnProperty("prevBrowserWidth") && oGridConfig.prevBrowserWidth !== nCurrentBrowserWidth) { - createResponsiveGrid(); - $(".matterPopup").hide(); - $(".documentPopup").hide(); - $(".switchApp").hide(); - $(".ui-datepicker").hide(); - $(".searchDocumentHeader .switchTab").html("").hide(); - $(".sdBannerPanel").addClass("hide"); - } - if (850 < nCurrentBrowserWidth) { - $(".mySearch, .pinnedSearch, .allSearch").show(); - $(".viewSwitcher").hide(); - } else { - $(".mySearch, .pinnedSearch, .allSearch").not(".active").hide(); - $(".viewSwitcher").show(); - } - if ($("#headerFlyout").is(":visible")) { - $("#headerFlyout").css("width", "100%").css("width", "-=40px"); - } -}); - -function getWidth() { - "use strict"; - var nWidth = 0; - if (self.innerHeight) { - nWidth = self.innerWidth; - } else if (document.documentElement && document.documentElement.clientHeight) { - nWidth = document.documentElement.clientWidth; - } else if (document.body) { - nWidth = document.body.clientWidth; - } - return nWidth; -} - -function createResponsiveGrid() { - "use strict"; - var isChrome = !!window.chrome; - var isSafari = 0 < Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor"); - var sSelectedTab = getCurrentSelectedTab(); - var arrGridHeader = $(sSelectedTab + " .jsonGridHeader"); - closeAllPopupExcept(""); //// Close all pop-ups - var nCurrentWindowWidth = oCommonObject.getWidth(); - var arrGridWidthValues = oGridConfig.isMatterView ? oWebDashboardConstants.MatterColumnWidth.split(";") : oWebDashboardConstants.DocumentColumnWidth.split(";"); - //// Get last visible header and first hidden header, for responsiveness - var lastHeader = getLastVisibleColumnHeader(arrGridHeader), firstHiddenHeader = $(arrGridHeader).filter(".hide").first(); - var lastHeaderIndex = lastHeader.index(), firstHiddenHeaderIndex = firstHiddenHeader.index(); - //// Get list of cells present in the last visible column, for responsiveness - var oVisibleCellSet = $(".GridRow .jsonGridRow:nth-child(" + parseInt(lastHeaderIndex + 1) + ")"), oVisbleAlternateCellSet = $(".GridRowAlternate .jsonGridRow:nth-child(" + parseInt(lastHeaderIndex + 1) + ")"); - //// Get list of cells present in the first hidden column, for responsiveness - var oHiddenCellSet = $(".GridRow .jsonGridRow:nth-child(" + parseInt(firstHiddenHeaderIndex + 1) + ")"), oHiddenAlternateCellSet = $(".GridRowAlternate .jsonGridRow:nth-child(" + parseInt(firstHiddenHeaderIndex + 1) + ")"); - var iMinHeaders = oGridConfig.isMatterView ? 1 : 3; // These are (minimum number of columns to show -1) for matters and documents view respectively - if (((-1 < lastHeaderIndex) && (nCurrentWindowWidth < oGridConfig.nCurrentGridWidth) && (671 < nCurrentWindowWidth)) || ((iMinHeaders < lastHeaderIndex) && (nCurrentWindowWidth < oGridConfig.nCurrentGridWidth))) { // As width for header and footer is fixed after window width of 671px, blocking responsive behavior after this point so as to avoid white space Or, when page is loaded first time having width <671 Or tabs are switched having width <671 - oGridConfig.nPreviousGridWidth = oGridConfig.nCurrentGridWidth; - oGridConfig.nCurrentGridWidth -= arrGridWidthValues[lastHeaderIndex]; - oGridConfig.nGridWidth -= arrGridWidthValues[lastHeaderIndex]; - var sSelectedTab = getCurrentSelectedTab(); - $(sSelectedTab).css("maxWidth", oGridConfig.nGridWidth); - $(sSelectedTab).css("width", 0); - lastHeader.addClass("hide"); - oVisibleCellSet.addClass("hide"); - oVisbleAlternateCellSet.addClass("hide"); - $(window).trigger("resize"); - } else if ((-1 < firstHiddenHeaderIndex) && (nCurrentWindowWidth > oGridConfig.nPreviousGridWidth) && (oGridConfig.nCurrentGridWidth !== oGridConfig.nPreviousGridWidth)) { - oGridConfig.nPreviousGridWidth = oGridConfig.nCurrentGridWidth; - oGridConfig.nCurrentGridWidth += parseInt(arrGridWidthValues[firstHiddenHeaderIndex]); - oGridConfig.nGridWidth += parseInt(arrGridWidthValues[firstHiddenHeaderIndex]); - var sSelectedTab = getCurrentSelectedTab(); - $(sSelectedTab).css("maxWidth", oGridConfig.nGridWidth); - $(sSelectedTab).css("width", 0); - firstHiddenHeader.removeClass("hide") && oHiddenCellSet.removeClass("hide") && oHiddenAlternateCellSet.removeClass("hide"); - $(window).trigger("resize"); - } -} - -// Function to get the last visible column header -function getLastVisibleColumnHeader(arrGridHeader) { - "use strict"; - var lastVisibleHeader = arrGridHeader.not(".mandatory, .hide").last(); - if (lastVisibleHeader.length && (-1 < oWebDashboardConstants.NonDataColumns.indexOf(lastVisibleHeader[0].id))) { - lastVisibleHeader = getLastVisibleColumnHeader(lastVisibleHeader.prev()); - } - return lastVisibleHeader; -}; - -// Function to get the initial width of the grid view control -function getGridViewWidth() { - "use strict"; - var arrGridWidthValues = oGridConfig.isMatterView ? oWebDashboardConstants.MatterColumnWidth.split(";") : oWebDashboardConstants.DocumentColumnWidth.split(";"); - oGridConfig.nGridWidth = arrGridWidthValues.reduce(function (previousValue, currentValue) { return parseInt(previousValue) + parseInt(currentValue); }); - oGridConfig.nCurrentGridWidth = oGridConfig.nPreviousGridWidth = oGridConfig.nGridWidth + oGridConfig.nWidthDiff; -}; - -// Function to get the selected tab -function getCurrentSelectedTab() { - "use strict"; - var sSelectedTab; - if (1 === oGridConfig.currentView) { // Pinned View - sSelectedTab = "#pinnedGrid_Grid"; - } else if (2 === oGridConfig.currentView) { // Recent View - sSelectedTab = (oGridConfig.isMatterView) ? "#recentMatters_Grid" : "#RecentDocumentContainer_Grid"; - } else { // Search View - sSelectedTab = "#grid_Grid"; - } - return sSelectedTab; -} - -// Function is used to retrieve parameter from the URL -function getParameterByName(name) { - "use strict"; - name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -} - -function onURLExistSuccess(result) { - "use strict"; - // Handle the true and false responses for the Matter Landing page and OneNote TOC - if (result && result.Result) { - var oSplitResults = result.Result.split("$|$"); - if (2 === oSplitResults.length) { - var oOneNoteResult = oSplitResults[0].split("$#$"); - var oMatterLandingPageResult = oSplitResults[1].split("$#$"); - var anchorElement = document.createElement("a"); - anchorElement.href = result.oParam.sitename; - if (oOneNoteResult && 2 === oOneNoteResult.length) { - if ("true" === oOneNoteResult[0]) { - var oOneNoteLink = $("#OneNoteClick"), oOneNoteIcon = $("#OneNoteClick img"); - if (oOneNoteLink.length && oOneNoteIcon.length) { - // Set the link to open the Matter's OneNote page in a new browser window - oOneNoteLink.attr({ "href": result.oParam.sitename + "/" + oWebDashboardConstants.WOPIFrameURL + anchorElement.protocol + "//" + anchorElement.hostname + oOneNoteResult[1], "target": "_parent", "class": "matterTitle applyCursor" }); - oOneNoteIcon.attr({ "src": "../Images/one-note_666_29X29.png", "alt": "upload", "style": "" }); - } - } - } - $("#matterPopupLoading, #documentPopupLoading").addClass("hide"); - var oMatterPopData = $(".matterPopupData"), sMatterPageLink; - // Set the link to the Matter Landing page or to the All Items page based on the value returned - if (oMatterLandingPageResult && 2 === oMatterLandingPageResult.length) { - sMatterPageLink = "true" === oMatterLandingPageResult[0] ? anchorElement.protocol + "//" + anchorElement.hostname + oMatterLandingPageResult[1] : result.oParam.matterLibraryURL; - } else { - sMatterPageLink = result.oParam.matterLibraryURL; - } - if (oMatterPopData[0]) { - oMatterPopData.find("#matterLandingPage").attr({ "title": oWebDashboardConstants.MatterDetailsAction, "onclick": "ViewMatterandGoToOneNote(event, oGlobalConstants.View_Matter);", "matter-link": sMatterPageLink }); - } - // Finally show the data - oMatterPopData.removeClass("hide"); - } else { - onURLExistFailure(result); - } - } else { - onURLExistFailure(result); - } -} - -function onURLExistFailure(result) { - "use strict"; - // Do not display the OneNote link - $("#matterPopupLoading, #documentPopupLoading").addClass("hide"); - if (result && result.oParam && result.oParam.matterLibraryURL) { - var oMatterPopData = $(".matterPopupData"), - sMatterPageLink = result.oParam.matterLibraryURL; - if (oMatterPopData[0]) { - oMatterPopData.find("a.readMoreLink").attr({ "href": sMatterPageLink, "target": "_blank", "onclick": "ViewMatterandGoToOneNote(event, oGlobalConstants.View_Matter);" }); - oMatterPopData.find("a:nth-child(1)").attr({ "href": sMatterPageLink, "target": "_blank", "onclick": "ViewMatterandGoToOneNote(event, oGlobalConstants.View_Matter);" }); - } - } - // Finally show the data - $(".matterPopupData").removeClass("hide"); -} - -// Function to check whether the OneNote exists -function urlExists(sClientURL, sMatterName, sOneNoteURL, sMatterLandingPageURL, sMatterLibraryURL) { - "use strict"; - var sParameters = { "requestObject": { "SPAppToken": oSharePointContext.SPAppToken, "RefreshToken": oSharePointContext.RefreshToken }, "client": { "Url": sClientURL }, requestedUrl: sOneNoteURL, requestedPageUrl: sMatterLandingPageURL }, oParam = { "sitename": sClientURL, "matterName": sMatterName, "matterLibraryURL": sMatterLibraryURL }; - oCommonObject.callSearchService("UrlExists", sParameters, onURLExistSuccess, onURLExistFailure, null, oParam); -} - -// Returns the name of the function -function getFunctionName(oFunctionToBeProcressed) { - "use strict"; - var ret = oFunctionToBeProcressed.toString(); - ret = ret.substr("function ".length); - ret = ret.substr(0, ret.indexOf("(")); - return ret.trim(); -} - -// Set default sorting value to relevant -function updateSortSettings(event) { - "use strict"; - var sortText, $Element = oGridConfig.isMatterView ? $("#sdBannerDropdownForMatters #optionNoneForMatters") : $("#sdBannerDropdownForDocuments #optionNoneForDocuments"); - - $(".sdBannerText").attr("data-result", "1"); - $Element.attr("data-sort-value", "").attr("data-value", "").text(oGlobalConstants.Sort_Type_Relevant); - sortText = $Element.text(); - var sortTextWidth = sortText.length > 5 ? sortText.length < 9 ? 56 : (sortText.length - 2) * 8 : 35; - $(".sdBannerText").val(sortText).css("width", sortTextWidth + "px").attr({ - "data-sort-value": $Element.attr("data-sort-value"), - "data-order": $Element.attr("data-order"), - "data-value": $Element.attr("data-value"), - "data-ss-value": $Element.attr("data-ss-value") - }); -} - -// Sets the selected tab to active -function setActiveTab() { - "use strict"; - if (2 === oGridConfig.currentView) { // Recent view - $(".pinnedSearch .allSearch").removeClass("active"); - $(".mySearch").addClass("active"); - } else if (1 === oGridConfig.currentView) { // Pinned View - $(".mySearch .allSearch").removeClass("active"); - $(".pinnedSearch").addClass("active"); - } else { // Search Results - $(".pinnedSearch .mySearch").removeClass("active"); - $(".allSearch").addClass("active"); - } -} - -// Updates the dropdown options -function updateDropdownOptions(option1, option2) { - "use strict"; - setActiveTab(); - return "" + - ""; -} - -$(document).on("click", ".viewSwitcher", function (event) { - "use strict"; - var oHtmlDropDown = "", iTabPosition; - var nWindowWidth = getWidth(); - if (1199 >= nWindowWidth) { - if (2 === oGridConfig.currentView) { // Recent view - oHtmlDropDown = oGridConfig.isMatterView ? updateDropdownOptions(arrOriginalTabOrder[1], arrOriginalTabOrder[2]) : updateDropdownOptions(arrOriginalTabOrder[4], arrOriginalTabOrder[5]); - } else if (1 === oGridConfig.currentView) { // Pinned View - oHtmlDropDown = oGridConfig.isMatterView ? updateDropdownOptions(arrOriginalTabOrder[0], arrOriginalTabOrder[1]) : updateDropdownOptions(arrOriginalTabOrder[3], arrOriginalTabOrder[4]); - } else { // Search Results - oHtmlDropDown = oGridConfig.isMatterView ? updateDropdownOptions(arrOriginalTabOrder[0], arrOriginalTabOrder[2]) : updateDropdownOptions(arrOriginalTabOrder[3], arrOriginalTabOrder[5]); - } - iTabPosition = parseInt($(".fallbackFlex .active").width(), 10) + 15; - - $(".searchDocumentHeader .switchTab").html("").append(oHtmlDropDown); - - $(".switchTab").css("left", parseInt(iTabPosition, 10)).toggle(); - } - closeAllPopupExcept("navDiv", event); - event.stopPropagation(); -}); - -var arrOriginalTabOrder = [ - "My matters", - "All matters", - "Pinned matters", - "My documents", - "All documents", - "Pinned documents", -]; - -function changeNavigationTabs(oElement) { - "use strict"; - var oHeadingElements = $(".switchAppRow"); - var oHtmlDropDown = ""; - if (oGridConfig.isMatterView) { - if (2 <= oHeadingElements.length) { - if ($(oElement).text() === arrOriginalTabOrder[2]) { // that is Pinned Matters - oGridConfig.currentView = 1; - $(".pinnedSearch").show(); - $(".allSearch, .mySearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[0], arrOriginalTabOrder[1]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplayFindMattersResults .pinnedSearch", 1); - } - } else if ($(oElement).text() === arrOriginalTabOrder[0]) { // that is My Matters - oGridConfig.currentView = 2; - $(".mySearch").show(); - $(".allSearch, .pinnedSearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[1], arrOriginalTabOrder[2]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplayFindMattersResults .mySearch", 2); - } - } else { // that is All Matters - oGridConfig.currentView = 0; - $(".allSearch").show(); - $(".pinnedSearch, .mySearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[0], arrOriginalTabOrder[2]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplayFindMattersResults .allSearch", 0); - } - } - } - } else { - if (3 <= oHeadingElements.length) { - var oClientsTab = oHeadingElements[1]; - var oRecentMattersTab = oHeadingElements[0]; - var iPopupLeftPosition; - - if ($(oElement).text() === arrOriginalTabOrder[5]) { // that is Pinned documents - oGridConfig.currentView = 1; - $(".pinnedSearch").show(); - $(".allSearch, .mySearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[3], arrOriginalTabOrder[4]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplaySearchDocumentsResults .pinnedSearch", 1); - } - } else if ($(oElement).text() === arrOriginalTabOrder[3]) { // that is My documents - oGridConfig.currentView = 2; - $(".mySearch").show(); - $(".allSearch, .pinnedSearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[4], arrOriginalTabOrder[5]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplaySearchDocumentsResults .mySearch", 2); - } - - } else { // that is All documents - oGridConfig.currentView = 0; - $(".allSearch").show(); - $(".pinnedSearch, .mySearch").hide(); - oHtmlDropDown = updateDropdownOptions(arrOriginalTabOrder[3], arrOriginalTabOrder[5]); - if ("navDiv" !== oElement) { - togglePinnedView("#DisplaySearchDocumentsResults .allSearch", 0); - } - } - $(".searchDocumentHeader .switchTab").html("").append(oHtmlDropDown); - } - } -} - -// Function to perform operation before search result. -function beforeSearch(oFinalResult) { - "use strict"; - var container = oFinalResult.oParam.container; - if (oGridConfig.isMatterView) { - $("#recentMatters").show(); - } else { - // hide pinned grid and search results - $("#RecentDocumentContainer").show(); - } - $("#pinnedGrid, #grid").hide(); - var sGridName = oGridConfig.isMatterView ? "Matters" : "Documents"; - $("#" + container).html("

      \"Loading...\"

      Please wait while the " + sGridName + " load.

      "); -} - -// Function to count items to be displayed -function itemsCountsToBeDisplayed() { - "use strict"; - var nWindowWidth = getWidth(); - oGridConfig.itemsPerPage = oWebDashboardConstants.ItemsPerPage; -} - -// Function to sort pinned array -function sortPinnedArray(sSortOrder, sortByfield) { - "use strict"; - oGridConfig.arrPinnedData.sort(function (oPrevious, oNext) { - if ("asc" === sSortOrder) { - return (oPrevious[sortByfield] > oNext[sortByfield]) ? 1 : ((oPrevious[sortByfield] < oNext[sortByfield]) ? -1 : 0); - } else { - return (oNext[sortByfield] > oPrevious[sortByfield]) ? 1 : ((oNext[sortByfield] < oPrevious[sortByfield]) ? -1 : 0); - } - }); -} - diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/gridConfigWebDashboard.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/gridConfigWebDashboard.js deleted file mode 100644 index c72e4360..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/gridConfigWebDashboard.js +++ /dev/null @@ -1,420 +0,0 @@ -/// JS3057,JS3058,JS2074,JS2076,JS3092,JS3054,JS2005,JS3056,JS2073,JS2024,JS2026,JS2032,JS3116,JS3053 -// Function to replace to default error image. -function errorImage(image) { - "use strict"; - if ($(image).attr("data-error")) { - $(image).attr("src", oGlobalConstants.Image_General_Document).attr("data-error", "true"); - } else { - $(image).attr("src", $(image).attr("src").substring(0, $(image).attr("src").lastIndexOf(".") + 1) + "png").attr("data-error", "true"); - } -} - -function toggleView(isMatterView) { - "use strict"; - oGridConfig.isTileView = false; - oGridConfig.bPageLoad = true; - oGridConfig.isMatterView = isMatterView; - updateQueryString && updateQueryString(); - oGridConfig.nGridPageNumber = 1; - advanceSearchDropdown(); - // Matter Count and Sort Filter - var sMatterResultDisplayValue = isMatterView ? "fallbackFlex" : "hide"; - var sMatterResultSortValue = isMatterView ? "inline" : "none"; - // Document Count and Sort Filter - var sDocumentResultDisplayValue = isMatterView ? "hide" : "fallbackFlex"; - // Display the Mail cart and Separator - var sDisplayValue = isMatterView ? "none" : "inline"; - // Show or hide based on the dropdown value - $("#DisplayFindMattersResults").attr("class", sMatterResultDisplayValue); - $("#DisplaySearchDocumentsResults").attr("class", sDocumentResultDisplayValue); - $("#EmailDiv").css("display", sDisplayValue); - $(".separator").css("display", sDisplayValue); - // Remove the previous Active tab - $(".active").removeClass("active"); - // Set the Active Tab - $("#DisplayFindMattersResults .pinnedSearch").addClass("active"); - $("#DisplayFindMattersResults .pinnedSearch .ResultNumbers, #DisplayFindMattersResults .mySearch .ResultNumbers, #DisplayFindMattersResults .allSearch .ResultNumbers").html(" (0)"); - $("#DisplaySearchDocumentsResults .pinnedSearch").addClass("active"); - $("#DisplaySearchDocumentsResults .pinnedSearch .ResultNumbers,#DisplaySearchDocumentsResults .mySearch .ResultNumbers, #DisplaySearchDocumentsResults .allSearch .ResultNumbers").html(" (0)"); - // Hide the pinned matter section and show the search results tab - var oGridContainer = $("#grid"); - var oPinnedContainer = $("#pinnedGrid"); - if (oGridContainer[0] && oPinnedContainer[0]) { - $("#pinnedGrid").html(""); - $("#grid").html(""); - oGridContainer.hide(); - oPinnedContainer.show(); - } - // Clear filter panel - clearFilterPanel(); - $(".filterSearchText").val(""); - advancedSearch(); - var sHeaderID = oGridConfig.isMatterView ? "DisplayFindMattersResults" : "DisplaySearchDocumentsResults"; - togglePinnedView($("#" + sHeaderID + " .pinnedSearch"), 1); // Calling this to get pinned data and update count - togglePinnedView($("#" + sHeaderID + " .mySearch"), 2); // Calling this to get recent data and update count - isMatterView ? $(".filterSearchText").attr({ "placeholder": "Search by matter name, matter ID, or keyword", "title": "Search by matter name, matter ID, or keyword" }) : $(".filterSearchText").attr({ "placeholder": "Search by document name, document ID, or keyword", "title": "Search by document name, document ID, or keyword" }); - // hide Practice group and Area of law in Search Document view. - if (oGridConfig.isMatterView) { - $(".filterSearchPG, .filterSearchAOL").removeClass("hide"); - $(".filterSearchAuthor").addClass("hide"); - $(".selected").removeClass("selected"); - $("#searchMatterTab").addClass("selected"); - } else { - $(".filterSearchPG, .filterSearchAOL").addClass("hide"); - $(".filterSearchAuthor").removeClass("hide"); - $(".selected").removeClass("selected"); - $("#searchDocumentTab").addClass("selected"); - $("#footer").addClass("documentFooter"); - } - oCommonObject.bindAutocomplete("#txtDocumentAuthor", true); - $(document).on("keypress, input", "#txtDocumentAuthor", function () { - $(this).removeAttr("data-resolved"); - }); - $(".sdBannerText").attr("data-result", "2"); // Set Recent as default view - $("#optionNoneForDocuments, #optionNoneForMatters").attr("data-sort-value", "").attr("data-value", "").text(oGlobalConstants.Sort_Type_None); - $("#sdBannerDropdownForDocuments, #sdBannerDropdownForMatters").addClass("hide"); - if (isMatterView) { - $(".extraTabHolder").removeClass("searchResults, pinnedDocuments"); - $(".extraTabHolder").addClass("pinnedMatters"); - $(".navDiv").removeClass("divPinnedDocuments, divSearchResults"); - $(".navDiv").addClass("divPinnedMatters"); - } else { - $(".extraTabHolder").removeClass("searchResults, pinnedMatters"); - $(".extraTabHolder").addClass("pinnedDocuments"); - $(".navDiv").removeClass("divPinnedMatters, divSearchResults"); - $(".navDiv").addClass("divPinnedDocuments"); - } -} - -function togglePinnedView(oCurrentTab, currentView) { - "use strict"; - oGridConfig.currentView = currentView; - oGridConfig.nGridPageNumber = 1; - if (2 !== oGridConfig.currentView) { - $("#optionNoneForDocuments").show(); - var oGridContainer = $("#grid"); - var oPinnedContainer = $("#pinnedGrid"); - var oRecentDocumentContainer = $("#RecentDocumentContainer"); - var oRecentMatterContainer = $("#recentMatters"); - if (oGridContainer[0] && oPinnedContainer[0]) { - var sortText, $Element = oGridConfig.isMatterView ? $("#sdBannerDropdownForMatters #optionNoneForMatters") : $("#sdBannerDropdownForDocuments #optionNoneForDocuments"); - if (oGridConfig.currentView) { - // pinned view - oGridContainer.hide(); - oRecentDocumentContainer.hide(); - oRecentMatterContainer.hide(); - oPinnedContainer.show(); - $(".sdBannerText").attr("data-result", "0"); // default make it pinned view - $("#optionNoneForDocuments, #optionNoneForMatters").attr("data-sort-value", "").attr("data-value", "").text(oGlobalConstants.Sort_Type_None); - - sortText = $Element.text(oGlobalConstants.Sort_Type_None).text(); - } else { - $("#grid").html(""); - oGridContainer.show(); - oPinnedContainer.hide(); - oRecentDocumentContainer.hide(); - oRecentMatterContainer.hide(); - $(".sdBannerText").attr("data-result", "1"); - $("#optionNoneForDocuments, #optionNoneForMatters").attr("data-sort-value", "").attr("data-value", "").text(oGlobalConstants.Sort_Type_Relevant); - - sortText = $Element.text(oGlobalConstants.Sort_Type_Relevant).text(); - } - var sortTextWidth = sortText.length > 5 ? sortText.length < 9 ? 56 : (sortText.length - 1) * 8 : 35; - $(".sdBannerText").val(sortText).css("width", sortTextWidth + "px") - .attr("data-sort-value", $Element.attr("data-sort-value")) - .attr("data-order", $Element.attr("data-order")) - .attr("data-value", $Element.attr("data-value")) - .attr("data-ss-value", $Element.attr("data-ss-value")); - } - oGridConfig.currentView ? oGridConfig.isMatterView ? requestPinnedMatter("pinnedGrid") : requestPinnedDocument("pinnedGrid") : advancedSearch(); - } else if (2 === oGridConfig.currentView) { - //// - // update oGridConfig isRecentView - // check if it for find document or find matter - // update the data result present in sort by drop down - // select default sorting order - // call the sorting value - //// - // update sorting value for document - $(".sdBannerText").attr("data-result", "2"); - if (oGridConfig.isMatterView) { - // Set modified date desc as Display none for matter - $("#optionNoneForMatters").attr("data-sort-value", $("#optionModifiedDateDESCForMatters").attr("data-sort-value")).attr("data-order", $("#optionModifiedDateDESCForMatters").attr("data-order")).attr("data-value", $("#optionModifiedDateDESCForMatters").attr("data-value")).text(oGlobalConstants.Sort_Type_None).show().click(); - } else { - // Hide none option - $("#optionNoneForDocuments").hide(); - // Set sort by dropdown options to modified date desc - $("#optionModifiedDateDESCForDocuments").click(); - } - } - if (oGridConfig.currentView) { // If toggling to my or pinned view, update count for all search results to total result count - clearFilterPanel(); - if (oGridConfig.isMatterView) { - $("#DisplayFindMattersResults .allSearch .ResultNumbers").html(" (" + oGridConfig.nAllMatterCount + ")"); - } else { - $("#DisplaySearchDocumentsResults .allSearch .ResultNumbers").html(" (" + oGridConfig.nAllDocumentCount + ")"); - } - } - // Remove the previous active tab and add active class to this tab - if ($(".active")[0]) { - $(".active").removeClass("active"); - } - $(oCurrentTab).addClass("active"); -} - -function onGridCheckboxClick(nIndex, event) { - "use strict"; - // App Insight Event tracking for - commonFunction.AppLogEvent(oGlobalConstants.Events_Tracking_Pages + oCommonObject.sCurrentPage + oGlobalConstants.Add_To_Mail_Cart, true); - var nCount = oGridConfig.arrSelectedGridData.length - 1, - isArrayElement = false, - iSelectedTab, - nTopRowCount; - while (nCount !== -1) { - if (1 === oGridConfig.currentView) { - iSelectedTab = "#pinnedGrid_Grid"; - if (oGridConfig.arrSelectedGridData[nCount].DocumentUrl) { - if (oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].DocumentUrl) === oCommonObject.getDecodeURIComponent(oGridConfig.arrPinnedData[nIndex].DocumentUrl)) { - isArrayElement = true; - break; - } - } else { - if (oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].Path) === oCommonObject.getDecodeURIComponent(oGridConfig.arrPinnedData[nIndex].DocumentUrl)) { - isArrayElement = true; - break; - } - } - } else { - iSelectedTab = 2 === oGridConfig.currentView ? "#RecentDocumentContainer_Grid" : "#grid_Grid"; - if (oGridConfig.arrSelectedGridData[nCount].DocumentUrl) { - if (oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].DocumentUrl) === oCommonObject.getDecodeURIComponent(oGridConfig.arrGridData[nIndex].Path)) { - isArrayElement = true; - break; - } - } else { - if (oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].Path) === oCommonObject.getDecodeURIComponent(oGridConfig.arrGridData[nIndex].Path)) { - isArrayElement = true; - break; - } - } - } - - nCount--; - } - if (isArrayElement) { - oGridConfig.arrSelectedGridData.splice(nCount, 1); - if ($(iSelectedTab).find("#isSelectRowsActive").find("input[type='checkbox']:checked")) { - $(iSelectedTab).find("#isSelectRowsActive").prop("checked", false); - } - } else { - if (1 === oGridConfig.currentView) { - oGridConfig.arrSelectedGridData.push(oGridConfig.arrPinnedData[nIndex]); - } else { - oGridConfig.arrSelectedGridData.push(oGridConfig.arrGridData[nIndex]); - } - } - if (oGridConfig.arrSelectedGridData.length !== 0) { - $("#EmailDiv").css("cursor", "pointer"); - $("#EmailDiv").css("color", "#333"); - } else { - $("#EmailDiv").css("cursor", "default"); - $("#EmailDiv").css("color", "#444"); - } - $("#EmailTextCount").text("(" + oGridConfig.arrSelectedGridData.length + ")"); - - nTopRowCount = 1 === oGridConfig.currentView ? oGridConfig.arrPinnedData.length : oGridConfig.arrGridData.length; - - if ($(iSelectedTab).find(".jsonGridRow").find("input[type='checkbox']:checked").length === nTopRowCount) { - $(iSelectedTab).find("#isSelectRowsActive").prop("checked", true); - } -} - -// Function to sort pinned result -function sortPinMatter(container, sortByfield) { - "use strict"; - if (sortByfield.length) { - var item, arrHideUpload = [], sProperty; - var headerobject = document.querySelector(".jsonGridHeader"); - - if (headerobject) { - var sSortOrder = parseInt($(".sdBannerText").attr("data-order"), 10) ? "desc" : "asc"; - headerobject.setAttribute("sortorder", sSortOrder); - oGrid.sortJsonGrid(headerobject, container, sortByfield); - headerobject.setAttribute("sortorder", "asc"); - - var gridObjectPosition = oGrid.gridName.indexOf("pinnedGrid_Grid"); - var currentGridConfig = oGrid.gridObject[gridObjectPosition]; - var pinnedMatters = currentGridConfig && currentGridConfig.data; - // hide upload icon on matter tile and also on the matter pop up of pinned matters - var $CurrWebPinnedMatter = $("#pinnedGrid .uploadImg"); - $.each($CurrWebPinnedMatter, function (iIterator) { - if (pinnedMatters[iIterator].HideUpload.toLowerCase() !== "false") { - $(this).attr("class", "hideUpload"); - } else { - $(this).attr({ "onclick": "uploadElement(" + iIterator + ", event)", "src": "../Images/upload-666.png", "alt": "upload" }); - $(this).attr("style", ""); - $(this).removeClass("hideUpload").removeClass("hideUploadLeft"); - } - }); - sortPinnedArray(sSortOrder, sortByfield); - } - } else { - onPinnedItemSuccess(oSearchGlobal.pinnedMatterDataPassed, event); - } -} - -//// #region Formatter functions for Web Dashboard grid view -// Function to add Pin column in Web dashboard grid view -function loadPinIcon(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sPinChunk = (oGridConfig.bLoadPinnedData) ? "\"\"/" : "\"\""; - sPinChunk = "
      " + sPinChunk + "
      "; - return sPinChunk; -} - -// Function to add Upload column in Matter view -function loadUploadIcon(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sUploadImageDiv = oSearchGlobal.oUpload[nIndex] ? oSearchGlobal.oUpload[nIndex].replace("#nIndex", nIndex) : ""; - return "
      " + sUploadImageDiv + "
      "; -} - -// Function to add check box column in document view -function addCheckBox(cellValue, rowObject, width, nIndex) { - "use strict"; - var nCount, - isChecked = "", - iSelectedTab, - nTopRowCount; - var nSelectedRowCount = oGridConfig.arrSelectedGridData.length - 1; - width = width - 10; // Reducing 10, in order to incorporate 10px padding in the column - if (1 === oGridConfig.currentView) { - iSelectedTab = "#pinnedGrid_Grid"; - nTopRowCount = oGridConfig.arrPinnedData.length; - } else if (2 === oGridConfig.currentView) { - iSelectedTab = "#RecentDocumentContainer_Grid"; - nTopRowCount = oGridConfig.arrGridData.length; - } else { - iSelectedTab = "#grid_Grid"; - nTopRowCount = oGridConfig.arrGridData.length; - } - for (nCount = 0; nCount <= nSelectedRowCount; nCount++) { - var sCurrentPath = oGridConfig.arrSelectedGridData[nCount] && oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].Path); - var sPinnedDocumentPath = (oGridConfig.arrSelectedGridData[nCount] && oGridConfig.arrSelectedGridData[nCount].DocumentUrl) ? oCommonObject.getDecodeURIComponent(oGridConfig.arrSelectedGridData[nCount].DocumentUrl) : ""; - var rowObjectPath = rowObject.Path ? oCommonObject.getDecodeURIComponent(rowObject.Path) : oCommonObject.getDecodeURIComponent(rowObject.DocumentUrl); - sCurrentPath = sCurrentPath ? sCurrentPath : sPinnedDocumentPath; - if ((sCurrentPath && rowObjectPath && sCurrentPath === rowObjectPath)) { - isChecked = "checked"; - oGridConfig.nCheckedRowCount++; - if (oGridConfig.nCheckedRowCount === nTopRowCount) { - if ($(iSelectedTab).find("#isSelectRowsActive").find("input[type='checkbox']")) { - $(iSelectedTab).find("#isSelectRowsActive").prop("checked", true); - oGridConfig.nCheckedRowCount = 0; - } - } else { - if ($(iSelectedTab).find("#isSelectRowsActive").find("input[type='checkbox']")) { - $(iSelectedTab).find("#isSelectRowsActive").prop("checked", false); - } - } - break; - } - } - ////Following section is kept commented, as need to work on implementing fabric checkbox - ////var iCounter = oGridConfig.currentView + 1; - ////var iCurrentIndex = parseInt(parseInt(oGridConfig.itemsPerPage, 10) * parseInt(oGridConfig.nGridPageNumber, 10), 10) + parseInt(nIndex + 1, 10); - var sCheckBoxChunk = - "
      " - + "
      "; - - ////"
      "; - //// + "
      "; - return sCheckBoxChunk; -} - -// Function to append hyper link to document name in tile view -function loadGenericColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - width = width - 10; // Reducing 10, in order to incorporate 10px padding in the column. - var sCurrentValue = $.trim(cellValue) ? trimEndChar($.trim(cellValue), ";") : "NA"; - var sHTMLChunk = "
      " + sCurrentValue + "
      "; - return sHTMLChunk; -} - -// Function to generate Title column -function loadNameColumn(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sTitleProperty = ""; - width = width - 10; // Reducing 10, in order to incorporate 10px padding in the column. - // If pinned data is requested. - if (oGridConfig.bLoadPinnedData) { - sTitleProperty = oCommonObject.isMatterView ? oWebDashboardConstants.MatterPinnedTitleProperty : oWebDashboardConstants.DocumentPinnedTitleProperty; - } else { - sTitleProperty = oCommonObject.isMatterView ? oWebDashboardConstants.MatterTitleProperty : oWebDashboardConstants.DocumentTitleProperty; - } - var sTitleValue = ($.trim(rowObject[sTitleProperty])) ? $.trim(rowObject[sTitleProperty]) : "NA" - , sDocumentPath, sDocumentExtension, sDocumentSPWebUrl; - if (!oCommonObject.isMatterView) { - // If pinned data is requested - if (oGridConfig.bLoadPinnedData) { - sDocumentPath = rowObject[oWebDashboardConstants.DocumentOWAUrl]; - } else { - sTitleValue = extractTitle(sTitleValue); // Remove the extension from the document name only if current section is NOT pinned section - // Document path URL will be available as a property of rowObject in case of pinned documents. - sDocumentPath = trimEndChar(rowObject[oWebDashboardConstants.DocumentPath], "/"), sDocumentExtension = rowObject[oWebDashboardConstants.DocumentExtension], sDocumentSPWebUrl = rowObject[oWebDashboardConstants.DocumentSPWebUrl]; - if (-1 < $.inArray(sDocumentExtension, oFilterGlobal.arrOWADocumentExtension) && sDocumentSPWebUrl) { - sDocumentPath = commonFunction.getOWAUrl(sDocumentExtension, sDocumentSPWebUrl, sDocumentPath); - } - } - } - // Code chunk to put all returned properties as data- attributes - var sHTMLChunk = "
      " + sTitleValue + "
      "; - return sHTMLChunk; -} - -// Function to generate ClientMatterID column, content will be rendered as ClientID.MatterID -function generateClientMatterID(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sMatterIDProperty = "", sClientMatterID = "", sMatterIDValue = ""; - var sClientIDValue = $.trim(cellValue) ? cellValue : "NA"; - // If pinned data is requested - if (oGridConfig.bLoadPinnedData) { - sMatterIDProperty = (oCommonObject.isMatterView) ? oWebDashboardConstants.PinnedMatterIDPropertyNameForMatter : oWebDashboardConstants.PinnedMatterIDPropertyNameForDocument; - } else { - sMatterIDProperty = (oCommonObject.isMatterView) ? oWebDashboardConstants.MatterIDPropertyForMatter : oWebDashboardConstants.MatterIDPropertyForDocument; - } - sMatterIDValue = $.trim(rowObject[sMatterIDProperty]) ? $.trim(rowObject[sMatterIDProperty]) : "NA"; - sClientMatterID = sClientIDValue + oGlobalConstants.ClientID_MatterID_Separator + sMatterIDValue; - var sClientMatterIDChunk = "
      " + sClientMatterID + "
      "; - return sClientMatterIDChunk; -} - -// Function to generate Document Type Icon column in case of Search Document grid view -function loadDocumentTypeIcon(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sExtension = "", iconSrc = ""; - if ($.trim(cellValue)) { - sExtension = $.trim(cellValue); - } else if (oGridConfig.bLoadPinnedData) { - sExtension = (rowObject && rowObject.DocumentExtension) ? rowObject.DocumentExtension : ""; - } else { - sExtension = (rowObject && rowObject.FileExtension) ? rowObject.FileExtension : ""; - } - iconSrc = oCommonObject.getIconSource(sExtension); - return ""; -} - -// Function to generate Date column -function changeDateFormat(cellValue, rowObject, width, nIndex, event) { - "use strict"; - var sCurrentValue = $.trim(cellValue) ? $.trim(cellValue) : "NA"; - var sDateValue = "NA" !== sCurrentValue ? formatDate(sCurrentValue) : "NA"; - var sHTMLChunk = "
      " + sDateValue + "
      "; - return sHTMLChunk; -} - -//// #endregion \ No newline at end of file diff --git a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/jquery-1.10.2.min.js b/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/jquery-1.10.2.min.js deleted file mode 100644 index 1e92f319..00000000 --- a/tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.SharePointAppWeb/Scripts/jquery-1.10.2.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license*/ -(function (e, t) { - var n, r, i = typeof t, o = e.location, a = e.document, s = a.documentElement, l = e.jQuery, u = e.$, c = {}, p = [], f = "1.10.2", d = p.concat, h = p.push, g = p.slice, m = p.indexOf, y = c.toString, v = c.hasOwnProperty, b = f.trim, x = function (e, t) { return new x.fn.init(e, t, r) }, w = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, T = /\S+/g, C = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, N = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, k = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, E = /^[\],:{}\s]*$/, S = /(?:^|:|,)(?:\s*\[)+/g, A = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, j = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, D = /^-ms-/, L = /-([\da-z])/gi, H = function (e, t) { return t.toUpperCase() }, q = function (e) { (a.addEventListener || "load" === e.type || "complete" === a.readyState) && (_(), x.ready()) }, _ = function () { a.addEventListener ? (a.removeEventListener("DOMContentLoaded", q, !1), e.removeEventListener("load", q, !1)) : (a.detachEvent("onreadystatechange", q), e.detachEvent("onload", q)) }; x.fn = x.prototype = { jquery: f, constructor: x, init: function (e, n, r) { var i, o; if (!e) return this; if ("string" == typeof e) { if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e); if (i[1]) { if (n = n instanceof x ? n[0] : n, x.merge(this, x.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : a, !0)), k.test(i[1]) && x.isPlainObject(n)) for (i in n) x.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]); return this } if (o = a.getElementById(i[2]), o && o.parentNode) { if (o.id !== i[2]) return r.find(e); this.length = 1, this[0] = o } return this.context = a, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : x.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), x.makeArray(e, this)) }, selector: "", length: 0, toArray: function () { return g.call(this) }, get: function (e) { return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e] }, pushStack: function (e) { var t = x.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e, t) { return x.each(this, e, t) }, ready: function (e) { return x.ready.promise().done(e), this }, slice: function () { return this.pushStack(g.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (0 > e ? t : 0); return this.pushStack(n >= 0 && t > n ? [this[n]] : []) }, map: function (e) { return this.pushStack(x.map(this, function (t, n) { return e.call(t, n, t) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: h, sort: [].sort, splice: [].splice }, x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function () { var e, n, r, i, o, a, s = arguments[0] || {}, l = 1, u = arguments.length, c = !1; for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, l = 2), "object" == typeof s || x.isFunction(s) || (s = {}), u === l && (s = this, --l) ; u > l; l++) if (null != (o = arguments[l])) for (i in o) e = s[i], r = o[i], s !== r && (c && r && (x.isPlainObject(r) || (n = x.isArray(r))) ? (n ? (n = !1, a = e && x.isArray(e) ? e : []) : a = e && x.isPlainObject(e) ? e : {}, s[i] = x.extend(c, a, r)) : r !== t && (s[i] = r)); return s }, x.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), noConflict: function (t) { return e.$ === x && (e.$ = u), t && e.jQuery === x && (e.jQuery = l), x }, isReady: !1, readyWait: 1, holdReady: function (e) { e ? x.readyWait++ : x.ready(!0) }, ready: function (e) { if (e === !0 ? !--x.readyWait : !x.isReady) { if (!a.body) return setTimeout(x.ready); x.isReady = !0, e !== !0 && --x.readyWait > 0 || (n.resolveWith(a, [x]), x.fn.trigger && x(a).trigger("ready").off("ready")) } }, isFunction: function (e) { return "function" === x.type(e) }, isArray: Array.isArray || function (e) { return "array" === x.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? c[y.call(e)] || "object" : typeof e }, isPlainObject: function (e) { var n; if (!e || "object" !== x.type(e) || e.nodeType || x.isWindow(e)) return !1; try { if (e.constructor && !v.call(e, "constructor") && !v.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (r) { return !1 } if (x.support.ownLast) for (n in e) return v.call(e, n); for (n in e); return n === t || v.call(e, n) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, error: function (e) { throw Error(e) }, parseHTML: function (e, t, n) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (n = t, t = !1), t = t || a; var r = k.exec(e), i = !n && []; return r ? [t.createElement(r[1])] : (r = x.buildFragment([e], t, i), i && x(i).remove(), x.merge([], r.childNodes)) }, parseJSON: function (n) { return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = x.trim(n), n && E.test(n.replace(A, "@").replace(j, "]").replace(S, ""))) ? Function("return " + n)() : (x.error("Invalid JSON: " + n), t) }, parseXML: function (n) { var r, i; if (!n || "string" != typeof n) return null; try { e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n)) } catch (o) { r = t } return r && r.documentElement && !r.getElementsByTagName("parsererror").length || x.error("Invalid XML: " + n), r }, noop: function () { }, globalEval: function (t) { t && x.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(D, "ms-").replace(L, H) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t, n) { var r, i = 0, o = e.length, a = M(e); if (n) { if (a) { for (; o > i; i++) if (r = t.apply(e[i], n), r === !1) break } else for (i in e) if (r = t.apply(e[i], n), r === !1) break } else if (a) { for (; o > i; i++) if (r = t.call(e[i], i, e[i]), r === !1) break } else for (i in e) if (r = t.call(e[i], i, e[i]), r === !1) break; return e }, trim: b && !b.call("\ufeff\u00a0") ? function (e) { return null == e ? "" : b.call(e) } : function (e) { return null == e ? "" : (e + "").replace(C, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (M(Object(e)) ? x.merge(n, "string" == typeof e ? [e] : e) : h.call(n, e)), n }, inArray: function (e, t, n) { var r; if (t) { if (m) return m.call(t, e, n); for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n } return -1 }, merge: function (e, n) { var r = n.length, i = e.length, o = 0; if ("number" == typeof r) for (; r > o; o++) e[i++] = n[o]; else while (n[o] !== t) e[i++] = n[o++]; return e.length = i, e }, grep: function (e, t, n) { var r, i = [], o = 0, a = e.length; for (n = !!n; a > o; o++) r = !!t(e[o], o), n !== r && i.push(e[o]); return i }, map: function (e, t, n) { var r, i = 0, o = e.length, a = M(e), s = []; if (a) for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r); else for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r); return d.apply([], s) }, guid: 1, proxy: function (e, n) { var r, i, o; return "string" == typeof n && (o = e[n], n = e, e = o), x.isFunction(e) ? (r = g.call(arguments, 2), i = function () { return e.apply(n || this, r.concat(g.call(arguments))) }, i.guid = e.guid = e.guid || x.guid++, i) : t }, access: function (e, n, r, i, o, a, s) { var l = 0, u = e.length, c = null == r; if ("object" === x.type(r)) { o = !0; for (l in r) x.access(e, n, l, r[l], !0, a, s) } else if (i !== t && (o = !0, x.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) { return c.call(x(e), n) })), n)) for (; u > l; l++) n(e[l], r, s ? i : i.call(e[l], l, n(e[l], r))); return o ? e : c ? n.call(e) : u ? n(e[0], r) : a }, now: function () { return (new Date).getTime() }, swap: function (e, t, n, r) { var i, o, a = {}; for (o in t) a[o] = e.style[o], e.style[o] = t[o]; i = n.apply(e, r || []); for (o in t) e.style[o] = a[o]; return i } }), x.ready.promise = function (t) { if (!n) if (n = x.Deferred(), "complete" === a.readyState) setTimeout(x.ready); else if (a.addEventListener) a.addEventListener("DOMContentLoaded", q, !1), e.addEventListener("load", q, !1); else { a.attachEvent("onreadystatechange", q), e.attachEvent("onload", q); var r = !1; try { r = null == e.frameElement && a.documentElement } catch (i) { } r && r.doScroll && function o() { if (!x.isReady) { try { r.doScroll("left") } catch (e) { return setTimeout(o, 50) } _(), x.ready() } }() } return n.promise(t) }, x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) { c["[object " + t + "]"] = t.toLowerCase() }); function M(e) { var t = e.length, n = x.type(e); return x.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e) } r = x(a), function (e, t) { var n, r, i, o, a, s, l, u, c, p, f, d, h, g, m, y, v, b = "sizzle" + -new Date, w = e.document, T = 0, C = 0, N = st(), k = st(), E = st(), S = !1, A = function (e, t) { return e === t ? (S = !0, 0) : 0 }, j = typeof t, D = 1 << 31, L = {}.hasOwnProperty, H = [], q = H.pop, _ = H.push, M = H.push, O = H.slice, F = H.indexOf || function (e) { var t = 0, n = this.length; for (; n > t; t++) if (this[t] === e) return t; return -1 }, B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", P = "[\\x20\\t\\r\\n\\f]", R = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", W = R.replace("w", "w#"), $ = "\\[" + P + "*(" + R + ")" + P + "*(?:([*^$|!~]?=)" + P + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)" + P + "*\\]", I = ":(" + R + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + $.replace(3, 8) + ")*)|.*)\\)|)", z = RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"), X = RegExp("^" + P + "*," + P + "*"), U = RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"), V = RegExp(P + "*[+~]"), Y = RegExp("=" + P + "*([^\\]'\"]*)" + P + "*\\]", "g"), J = RegExp(I), G = RegExp("^" + W + "$"), Q = { ID: RegExp("^#(" + R + ")"), CLASS: RegExp("^\\.(" + R + ")"), TAG: RegExp("^(" + R.replace("w", "w*") + ")"), ATTR: RegExp("^" + $), PSEUDO: RegExp("^" + I), CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"), bool: RegExp("^(?:" + B + ")$", "i"), needsContext: RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i") }, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, et = /^(?:input|select|textarea|button)$/i, tt = /^h\d$/i, nt = /'|\\/g, rt = RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"), it = function (e, t, n) { var r = "0x" + t - 65536; return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r) }; try { M.apply(H = O.call(w.childNodes), w.childNodes), H[w.childNodes.length].nodeType } catch (ot) { M = { apply: H.length ? function (e, t) { _.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function at(e, t, n, i) { var o, a, s, l, u, c, d, m, y, x; if ((t ? t.ownerDocument || t : w) !== f && p(t), t = t || f, n = n || [], !e || "string" != typeof e) return n; if (1 !== (l = t.nodeType) && 9 !== l) return []; if (h && !i) { if (o = Z.exec(e)) if (s = o[1]) { if (9 === l) { if (a = t.getElementById(s), !a || !a.parentNode) return n; if (a.id === s) return n.push(a), n } else if (t.ownerDocument && (a = t.ownerDocument.getElementById(s)) && v(t, a) && a.id === s) return n.push(a), n } else { if (o[2]) return M.apply(n, t.getElementsByTagName(e)), n; if ((s = o[3]) && r.getElementsByClassName && t.getElementsByClassName) return M.apply(n, t.getElementsByClassName(s)), n } if (r.qsa && (!g || !g.test(e))) { if (m = d = b, y = t, x = 9 === l && e, 1 === l && "object" !== t.nodeName.toLowerCase()) { c = mt(e), (d = t.getAttribute("id")) ? m = d.replace(nt, "\\$&") : t.setAttribute("id", m), m = "[id='" + m + "'] ", u = c.length; while (u--) c[u] = m + yt(c[u]); y = V.test(e) && t.parentNode || t, x = c.join(",") } if (x) try { return M.apply(n, y.querySelectorAll(x)), n } catch (T) { } finally { d || t.removeAttribute("id") } } } return kt(e.replace(z, "$1"), t, n, i) } function st() { var e = []; function t(n, r) { return e.push(n += " ") > o.cacheLength && delete t[e.shift()], t[n] = r } return t } function lt(e) { return e[b] = !0, e } function ut(e) { var t = f.createElement("div"); try { return !!e(t) } catch (n) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function ct(e, t) { var n = e.split("|"), r = e.length; while (r--) o.attrHandle[n[r]] = t } function pt(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || D) - (~e.sourceIndex || D); if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function ft(e) { return function (t) { var n = t.nodeName.toLowerCase(); return "input" === n && t.type === e } } function dt(e) { return function (t) { var n = t.nodeName.toLowerCase(); return ("input" === n || "button" === n) && t.type === e } } function ht(e) { return lt(function (t) { return t = +t, lt(function (n, r) { var i, o = e([], n.length, t), a = o.length; while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i])) }) }) } s = at.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return t ? "HTML" !== t.nodeName : !1 }, r = at.support = {}, p = at.setDocument = function (e) { var n = e ? e.ownerDocument || e : w, i = n.defaultView; return n !== f && 9 === n.nodeType && n.documentElement ? (f = n, d = n.documentElement, h = !s(n), i && i.attachEvent && i !== i.top && i.attachEvent("onbeforeunload", function () { p() }), r.attributes = ut(function (e) { return e.className = "i", !e.getAttribute("className") }), r.getElementsByTagName = ut(function (e) { return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length }), r.getElementsByClassName = ut(function (e) { return e.innerHTML = "
      ", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length }), r.getById = ut(function (e) { return d.appendChild(e).id = b, !n.getElementsByName || !n.getElementsByName(b).length }), r.getById ? (o.find.ID = function (e, t) { if (typeof t.getElementById !== j && h) { var n = t.getElementById(e); return n && n.parentNode ? [n] : [] } }, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { return e.getAttribute("id") === t } }) : (delete o.find.ID, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { var n = typeof e.getAttributeNode !== j && e.getAttributeNode("id"); return n && n.value === t } }), o.find.TAG = r.getElementsByTagName ? function (e, n) { return typeof n.getElementsByTagName !== j ? n.getElementsByTagName(e) : t } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, o.find.CLASS = r.getElementsByClassName && function (e, n) { return typeof n.getElementsByClassName !== j && h ? n.getElementsByClassName(e) : t }, m = [], g = [], (r.qsa = K.test(n.querySelectorAll)) && (ut(function (e) { e.innerHTML = "", e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + B + ")"), e.querySelectorAll(":checked").length || g.push(":checked") }), ut(function (e) { var t = n.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:") })), (r.matchesSelector = K.test(y = d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ut(function (e) { r.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), m.push("!=", I) }), g = g.length && RegExp(g.join("|")), m = m.length && RegExp(m.join("|")), v = K.test(d.contains) || d.compareDocumentPosition ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, A = d.compareDocumentPosition ? function (e, t) { if (e === t) return S = !0, 0; var i = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t); return i ? 1 & i || !r.sortDetached && t.compareDocumentPosition(e) === i ? e === n || v(w, e) ? -1 : t === n || v(w, t) ? 1 : c ? F.call(c, e) - F.call(c, t) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1 } : function (e, t) { var r, i = 0, o = e.parentNode, a = t.parentNode, s = [e], l = [t]; if (e === t) return S = !0, 0; if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : c ? F.call(c, e) - F.call(c, t) : 0; if (o === a) return pt(e, t); r = e; while (r = r.parentNode) s.unshift(r); r = t; while (r = r.parentNode) l.unshift(r); while (s[i] === l[i]) i++; return i ? pt(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0 }, n) : f }, at.matches = function (e, t) { return at(e, null, null, t) }, at.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), !(!r.matchesSelector || !h || m && m.test(t) || g && g.test(t))) try { var n = y.call(e, t); if (n || r.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (i) { } return at(t, f, null, [e]).length > 0 }, at.contains = function (e, t) { return (e.ownerDocument || e) !== f && p(e), v(e, t) }, at.attr = function (e, n) { (e.ownerDocument || e) !== f && p(e); var i = o.attrHandle[n.toLowerCase()], a = i && L.call(o.attrHandle, n.toLowerCase()) ? i(e, n, !h) : t; return a === t ? r.attributes || !h ? e.getAttribute(n) : (a = e.getAttributeNode(n)) && a.specified ? a.value : null : a }, at.error = function (e) { throw Error("Syntax error, unrecognized expression: " + e) }, at.uniqueSort = function (e) { var t, n = [], i = 0, o = 0; if (S = !r.detectDuplicates, c = !r.sortStable && e.slice(0), e.sort(A), S) { while (t = e[o++]) t === e[o] && (i = n.push(o)); while (i--) e.splice(n[i], 1) } return e }, a = at.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += a(e) } else if (3 === i || 4 === i) return e.nodeValue } else for (; t = e[r]; r++) n += a(t); return n }, o = at.selectors = { cacheLength: 50, createPseudo: lt, match: Q, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(rt, it), e[3] = (e[4] || e[5] || "").replace(rt, it), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || at.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && at.error(e[0]), e }, PSEUDO: function (e) { var n, r = !e[5] && e[2]; return Q.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && J.test(r) && (n = mt(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(rt, it).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = N[e + " "]; return t || (t = RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && N(e, function (e) { return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== j && e.getAttribute("class") || "") }) }, ATTR: function (e, t, n) { return function (r) { var i = at.attr(r, e); return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0 } }, CHILD: function (e, t, n, r, i) { var o = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t; return 1 === r && 0 === i ? function (e) { return !!e.parentNode } : function (t, n, l) { var u, c, p, f, d, h, g = o !== a ? "nextSibling" : "previousSibling", m = t.parentNode, y = s && t.nodeName.toLowerCase(), v = !l && !s; if (m) { if (o) { while (g) { p = t; while (p = p[g]) if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1; h = g = "only" === e && !h && "nextSibling" } return !0 } if (h = [a ? m.firstChild : m.lastChild], a && v) { c = m[b] || (m[b] = {}), u = c[e] || [], d = u[0] === T && u[1], f = u[0] === T && u[2], p = d && m.childNodes[d]; while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if (1 === p.nodeType && ++f && p === t) { c[e] = [T, d, f]; break } } else if (v && (u = (t[b] || (t[b] = {}))[e]) && u[0] === T) f = u[1]; else while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[b] || (p[b] = {}))[e] = [T, f]), p === t)) break; return f -= i, f === r || 0 === f % r && f / r >= 0 } } }, PSEUDO: function (e, t) { var n, r = o.pseudos[e] || o.setFilters[e.toLowerCase()] || at.error("unsupported pseudo: " + e); return r[b] ? r(t) : r.length > 1 ? (n = [e, e, "", t], o.setFilters.hasOwnProperty(e.toLowerCase()) ? lt(function (e, n) { var i, o = r(e, t), a = o.length; while (a--) i = F.call(e, o[a]), e[i] = !(n[i] = o[a]) }) : function (e) { return r(e, 0, n) }) : r } }, pseudos: { not: lt(function (e) { var t = [], n = [], r = l(e.replace(z, "$1")); return r[b] ? lt(function (e, t, n, i) { var o, a = r(e, null, i, []), s = e.length; while (s--) (o = a[s]) && (e[s] = !(t[s] = o)) }) : function (e, i, o) { return t[0] = e, r(t, null, o, n), !n.pop() } }), has: lt(function (e) { return function (t) { return at(e, t).length > 0 } }), contains: lt(function (e) { return function (t) { return (t.textContent || t.innerText || a(t)).indexOf(e) > -1 } }), lang: lt(function (e) { return G.test(e || "") || at.error("unsupported lang: " + e), e = e.replace(rt, it).toLowerCase(), function (t) { var n; do if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType); return !1 } }), target: function (t) { var n = e.location && e.location.hash; return n && n.slice(1) === t.id }, root: function (e) { return e === d }, focus: function (e) { return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return e.disabled === !1 }, disabled: function (e) { return e.disabled === !0 }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, e.selected === !0 }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1; return !0 }, parent: function (e) { return !o.pseudos.empty(e) }, header: function (e) { return tt.test(e.nodeName) }, input: function (e) { return et.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type) }, first: ht(function () { return [0] }), last: ht(function (e, t) { return [t - 1] }), eq: ht(function (e, t, n) { return [0 > n ? n + t : n] }), even: ht(function (e, t) { var n = 0; for (; t > n; n += 2) e.push(n); return e }), odd: ht(function (e, t) { var n = 1; for (; t > n; n += 2) e.push(n); return e }), lt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; --r >= 0;) e.push(r); return e }), gt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; t > ++r;) e.push(r); return e }) } }, o.pseudos.nth = o.pseudos.eq; for (n in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) o.pseudos[n] = ft(n); for (n in { submit: !0, reset: !0 }) o.pseudos[n] = dt(n); function gt() { } gt.prototype = o.filters = o.pseudos, o.setFilters = new gt; function mt(e, t) { var n, r, i, a, s, l, u, c = k[e + " "]; if (c) return t ? 0 : c.slice(0); s = e, l = [], u = o.preFilter; while (s) { (!n || (r = X.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(i = [])), n = !1, (r = U.exec(s)) && (n = r.shift(), i.push({ value: n, type: r[0].replace(z, " ") }), s = s.slice(n.length)); for (a in o.filter) !(r = Q[a].exec(s)) || u[a] && !(r = u[a](r)) || (n = r.shift(), i.push({ value: n, type: a, matches: r }), s = s.slice(n.length)); if (!n) break } return t ? s.length : s ? at.error(e) : k(e, l).slice(0) } function yt(e) { var t = 0, n = e.length, r = ""; for (; n > t; t++) r += e[t].value; return r } function vt(e, t, n) { var r = t.dir, o = n && "parentNode" === r, a = C++; return t.first ? function (t, n, i) { while (t = t[r]) if (1 === t.nodeType || o) return e(t, n, i) } : function (t, n, s) { var l, u, c, p = T + " " + a; if (s) { while (t = t[r]) if ((1 === t.nodeType || o) && e(t, n, s)) return !0 } else while (t = t[r]) if (1 === t.nodeType || o) if (c = t[b] || (t[b] = {}), (u = c[r]) && u[0] === p) { if ((l = u[1]) === !0 || l === i) return l === !0 } else if (u = c[r] = [p], u[1] = e(t, n, s) || i, u[1] === !0) return !0 } } function bt(e) { return e.length > 1 ? function (t, n, r) { var i = e.length; while (i--) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function xt(e, t, n, r, i) { var o, a = [], s = 0, l = e.length, u = null != t; for (; l > s; s++) (o = e[s]) && (!n || n(o, r, i)) && (a.push(o), u && t.push(s)); return a } function wt(e, t, n, r, i, o) { return r && !r[b] && (r = wt(r)), i && !i[b] && (i = wt(i, o)), lt(function (o, a, s, l) { var u, c, p, f = [], d = [], h = a.length, g = o || Nt(t || "*", s.nodeType ? [s] : s, []), m = !e || !o && t ? g : xt(g, f, e, s, l), y = n ? i || (o ? e : h || r) ? [] : a : m; if (n && n(m, y, s, l), r) { u = xt(y, d), r(u, [], s, l), c = u.length; while (c--) (p = u[c]) && (y[d[c]] = !(m[d[c]] = p)) } if (o) { if (i || e) { if (i) { u = [], c = y.length; while (c--) (p = y[c]) && u.push(m[c] = p); i(null, y = [], u, l) } c = y.length; while (c--) (p = y[c]) && (u = i ? F.call(o, p) : f[c]) > -1 && (o[u] = !(a[u] = p)) } } else y = xt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, l) : M.apply(a, y) }) } function Tt(e) { var t, n, r, i = e.length, a = o.relative[e[0].type], s = a || o.relative[" "], l = a ? 1 : 0, c = vt(function (e) { return e === t }, s, !0), p = vt(function (e) { return F.call(t, e) > -1 }, s, !0), f = [function (e, n, r) { return !a && (r || n !== u) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r)) }]; for (; i > l; l++) if (n = o.relative[e[l].type]) f = [vt(bt(f), n)]; else { if (n = o.filter[e[l].type].apply(null, e[l].matches), n[b]) { for (r = ++l; i > r; r++) if (o.relative[e[r].type]) break; return wt(l > 1 && bt(f), l > 1 && yt(e.slice(0, l - 1).concat({ value: " " === e[l - 2].type ? "*" : "" })).replace(z, "$1"), n, r > l && Tt(e.slice(l, r)), i > r && Tt(e = e.slice(r)), i > r && yt(e)) } f.push(n) } return bt(f) } function Ct(e, t) { var n = 0, r = t.length > 0, a = e.length > 0, s = function (s, l, c, p, d) { var h, g, m, y = [], v = 0, b = "0", x = s && [], w = null != d, C = u, N = s || a && o.find.TAG("*", d && l.parentNode || l), k = T += null == C ? 1 : Math.random() || .1; for (w && (u = l !== f && l, i = n) ; null != (h = N[b]) ; b++) { if (a && h) { g = 0; while (m = e[g++]) if (m(h, l, c)) { p.push(h); break } w && (T = k, i = ++n) } r && ((h = !m && h) && v--, s && x.push(h)) } if (v += b, r && b !== v) { g = 0; while (m = t[g++]) m(x, y, l, c); if (s) { if (v > 0) while (b--) x[b] || y[b] || (y[b] = q.call(p)); y = xt(y) } M.apply(p, y), w && !s && y.length > 0 && v + t.length > 1 && at.uniqueSort(p) } return w && (T = k, u = C), x }; return r ? lt(s) : s } l = at.compile = function (e, t) { var n, r = [], i = [], o = E[e + " "]; if (!o) { t || (t = mt(e)), n = t.length; while (n--) o = Tt(t[n]), o[b] ? r.push(o) : i.push(o); o = E(e, Ct(i, r)) } return o }; function Nt(e, t, n) { var r = 0, i = t.length; for (; i > r; r++) at(e, t[r], n); return n } function kt(e, t, n, i) { var a, s, u, c, p, f = mt(e); if (!i && 1 === f.length) { if (s = f[0] = f[0].slice(0), s.length > 2 && "ID" === (u = s[0]).type && r.getById && 9 === t.nodeType && h && o.relative[s[1].type]) { if (t = (o.find.ID(u.matches[0].replace(rt, it), t) || [])[0], !t) return n; e = e.slice(s.shift().value.length) } a = Q.needsContext.test(e) ? 0 : s.length; while (a--) { if (u = s[a], o.relative[c = u.type]) break; if ((p = o.find[c]) && (i = p(u.matches[0].replace(rt, it), V.test(s[0].type) && t.parentNode || t))) { if (s.splice(a, 1), e = i.length && yt(s), !e) return M.apply(n, i), n; break } } } return l(e, f)(i, t, !h, n, V.test(e)), n } r.sortStable = b.split("").sort(A).join("") === b, r.detectDuplicates = S, p(), r.sortDetached = ut(function (e) { return 1 & e.compareDocumentPosition(f.createElement("div")) }), ut(function (e) { return e.innerHTML = "", "#" === e.firstChild.getAttribute("href") }) || ct("type|href|height|width", function (e, n, r) { return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2) }), r.attributes && ut(function (e) { return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || ct("value", function (e, n, r) { return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue }), ut(function (e) { return null == e.getAttribute("disabled") }) || ct(B, function (e, n, r) { var i; return r ? t : (i = e.getAttributeNode(n)) && i.specified ? i.value : e[n] === !0 ? n.toLowerCase() : null }), x.find = at, x.expr = at.selectors, x.expr[":"] = x.expr.pseudos, x.unique = at.uniqueSort, x.text = at.getText, x.isXMLDoc = at.isXML, x.contains = at.contains }(e); var O = {}; function F(e) { var t = O[e] = {}; return x.each(e.match(T) || [], function (e, n) { t[n] = !0 }), t } x.Callbacks = function (e) { e = "string" == typeof e ? O[e] || F(e) : x.extend({}, e); var n, r, i, o, a, s, l = [], u = !e.once && [], c = function (t) { for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = l.length, n = !0; l && o > a; a++) if (l[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) { r = !1; break } n = !1, l && (u ? u.length && c(u.shift()) : r ? l = [] : p.disable()) }, p = { add: function () { if (l) { var t = l.length; (function i(t) { x.each(t, function (t, n) { var r = x.type(n); "function" === r ? e.unique && p.has(n) || l.push(n) : n && n.length && "string" !== r && i(n) }) })(arguments), n ? o = l.length : r && (s = t, c(r)) } return this }, remove: function () { return l && x.each(arguments, function (e, t) { var r; while ((r = x.inArray(t, l, r)) > -1) l.splice(r, 1), n && (o >= r && o--, a >= r && a--) }), this }, has: function (e) { return e ? x.inArray(e, l) > -1 : !(!l || !l.length) }, empty: function () { return l = [], o = 0, this }, disable: function () { return l = u = r = t, this }, disabled: function () { return !l }, lock: function () { return u = t, r || p.disable(), this }, locked: function () { return !u }, fireWith: function (e, t) { return !l || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this }, fire: function () { return p.fireWith(this, arguments), this }, fired: function () { return !!i } }; return p }, x.extend({ Deferred: function (e) { var t = [["resolve", "done", x.Callbacks("once memory"), "resolved"], ["reject", "fail", x.Callbacks("once memory"), "rejected"], ["notify", "progress", x.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return x.Deferred(function (n) { x.each(t, function (t, o) { var a = o[0], s = x.isFunction(e[t]) && e[t]; i[o[1]](function () { var e = s && s.apply(this, arguments); e && x.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments) }) }), e = null }).promise() }, promise: function (e) { return null != e ? x.extend(e, r) : r } }, i = {}; return r.pipe = r.then, x.each(t, function (e, o) { var a = o[2], s = o[3]; r[o[1]] = a.add, s && a.add(function () { n = s }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () { return i[o[0] + "With"](this === i ? r : this, arguments), this }, i[o[0] + "With"] = a.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t = 0, n = g.call(arguments), r = n.length, i = 1 !== r || e && x.isFunction(e.promise) ? r : 0, o = 1 === i ? e : x.Deferred(), a = function (e, t, n) { return function (r) { t[e] = this, n[e] = arguments.length > 1 ? g.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n) } }, s, l, u; if (r > 1) for (s = Array(r), l = Array(r), u = Array(r) ; r > t; t++) n[t] && x.isFunction(n[t].promise) ? n[t].promise().done(a(t, u, n)).fail(o.reject).progress(a(t, l, s)) : --i; return i || o.resolveWith(u, n), o.promise() } }), x.support = function (t) { - var n, r, o, s, l, u, c, p, f, d = a.createElement("div"); if (d.setAttribute("className", "t"), d.innerHTML = "
      a", n = d.getElementsByTagName("*") || [], r = d.getElementsByTagName("a")[0], !r || !r.style || !n.length) return t; s = a.createElement("select"), u = s.appendChild(a.createElement("option")), o = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== d.className, t.leadingWhitespace = 3 === d.firstChild.nodeType, t.tbody = !d.getElementsByTagName("tbody").length, t.htmlSerialize = !!d.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !!r.style.cssFloat, t.checkOn = !!o.value, t.optSelected = u.selected, t.enctype = !!a.createElement("form").enctype, t.html5Clone = "<:nav>" !== a.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !u.disabled; try { delete d.test } catch (h) { t.deleteExpando = !1 } o = a.createElement("input"), o.setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), l = a.createDocumentFragment(), l.appendChild(o), t.appendChecked = o.checked, t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () { t.noCloneEvent = !1 }), d.cloneNode(!0).click()); for (f in { submit: !0, change: !0, focusin: !0 }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1; d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip; for (f in x(t)) break; return t.ownLast = "0" !== f, x(function () { var n, r, o, s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", l = a.getElementsByTagName("body")[0]; l && (n = a.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", l.appendChild(n).appendChild(d), d.innerHTML = "
      t
      ", o = d.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === o[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", x.swap(l, null != l.style.zoom ? { zoom: 1 } : {}, function () { t.boxSizing = 4 === d.offsetWidth }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || { width: "4px" }).width, r = d.appendChild(a.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "
      ", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (l.style.zoom = 1)), l.removeChild(n), n = d = o = r = null) }), n = s = l = u = r = o = null, t - }({}); var B = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, P = /([A-Z])/g; function R(e, n, r, i) { if (x.acceptData(e)) { var o, a, s = x.expando, l = e.nodeType, u = l ? x.cache : e, c = l ? e[s] : e[s] && s; if (c && u[c] && (i || u[c].data) || r !== t || "string" != typeof n) return c || (c = l ? e[s] = p.pop() || x.guid++ : s), u[c] || (u[c] = l ? {} : { toJSON: x.noop }), ("object" == typeof n || "function" == typeof n) && (i ? u[c] = x.extend(u[c], n) : u[c].data = x.extend(u[c].data, n)), a = u[c], i || (a.data || (a.data = {}), a = a.data), r !== t && (a[x.camelCase(n)] = r), "string" == typeof n ? (o = a[n], null == o && (o = a[x.camelCase(n)])) : o = a, o } } function W(e, t, n) { if (x.acceptData(e)) { var r, i, o = e.nodeType, a = o ? x.cache : e, s = o ? e[x.expando] : x.expando; if (a[s]) { if (t && (r = n ? a[s] : a[s].data)) { x.isArray(t) ? t = t.concat(x.map(t, x.camelCase)) : t in r ? t = [t] : (t = x.camelCase(t), t = t in r ? [t] : t.split(" ")), i = t.length; while (i--) delete r[t[i]]; if (n ? !I(r) : !x.isEmptyObject(r)) return } (n || (delete a[s].data, I(a[s]))) && (o ? x.cleanData([e], !0) : x.support.deleteExpando || a != a.window ? delete a[s] : a[s] = null) } } } x.extend({ cache: {}, noData: { applet: !0, embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function (e) { return e = e.nodeType ? x.cache[e[x.expando]] : e[x.expando], !!e && !I(e) }, data: function (e, t, n) { return R(e, t, n) }, removeData: function (e, t) { return W(e, t) }, _data: function (e, t, n) { return R(e, t, n, !0) }, _removeData: function (e, t) { return W(e, t, !0) }, acceptData: function (e) { if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1; var t = e.nodeName && x.noData[e.nodeName.toLowerCase()]; return !t || t !== !0 && e.getAttribute("classid") === t } }), x.fn.extend({ data: function (e, n) { var r, i, o = null, a = 0, s = this[0]; if (e === t) { if (this.length && (o = x.data(s), 1 === s.nodeType && !x._data(s, "parsedAttrs"))) { for (r = s.attributes; r.length > a; a++) i = r[a].name, 0 === i.indexOf("data-") && (i = x.camelCase(i.slice(5)), $(s, i, o[i])); x._data(s, "parsedAttrs", !0) } return o } return "object" == typeof e ? this.each(function () { x.data(this, e) }) : arguments.length > 1 ? this.each(function () { x.data(this, e, n) }) : s ? $(s, e, x.data(s, e)) : null }, removeData: function (e) { return this.each(function () { x.removeData(this, e) }) } }); function $(e, n, r) { if (r === t && 1 === e.nodeType) { var i = "data-" + n.replace(P, "-$1").toLowerCase(); if (r = e.getAttribute(i), "string" == typeof r) { try { r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : B.test(r) ? x.parseJSON(r) : r } catch (o) { } x.data(e, n, r) } else r = t } return r } function I(e) { var t; for (t in e) if (("data" !== t || !x.isEmptyObject(e[t])) && "toJSON" !== t) return !1; return !0 } x.extend({ queue: function (e, n, r) { var i; return e ? (n = (n || "fx") + "queue", i = x._data(e, n), r && (!i || x.isArray(r) ? i = x._data(e, n, x.makeArray(r)) : i.push(r)), i || []) : t }, dequeue: function (e, t) { t = t || "fx"; var n = x.queue(e, t), r = n.length, i = n.shift(), o = x._queueHooks(e, t), a = function () { x.dequeue(e, t) }; "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, a, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return x._data(e, n) || x._data(e, n, { empty: x.Callbacks("once memory").add(function () { x._removeData(e, t + "queue"), x._removeData(e, n) }) }) } }), x.fn.extend({ queue: function (e, n) { var r = 2; return "string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? x.queue(this[0], e) : n === t ? this : this.each(function () { var t = x.queue(this, e, n); x._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && x.dequeue(this, e) }) }, dequeue: function (e) { return this.each(function () { x.dequeue(this, e) }) }, delay: function (e, t) { return e = x.fx ? x.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) { var r = setTimeout(t, e); n.stop = function () { clearTimeout(r) } }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, n) { var r, i = 1, o = x.Deferred(), a = this, s = this.length, l = function () { --i || o.resolveWith(a, [a]) }; "string" != typeof e && (n = e, e = t), e = e || "fx"; while (s--) r = x._data(a[s], e + "queueHooks"), r && r.empty && (i++, r.empty.add(l)); return l(), o.promise(n) } }); var z, X, U = /[\t\r\n\f]/g, V = /\r/g, Y = /^(?:input|select|textarea|button|object)$/i, J = /^(?:a|area)$/i, G = /^(?:checked|selected)$/i, Q = x.support.getSetAttribute, K = x.support.input; x.fn.extend({ attr: function (e, t) { return x.access(this, x.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each(function () { x.removeAttr(this, e) }) }, prop: function (e, t) { return x.access(this, x.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return e = x.propFix[e] || e, this.each(function () { try { this[e] = t, delete this[e] } catch (n) { } }) }, addClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, l = "string" == typeof e && e; if (x.isFunction(e)) return this.each(function (t) { x(this).addClass(e.call(this, t, this.className)) }); if (l) for (t = (e || "").match(T) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : " ")) { o = 0; while (i = t[o++]) 0 > r.indexOf(" " + i + " ") && (r += i + " "); n.className = x.trim(r) } return this }, removeClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, l = 0 === arguments.length || "string" == typeof e && e; if (x.isFunction(e)) return this.each(function (t) { x(this).removeClass(e.call(this, t, this.className)) }); if (l) for (t = (e || "").match(T) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : "")) { o = 0; while (i = t[o++]) while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " "); n.className = e ? x.trim(r) : "" } return this }, toggleClass: function (e, t) { var n = typeof e; return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : x.isFunction(e) ? this.each(function (n) { x(this).toggleClass(e.call(this, n, this.className, t), t) }) : this.each(function () { if ("string" === n) { var t, r = 0, o = x(this), a = e.match(T) || []; while (t = a[r++]) o.hasClass(t) ? o.removeClass(t) : o.addClass(t) } else (n === i || "boolean" === n) && (this.className && x._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : x._data(this, "__className__") || "") }) }, hasClass: function (e) { var t = " " + e + " ", n = 0, r = this.length; for (; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(U, " ").indexOf(t) >= 0) return !0; return !1 }, val: function (e) { var n, r, i, o = this[0]; { if (arguments.length) return i = x.isFunction(e), this.each(function (n) { var o; 1 === this.nodeType && (o = i ? e.call(this, n, x(this).val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : x.isArray(o) && (o = x.map(o, function (e) { return null == e ? "" : e + "" })), r = x.valHooks[this.type] || x.valHooks[this.nodeName.toLowerCase()], r && "set" in r && r.set(this, o, "value") !== t || (this.value = o)) }); if (o) return r = x.valHooks[o.type] || x.valHooks[o.nodeName.toLowerCase()], r && "get" in r && (n = r.get(o, "value")) !== t ? n : (n = o.value, "string" == typeof n ? n.replace(V, "") : null == n ? "" : n) } } }), x.extend({ valHooks: { option: { get: function (e) { var t = x.find.attr(e, "value"); return null != t ? t : e.text } }, select: { get: function (e) { var t, n, r = e.options, i = e.selectedIndex, o = "select-one" === e.type || 0 > i, a = o ? null : [], s = o ? i + 1 : r.length, l = 0 > i ? s : o ? i : 0; for (; s > l; l++) if (n = r[l], !(!n.selected && l !== i || (x.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && x.nodeName(n.parentNode, "optgroup"))) { if (t = x(n).val(), o) return t; a.push(t) } return a }, set: function (e, t) { var n, r, i = e.options, o = x.makeArray(t), a = i.length; while (a--) r = i[a], (r.selected = x.inArray(x(r).val(), o) >= 0) && (n = !0); return n || (e.selectedIndex = -1), o } } }, attr: function (e, n, r) { var o, a, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return typeof e.getAttribute === i ? x.prop(e, n, r) : (1 === s && x.isXMLDoc(e) || (n = n.toLowerCase(), o = x.attrHooks[n] || (x.expr.match.bool.test(n) ? X : z)), r === t ? o && "get" in o && null !== (a = o.get(e, n)) ? a : (a = x.find.attr(e, n), null == a ? t : a) : null !== r ? o && "set" in o && (a = o.set(e, r, n)) !== t ? a : (e.setAttribute(n, r + ""), r) : (x.removeAttr(e, n), t)) }, removeAttr: function (e, t) { var n, r, i = 0, o = t && t.match(T); if (o && 1 === e.nodeType) while (n = o[i++]) r = x.propFix[n] || n, x.expr.match.bool.test(n) ? K && Q || !G.test(n) ? e[r] = !1 : e[x.camelCase("default-" + n)] = e[r] = !1 : x.attr(e, n, ""), e.removeAttribute(Q ? n : r) }, attrHooks: { type: { set: function (e, t) { if (!x.support.radioValue && "radio" === t && x.nodeName(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function (e, n, r) { var i, o, a, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !x.isXMLDoc(e), a && (n = x.propFix[n] || n, o = x.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n] }, propHooks: { tabIndex: { get: function (e) { var t = x.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : Y.test(e.nodeName) || J.test(e.nodeName) && e.href ? 0 : -1 } } } }), X = { set: function (e, t, n) { return t === !1 ? x.removeAttr(e, n) : K && Q || !G.test(n) ? e.setAttribute(!Q && x.propFix[n] || n, n) : e[x.camelCase("default-" + n)] = e[n] = !0, n } }, x.each(x.expr.match.bool.source.match(/\w+/g), function (e, n) { var r = x.expr.attrHandle[n] || x.find.attr; x.expr.attrHandle[n] = K && Q || !G.test(n) ? function (e, n, i) { var o = x.expr.attrHandle[n], a = i ? t : (x.expr.attrHandle[n] = t) != r(e, n, i) ? n.toLowerCase() : null; return x.expr.attrHandle[n] = o, a } : function (e, n, r) { return r ? t : e[x.camelCase("default-" + n)] ? n.toLowerCase() : null } }), K && Q || (x.attrHooks.value = { set: function (e, n, r) { return x.nodeName(e, "input") ? (e.defaultValue = n, t) : z && z.set(e, n, r) } }), Q || (z = { set: function (e, n, r) { var i = e.getAttributeNode(r); return i || e.setAttributeNode(i = e.ownerDocument.createAttribute(r)), i.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t } }, x.expr.attrHandle.id = x.expr.attrHandle.name = x.expr.attrHandle.coords = function (e, n, r) { var i; return r ? t : (i = e.getAttributeNode(n)) && "" !== i.value ? i.value : null }, x.valHooks.button = { get: function (e, n) { var r = e.getAttributeNode(n); return r && r.specified ? r.value : t }, set: z.set }, x.attrHooks.contenteditable = { set: function (e, t, n) { z.set(e, "" === t ? !1 : t, n) } }, x.each(["width", "height"], function (e, n) { x.attrHooks[n] = { set: function (e, r) { return "" === r ? (e.setAttribute(n, "auto"), r) : t } } })), x.support.hrefNormalized || x.each(["href", "src"], function (e, t) { x.propHooks[t] = { get: function (e) { return e.getAttribute(t, 4) } } }), x.support.style || (x.attrHooks.style = { get: function (e) { return e.style.cssText || t }, set: function (e, t) { return e.style.cssText = t + "" } }), x.support.optSelected || (x.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null } }), x.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { x.propFix[this.toLowerCase()] = this }), x.support.enctype || (x.propFix.enctype = "encoding"), x.each(["radio", "checkbox"], function () { x.valHooks[this] = { set: function (e, n) { return x.isArray(n) ? e.checked = x.inArray(x(e).val(), n) >= 0 : t } }, x.support.checkOn || (x.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }); var Z = /^(?:input|select|textarea)$/i, et = /^key/, tt = /^(?:mouse|contextmenu)|click/, nt = /^(?:focusinfocus|focusoutblur)$/, rt = /^([^.]*)(?:\.(.+)|)$/; function it() { return !0 } function ot() { return !1 } function at() { try { return a.activeElement } catch (e) { } } x.event = { global: {}, add: function (e, n, r, o, a) { var s, l, u, c, p, f, d, h, g, m, y, v = x._data(e); if (v) { r.handler && (c = r, r = c.handler, a = c.selector), r.guid || (r.guid = x.guid++), (l = v.events) || (l = v.events = {}), (f = v.handle) || (f = v.handle = function (e) { return typeof x === i || e && x.event.triggered === e.type ? t : x.event.dispatch.apply(f.elem, arguments) }, f.elem = e), n = (n || "").match(T) || [""], u = n.length; while (u--) s = rt.exec(n[u]) || [], g = y = s[1], m = (s[2] || "").split(".").sort(), g && (p = x.event.special[g] || {}, g = (a ? p.delegateType : p.bindType) || g, p = x.event.special[g] || {}, d = x.extend({ type: g, origType: y, data: o, handler: r, guid: r.guid, selector: a, needsContext: a && x.expr.match.needsContext.test(a), namespace: m.join(".") }, c), (h = l[g]) || (h = l[g] = [], h.delegateCount = 0, p.setup && p.setup.call(e, o, m, f) !== !1 || (e.addEventListener ? e.addEventListener(g, f, !1) : e.attachEvent && e.attachEvent("on" + g, f))), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), a ? h.splice(h.delegateCount++, 0, d) : h.push(d), x.event.global[g] = !0); e = null } }, remove: function (e, t, n, r, i) { var o, a, s, l, u, c, p, f, d, h, g, m = x.hasData(e) && x._data(e); if (m && (c = m.events)) { t = (t || "").match(T) || [""], u = t.length; while (u--) if (s = rt.exec(t[u]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d) { p = x.event.special[d] || {}, d = (r ? p.delegateType : p.bindType) || d, f = c[d] || [], s = s[2] && RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), l = o = f.length; while (o--) a = f[o], !i && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (f.splice(o, 1), a.selector && f.delegateCount--, p.remove && p.remove.call(e, a)); l && !f.length && (p.teardown && p.teardown.call(e, h, m.handle) !== !1 || x.removeEvent(e, d, m.handle), delete c[d]) } else for (d in c) x.event.remove(e, d + t[u], n, r, !0); x.isEmptyObject(c) && (delete m.handle, x._removeData(e, "events")) } }, trigger: function (n, r, i, o) { var s, l, u, c, p, f, d, h = [i || a], g = v.call(n, "type") ? n.type : n, m = v.call(n, "namespace") ? n.namespace.split(".") : []; if (u = f = i = i || a, 3 !== i.nodeType && 8 !== i.nodeType && !nt.test(g + x.event.triggered) && (g.indexOf(".") >= 0 && (m = g.split("."), g = m.shift(), m.sort()), l = 0 > g.indexOf(":") && "on" + g, n = n[x.expando] ? n : new x.Event(g, "object" == typeof n && n), n.isTrigger = o ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = i), r = null == r ? [n] : x.makeArray(r, [n]), p = x.event.special[g] || {}, o || !p.trigger || p.trigger.apply(i, r) !== !1)) { if (!o && !p.noBubble && !x.isWindow(i)) { for (c = p.delegateType || g, nt.test(c + g) || (u = u.parentNode) ; u; u = u.parentNode) h.push(u), f = u; f === (i.ownerDocument || a) && h.push(f.defaultView || f.parentWindow || e) } d = 0; while ((u = h[d++]) && !n.isPropagationStopped()) n.type = d > 1 ? c : p.bindType || g, s = (x._data(u, "events") || {})[n.type] && x._data(u, "handle"), s && s.apply(u, r), s = l && u[l], s && x.acceptData(u) && s.apply && s.apply(u, r) === !1 && n.preventDefault(); if (n.type = g, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(h.pop(), r) === !1) && x.acceptData(i) && l && i[g] && !x.isWindow(i)) { f = i[l], f && (i[l] = null), x.event.triggered = g; try { i[g]() } catch (y) { } x.event.triggered = t, f && (i[l] = f) } return n.result } }, dispatch: function (e) { e = x.event.fix(e); var n, r, i, o, a, s = [], l = g.call(arguments), u = (x._data(this, "events") || {})[e.type] || [], c = x.event.special[e.type] || {}; if (l[0] = e, e.delegateTarget = this, !c.preDispatch || c.preDispatch.call(this, e) !== !1) { s = x.event.handlers.call(this, e, u), n = 0; while ((o = s[n++]) && !e.isPropagationStopped()) { e.currentTarget = o.elem, a = 0; while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped()) (!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((x.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, e), e.result } }, handlers: function (e, n) { var r, i, o, a, s = [], l = n.delegateCount, u = e.target; if (l && u.nodeType && (!e.button || "click" !== e.type)) for (; u != this; u = u.parentNode || this) if (1 === u.nodeType && (u.disabled !== !0 || "click" !== e.type)) { for (o = [], a = 0; l > a; a++) i = n[a], r = i.selector + " ", o[r] === t && (o[r] = i.needsContext ? x(r, this).index(u) >= 0 : x.find(r, this, null, [u]).length), o[r] && o.push(i); o.length && s.push({ elem: u, handlers: o }) } return n.length > l && s.push({ elem: this, handlers: n.slice(l) }), s }, fix: function (e) { if (e[x.expando]) return e; var t, n, r, i = e.type, o = e, s = this.fixHooks[i]; s || (this.fixHooks[i] = s = tt.test(i) ? this.mouseHooks : et.test(i) ? this.keyHooks : {}), r = s.props ? this.props.concat(s.props) : this.props, e = new x.Event(o), t = r.length; while (t--) n = r[t], e[n] = o[n]; return e.target || (e.target = o.srcElement || a), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, s.filter ? s.filter(e, o) : e }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, n) { var r, i, o, s = n.button, l = n.fromElement; return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || a, o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)), !e.relatedTarget && l && (e.relatedTarget = l === e.target ? n.toElement : l), e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e } }, special: { load: { noBubble: !0 }, focus: { trigger: function () { if (this !== at() && this.focus) try { return this.focus(), !1 } catch (e) { } }, delegateType: "focusin" }, blur: { trigger: function () { return this === at() && this.blur ? (this.blur(), !1) : t }, delegateType: "focusout" }, click: { trigger: function () { return x.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t }, _default: function (e) { return x.nodeName(e.target, "a") } }, beforeunload: { postDispatch: function (e) { e.result !== t && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, n, r) { var i = x.extend(new x.Event, n, { type: e, isSimulated: !0, originalEvent: {} }); r ? x.event.trigger(i, null, t) : x.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault() } }, x.removeEvent = a.removeEventListener ? function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1) } : function (e, t, n) { var r = "on" + t; e.detachEvent && (typeof e[r] === i && (e[r] = null), e.detachEvent(r, n)) }, x.Event = function (e, n) { return this instanceof x.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? it : ot) : this.type = e, n && x.extend(this, n), this.timeStamp = e && e.timeStamp || x.now(), this[x.expando] = !0, t) : new x.Event(e, n) }, x.Event.prototype = { isDefaultPrevented: ot, isPropagationStopped: ot, isImmediatePropagationStopped: ot, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = it, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = it, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = it, this.stopPropagation() } }, x.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (e, t) { x.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var n, r = this, i = e.relatedTarget, o = e.handleObj; return (!i || i !== r && !x.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n } } }), x.support.submitBubbles || (x.event.special.submit = { setup: function () { return x.nodeName(this, "form") ? !1 : (x.event.add(this, "click._submit keypress._submit", function (e) { var n = e.target, r = x.nodeName(n, "input") || x.nodeName(n, "button") ? n.form : t; r && !x._data(r, "submitBubbles") && (x.event.add(r, "submit._submit", function (e) { e._submit_bubble = !0 }), x._data(r, "submitBubbles", !0)) }), t) }, postDispatch: function (e) { e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && x.event.simulate("submit", this.parentNode, e, !0)) }, teardown: function () { return x.nodeName(this, "form") ? !1 : (x.event.remove(this, "._submit"), t) } }), x.support.changeBubbles || (x.event.special.change = { setup: function () { return Z.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (x.event.add(this, "propertychange._change", function (e) { "checked" === e.originalEvent.propertyName && (this._just_changed = !0) }), x.event.add(this, "click._change", function (e) { this._just_changed && !e.isTrigger && (this._just_changed = !1), x.event.simulate("change", this, e, !0) })), !1) : (x.event.add(this, "beforeactivate._change", function (e) { var t = e.target; Z.test(t.nodeName) && !x._data(t, "changeBubbles") && (x.event.add(t, "change._change", function (e) { !this.parentNode || e.isSimulated || e.isTrigger || x.event.simulate("change", this.parentNode, e, !0) }), x._data(t, "changeBubbles", !0)) }), t) }, handle: function (e) { var n = e.target; return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t }, teardown: function () { return x.event.remove(this, "._change"), !Z.test(this.nodeName) } }), x.support.focusinBubbles || x.each({ focus: "focusin", blur: "focusout" }, function (e, t) { var n = 0, r = function (e) { x.event.simulate(t, e.target, x.event.fix(e), !0) }; x.event.special[t] = { setup: function () { 0 === n++ && a.addEventListener(e, r, !0) }, teardown: function () { 0 === --n && a.removeEventListener(e, r, !0) } } }), x.fn.extend({ on: function (e, n, r, i, o) { var a, s; if ("object" == typeof e) { "string" != typeof n && (r = r || n, n = t); for (a in e) this.on(a, n, r, e[a], o); return this } if (null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1) i = ot; else if (!i) return this; return 1 === o && (s = i, i = function (e) { return x().off(e), s.apply(this, arguments) }, i.guid = s.guid || (s.guid = x.guid++)), this.each(function () { x.event.add(this, e, i, r, n) }) }, one: function (e, t, n, r) { return this.on(e, t, n, r, 1) }, off: function (e, n, r) { var i, o; if (e && e.preventDefault && e.handleObj) return i = e.handleObj, x(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this; if ("object" == typeof e) { for (o in e) this.off(o, n, e[o]); return this } return (n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = ot), this.each(function () { x.event.remove(this, e, r, n) }) }, trigger: function (e, t) { return this.each(function () { x.event.trigger(e, t, this) }) }, triggerHandler: function (e, n) { var r = this[0]; return r ? x.event.trigger(e, n, r, !0) : t } }); var st = /^.[^:#\[\.,]*$/, lt = /^(?:parents|prev(?:Until|All))/, ut = x.expr.match.needsContext, ct = { children: !0, contents: !0, next: !0, prev: !0 }; x.fn.extend({ find: function (e) { var t, n = [], r = this, i = r.length; if ("string" != typeof e) return this.pushStack(x(e).filter(function () { for (t = 0; i > t; t++) if (x.contains(r[t], this)) return !0 })); for (t = 0; i > t; t++) x.find(e, r[t], n); return n = this.pushStack(i > 1 ? x.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n }, has: function (e) { var t, n = x(e, this), r = n.length; return this.filter(function () { for (t = 0; r > t; t++) if (x.contains(this, n[t])) return !0 }) }, not: function (e) { return this.pushStack(ft(this, e || [], !0)) }, filter: function (e) { return this.pushStack(ft(this, e || [], !1)) }, is: function (e) { return !!ft(this, "string" == typeof e && ut.test(e) ? x(e) : e || [], !1).length }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = ut.test(e) || "string" != typeof e ? x(e, t || this.context) : 0; for (; i > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (11 > n.nodeType && (a ? a.index(n) > -1 : 1 === n.nodeType && x.find.matchesSelector(n, e))) { n = o.push(n); break } return this.pushStack(o.length > 1 ? x.unique(o) : o) }, index: function (e) { return e ? "string" == typeof e ? x.inArray(this[0], x(e)) : x.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { var n = "string" == typeof e ? x(e, t) : x.makeArray(e && e.nodeType ? [e] : e), r = x.merge(this.get(), n); return this.pushStack(x.unique(r)) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }); function pt(e, t) { do e = e[t]; while (e && 1 !== e.nodeType); return e } x.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return x.dir(e, "parentNode") }, parentsUntil: function (e, t, n) { return x.dir(e, "parentNode", n) }, next: function (e) { return pt(e, "nextSibling") }, prev: function (e) { return pt(e, "previousSibling") }, nextAll: function (e) { return x.dir(e, "nextSibling") }, prevAll: function (e) { return x.dir(e, "previousSibling") }, nextUntil: function (e, t, n) { return x.dir(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return x.dir(e, "previousSibling", n) }, siblings: function (e) { return x.sibling((e.parentNode || {}).firstChild, e) }, children: function (e) { return x.sibling(e.firstChild) }, contents: function (e) { return x.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : x.merge([], e.childNodes) } }, function (e, t) { x.fn[e] = function (n, r) { var i = x.map(this, t, n); return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (i = x.filter(r, i)), this.length > 1 && (ct[e] || (i = x.unique(i)), lt.test(e) && (i = i.reverse())), this.pushStack(i) } }), x.extend({ filter: function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? x.find.matchesSelector(r, e) ? [r] : [] : x.find.matches(e, x.grep(t, function (e) { return 1 === e.nodeType })) }, dir: function (e, n, r) { var i = [], o = e[n]; while (o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !x(o).is(r))) 1 === o.nodeType && i.push(o), o = o[n]; return i }, sibling: function (e, t) { var n = []; for (; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); return n } }); function ft(e, t, n) { if (x.isFunction(t)) return x.grep(e, function (e, r) { return !!t.call(e, r, e) !== n }); if (t.nodeType) return x.grep(e, function (e) { return e === t !== n }); if ("string" == typeof t) { if (st.test(t)) return x.filter(t, e, n); t = x.filter(t, e) } return x.grep(e, function (e) { return x.inArray(e, t) >= 0 !== n }) } function dt(e) { var t = ht.split("|"), n = e.createDocumentFragment(); if (n.createElement) while (t.length) n.createElement(t.pop()); return n } var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", gt = / jQuery\d+="(?:null|\d+)"/g, mt = RegExp("<(?:" + ht + ")[\\s/>]", "i"), yt = /^\s+/, vt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, bt = /<([\w:]+)/, xt = /\s*$/g, At = { option: [1, ""], legend: [1, "
      ", "
      "], area: [1, "", ""], param: [1, "", ""], thead: [1, "", "
      "], tr: [2, "", "
      "], col: [2, "", "
      "], td: [3, "", "
      "], _default: x.support.htmlSerialize ? [0, "", ""] : [1, "X
      ", "
      "] }, jt = dt(a), Dt = jt.appendChild(a.createElement("div")); At.optgroup = At.option, At.tbody = At.tfoot = At.colgroup = At.caption = At.thead, At.th = At.td, x.fn.extend({ text: function (e) { return x.access(this, function (e) { return e === t ? x.text(this) : this.empty().append((this[0] && this[0].ownerDocument || a).createTextNode(e)) }, null, e, arguments.length) }, append: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = Lt(this, e); t.appendChild(e) } }) }, prepend: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = Lt(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, remove: function (e, t) { var n, r = e ? x.filter(e, this) : this, i = 0; for (; null != (n = r[i]) ; i++) t || 1 !== n.nodeType || x.cleanData(Ft(n)), n.parentNode && (t && x.contains(n.ownerDocument, n) && _t(Ft(n, "script")), n.parentNode.removeChild(n)); return this }, empty: function () { var e, t = 0; for (; null != (e = this[t]) ; t++) { 1 === e.nodeType && x.cleanData(Ft(e, !1)); while (e.firstChild) e.removeChild(e.firstChild); e.options && x.nodeName(e, "select") && (e.options.length = 0) } return this }, clone: function (e, t) { return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () { return x.clone(this, e, t) }) }, html: function (e) { return x.access(this, function (e) { var n = this[0] || {}, r = 0, i = this.length; if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(gt, "") : t; if (!("string" != typeof e || Tt.test(e) || !x.support.htmlSerialize && mt.test(e) || !x.support.leadingWhitespace && yt.test(e) || At[(bt.exec(e) || ["", ""])[1].toLowerCase()])) { e = e.replace(vt, "<$1>"); try { for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (x.cleanData(Ft(n, !1)), n.innerHTML = e); n = 0 } catch (o) { } } n && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var e = x.map(this, function (e) { return [e.nextSibling, e.parentNode] }), t = 0; return this.domManip(arguments, function (n) { var r = e[t++], i = e[t++]; i && (r && r.parentNode !== i && (r = this.nextSibling), x(this).remove(), i.insertBefore(n, r)) }, !0), t ? this : this.remove() }, detach: function (e) { return this.remove(e, !0) }, domManip: function (e, t, n) { e = d.apply([], e); var r, i, o, a, s, l, u = 0, c = this.length, p = this, f = c - 1, h = e[0], g = x.isFunction(h); if (g || !(1 >= c || "string" != typeof h || x.support.checkClone) && Nt.test(h)) return this.each(function (r) { var i = p.eq(r); g && (e[0] = h.call(this, r, i.html())), i.domManip(e, t, n) }); if (c && (l = x.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = l.firstChild, 1 === l.childNodes.length && (l = r), r)) { for (a = x.map(Ft(l, "script"), Ht), o = a.length; c > u; u++) i = l, u !== f && (i = x.clone(i, !0, !0), o && x.merge(a, Ft(i, "script"))), t.call(this[u], i, u); if (o) for (s = a[a.length - 1].ownerDocument, x.map(a, qt), u = 0; o > u; u++) i = a[u], kt.test(i.type || "") && !x._data(i, "globalEval") && x.contains(s, i) && (i.src ? x._evalUrl(i.src) : x.globalEval((i.text || i.textContent || i.innerHTML || "").replace(St, ""))); l = r = null } return this } }); function Lt(e, t) { return x.nodeName(e, "table") && x.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e } function Ht(e) { return e.type = (null !== x.find.attr(e, "type")) + "/" + e.type, e } function qt(e) { var t = Et.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function _t(e, t) { var n, r = 0; for (; null != (n = e[r]) ; r++) x._data(n, "globalEval", !t || x._data(t[r], "globalEval")) } function Mt(e, t) { if (1 === t.nodeType && x.hasData(e)) { var n, r, i, o = x._data(e), a = x._data(t, o), s = o.events; if (s) { delete a.handle, a.events = {}; for (n in s) for (r = 0, i = s[n].length; i > r; r++) x.event.add(t, n, s[n][r]) } a.data && (a.data = x.extend({}, a.data)) } } function Ot(e, t) { var n, r, i; if (1 === t.nodeType) { if (n = t.nodeName.toLowerCase(), !x.support.noCloneEvent && t[x.expando]) { i = x._data(t); for (r in i.events) x.removeEvent(t, r, i.handle); t.removeAttribute(x.expando) } "script" === n && t.text !== e.text ? (Ht(t).text = e.text, qt(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), x.support.html5Clone && e.innerHTML && !x.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && Ct.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue) } } x.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, t) { x.fn[e] = function (e) { var n, r = 0, i = [], o = x(e), a = o.length - 1; for (; a >= r; r++) n = r === a ? this : this.clone(!0), x(o[r])[t](n), h.apply(i, n.get()); return this.pushStack(i) } }); function Ft(e, n) { var r, o, a = 0, s = typeof e.getElementsByTagName !== i ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== i ? e.querySelectorAll(n || "*") : t; if (!s) for (s = [], r = e.childNodes || e; null != (o = r[a]) ; a++) !n || x.nodeName(o, n) ? s.push(o) : x.merge(s, Ft(o, n)); return n === t || n && x.nodeName(e, n) ? x.merge([e], s) : s } function Bt(e) { Ct.test(e.type) && (e.defaultChecked = e.checked) } x.extend({ - clone: function (e, t, n) { var r, i, o, a, s, l = x.contains(e.ownerDocument, e); if (x.support.html5Clone || x.isXMLDoc(e) || !mt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (Dt.innerHTML = e.outerHTML, Dt.removeChild(o = Dt.firstChild)), !(x.support.noCloneEvent && x.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || x.isXMLDoc(e))) for (r = Ft(o), s = Ft(e), a = 0; null != (i = s[a]) ; ++a) r[a] && Ot(i, r[a]); if (t) if (n) for (s = s || Ft(e), r = r || Ft(o), a = 0; null != (i = s[a]) ; a++) Mt(i, r[a]); else Mt(e, o); return r = Ft(o, "script"), r.length > 0 && _t(r, !l && Ft(e, "script")), r = s = i = null, o }, buildFragment: function (e, t, n, r) { var i, o, a, s, l, u, c, p = e.length, f = dt(t), d = [], h = 0; for (; p > h; h++) if (o = e[h], o || 0 === o) if ("object" === x.type(o)) x.merge(d, o.nodeType ? [o] : o); else if (wt.test(o)) { s = s || f.appendChild(t.createElement("div")), l = (bt.exec(o) || ["", ""])[1].toLowerCase(), c = At[l] || At._default, s.innerHTML = c[1] + o.replace(vt, "<$1>") + c[2], i = c[0]; while (i--) s = s.lastChild; if (!x.support.leadingWhitespace && yt.test(o) && d.push(t.createTextNode(yt.exec(o)[0])), !x.support.tbody) { o = "table" !== l || xt.test(o) ? "" !== c[1] || xt.test(o) ? 0 : s : s.firstChild, i = o && o.childNodes.length; while (i--) x.nodeName(u = o.childNodes[i], "tbody") && !u.childNodes.length && o.removeChild(u) } x.merge(d, s.childNodes), s.textContent = ""; while (s.firstChild) s.removeChild(s.firstChild); s = f.lastChild } else d.push(t.createTextNode(o)); s && f.removeChild(s), x.support.appendChecked || x.grep(Ft(d, "input"), Bt), h = 0; while (o = d[h++]) if ((!r || -1 === x.inArray(o, r)) && (a = x.contains(o.ownerDocument, o), s = Ft(f.appendChild(o), "script"), a && _t(s), n)) { i = 0; while (o = s[i++]) kt.test(o.type || "") && n.push(o) } return s = null, f }, cleanData: function (e, t) { - var n, r, o, a, s = 0, l = x.expando, u = x.cache, c = x.support.deleteExpando, f = x.event.special; for (; null != (n = e[s]) ; s++) if ((t || x.acceptData(n)) && (o = n[l], a = o && u[o])) { - if (a.events) for (r in a.events) f[r] ? x.event.remove(n, r) : x.removeEvent(n, r, a.handle); - u[o] && (delete u[o], c ? delete n[l] : typeof n.removeAttribute !== i ? n.removeAttribute(l) : n[l] = null, p.push(o)) - } - }, _evalUrl: function (e) { return x.ajax({ url: e, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) } - }), x.fn.extend({ wrapAll: function (e) { if (x.isFunction(e)) return this.each(function (t) { x(this).wrapAll(e.call(this, t)) }); if (this[0]) { var t = x(e, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstChild && 1 === e.firstChild.nodeType) e = e.firstChild; return e }).append(this) } return this }, wrapInner: function (e) { return x.isFunction(e) ? this.each(function (t) { x(this).wrapInner(e.call(this, t)) }) : this.each(function () { var t = x(this), n = t.contents(); n.length ? n.wrapAll(e) : t.append(e) }) }, wrap: function (e) { var t = x.isFunction(e); return this.each(function (n) { x(this).wrapAll(t ? e.call(this, n) : e) }) }, unwrap: function () { return this.parent().each(function () { x.nodeName(this, "body") || x(this).replaceWith(this.childNodes) }).end() } }); var Pt, Rt, Wt, $t = /alpha\([^)]*\)/i, It = /opacity\s*=\s*([^)]*)/, zt = /^(top|right|bottom|left)$/, Xt = /^(none|table(?!-c[ea]).+)/, Ut = /^margin/, Vt = RegExp("^(" + w + ")(.*)$", "i"), Yt = RegExp("^(" + w + ")(?!px)[a-z%]+$", "i"), Jt = RegExp("^([+-])=(" + w + ")", "i"), Gt = { BODY: "block" }, Qt = { position: "absolute", visibility: "hidden", display: "block" }, Kt = { letterSpacing: 0, fontWeight: 400 }, Zt = ["Top", "Right", "Bottom", "Left"], en = ["Webkit", "O", "Moz", "ms"]; function tn(e, t) { if (t in e) return t; var n = t.charAt(0).toUpperCase() + t.slice(1), r = t, i = en.length; while (i--) if (t = en[i] + n, t in e) return t; return r } function nn(e, t) { return e = t || e, "none" === x.css(e, "display") || !x.contains(e.ownerDocument, e) } function rn(e, t) { var n, r, i, o = [], a = 0, s = e.length; for (; s > a; a++) r = e[a], r.style && (o[a] = x._data(r, "olddisplay"), n = r.style.display, t ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && nn(r) && (o[a] = x._data(r, "olddisplay", ln(r.nodeName)))) : o[a] || (i = nn(r), (n && "none" !== n || !i) && x._data(r, "olddisplay", i ? n : x.css(r, "display")))); for (a = 0; s > a; a++) r = e[a], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[a] || "" : "none")); return e } x.fn.extend({ css: function (e, n) { return x.access(this, function (e, n, r) { var i, o, a = {}, s = 0; if (x.isArray(n)) { for (o = Rt(e), i = n.length; i > s; s++) a[n[s]] = x.css(e, n[s], !1, o); return a } return r !== t ? x.style(e, n, r) : x.css(e, n) }, e, n, arguments.length > 1) }, show: function () { return rn(this, !0) }, hide: function () { return rn(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { nn(this) ? x(this).show() : x(this).hide() }) } }), x.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = Wt(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": x.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (e, n, r, i) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var o, a, s, l = x.camelCase(n), u = e.style; if (n = x.cssProps[l] || (x.cssProps[l] = tn(u, l)), s = x.cssHooks[n] || x.cssHooks[l], r === t) return s && "get" in s && (o = s.get(e, !1, i)) !== t ? o : u[n]; if (a = typeof r, "string" === a && (o = Jt.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(x.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || x.cssNumber[l] || (r += "px"), x.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (u[n] = "inherit"), s && "set" in s && (r = s.set(e, r, i)) === t))) try { u[n] = r } catch (c) { } } }, css: function (e, n, r, i) { var o, a, s, l = x.camelCase(n); return n = x.cssProps[l] || (x.cssProps[l] = tn(e.style, l)), s = x.cssHooks[n] || x.cssHooks[l], s && "get" in s && (a = s.get(e, !0, r)), a === t && (a = Wt(e, n, i)), "normal" === a && n in Kt && (a = Kt[n]), "" === r || r ? (o = parseFloat(a), r === !0 || x.isNumeric(o) ? o || 0 : a) : a } }), e.getComputedStyle ? (Rt = function (t) { return e.getComputedStyle(t, null) }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), l = s ? s.getPropertyValue(n) || s[n] : t, u = e.style; return s && ("" !== l || x.contains(e.ownerDocument, e) || (l = x.style(e, n)), Yt.test(l) && Ut.test(n) && (i = u.width, o = u.minWidth, a = u.maxWidth, u.minWidth = u.maxWidth = u.width = l, l = s.width, u.width = i, u.minWidth = o, u.maxWidth = a)), l }) : a.documentElement.currentStyle && (Rt = function (e) { return e.currentStyle }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), l = s ? s[n] : t, u = e.style; return null == l && u && u[n] && (l = u[n]), Yt.test(l) && !zt.test(n) && (i = u.left, o = e.runtimeStyle, a = o && o.left, a && (o.left = e.currentStyle.left), u.left = "fontSize" === n ? "1em" : l, l = u.pixelLeft + "px", u.left = i, a && (o.left = a)), "" === l ? "auto" : l }); function on(e, t, n) { var r = Vt.exec(t); return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t } function an(e, t, n, r, i) { var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; for (; 4 > o; o += 2) "margin" === n && (a += x.css(e, n + Zt[o], !0, i)), r ? ("content" === n && (a -= x.css(e, "padding" + Zt[o], !0, i)), "margin" !== n && (a -= x.css(e, "border" + Zt[o] + "Width", !0, i))) : (a += x.css(e, "padding" + Zt[o], !0, i), "padding" !== n && (a += x.css(e, "border" + Zt[o] + "Width", !0, i))); return a } function sn(e, t, n) { var r = !0, i = "width" === t ? e.offsetWidth : e.offsetHeight, o = Rt(e), a = x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, o); if (0 >= i || null == i) { if (i = Wt(e, t, o), (0 > i || null == i) && (i = e.style[t]), Yt.test(i)) return i; r = a && (x.support.boxSizingReliable || i === e.style[t]), i = parseFloat(i) || 0 } return i + an(e, t, n || (a ? "border" : "content"), r, o) + "px" } function ln(e) { var t = a, n = Gt[e]; return n || (n = un(e, t), "none" !== n && n || (Pt = (Pt || x("