Skip to content

Commit

Permalink
Merge pull request #103 from Ed-Fi-Exchange-OSS/license-headers
Browse files Browse the repository at this point in the history
License headers
  • Loading branch information
nsd-juanignacio authored Oct 5, 2023
2 parents 670c209 + bf58a99 commit fe0dc02
Show file tree
Hide file tree
Showing 225 changed files with 1,793 additions and 527 deletions.
52 changes: 52 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# http://editorconfig.org
root = true

[*]
indent_style=space
indent_size=4
tab_width=2
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 110

[*.yml]
indent_size=2

[**.min.js]
# Minified JavaScript files shouldn't be changed
indent_style = ignore
insert_final_newline = ignore

[*.md]
trim_trailing_whitespace = false

[*.{cs,cshtml,csx}]
end_of_line = crlf
# ReSharper inspection severities
resharper_arrange_redundant_parentheses_highlighting=hint
resharper_arrange_this_qualifier_highlighting=hint
resharper_arrange_type_member_modifiers_highlighting=hint
resharper_arrange_type_modifiers_highlighting=hint
resharper_built_in_type_reference_style_for_member_access_highlighting=hint
resharper_built_in_type_reference_style_highlighting=hint
resharper_redundant_base_qualifier_highlighting=warning
resharper_suggest_var_or_type_built_in_types_highlighting=hint
resharper_suggest_var_or_type_elsewhere_highlighting=hint
resharper_suggest_var_or_type_simple_types_highlighting=hint
# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers=false
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
csharp_style_var_elsewhere=true:suggestion
csharp_style_var_for_built_in_types=true:suggestion
csharp_style_var_when_type_is_apparent=true:suggestion
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none
dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion
dotnet_style_predefined_type_for_member_access=true:suggestion
dotnet_style_qualification_for_event=false:suggestion
dotnet_style_qualification_for_field=false:suggestion
dotnet_style_qualification_for_method=false:suggestion
dotnet_style_qualification_for_property=false:suggestion
dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ fabric.properties
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/settings.json
*.code-workspace

### VisualStudioCode Patch ###
Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"psioniq.psi-header",
"EditorConfig.EditorConfig",
"ms-dotnettools.csharp",
"ms-vscode.powershell",
"streetsidesoftware.code-spell-checker"
]
}
74 changes: 74 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"files.associations": {
"*.metaed": "csharp"
},
"psi-header.config": {
"forceToTop": true,
"blankLinesAfter": 1,
"license": "Custom"
},
"psi-header.templates": [
{
"language": "*",
"template": [
"SPDX-License-Identifier: Apache-2.0",
"Licensed to the Ed-Fi Alliance under one or more agreements.",
"The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.",
"See the LICENSE and NOTICES files in the project root for more information."
]
}
],
"psi-header.lang-config":[
{
"_": "Apply double slash-based comments",
"language": "csharp",
"begin": "",
"end": "",
"prefix": "// "
},
{
"language": "javascript",
"mapTo": "csharp"
},
{
"language": "typescript",
"mapTo": "csharp"
},
{
"language": "metaed",
"mapTo": "csharp"
},
{
"_": "Apply hash-based comments",
"language": "python",
"begin": "",
"end": "",
"prefix": "# "
},
{
"language": "powershell",
"mapTo": "python"
},
{
"language": "dockerfile",
"mapTo": "python"
},
{
"_": "Apply double dash-based comments",
"language": "sql",
"begin": "",
"end": "",
"prefix": "-- "
},
{
"language": "yaml",
"mapTo": "python"
}
],
"psi-header.changes-tracking": {
"autoHeader": "autoSave",
"exclude": [
"css", "json", "xml", "config", "plaintext", "markdown", "batch"
]
}
}
9 changes: 7 additions & 2 deletions ImportData.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

# Configuration: Set appopriate values
$Config = @{
V1Files = [PSCustomObject]@{
Expand Down Expand Up @@ -50,7 +55,7 @@ function SetupPS() {
function CleanPS() {
if ( $PSVersionTable.PSVersion.Major -ge 7)
{
$PSStyle.Progress.View = $script:currentStyle
$PSStyle.Progress.View = $script:currentStyle
}
}

Expand All @@ -68,4 +73,4 @@ function Main {
#CleanPS
}

Main
Main
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

$ModuleVersion = '1.0.0'
$Description = 'Module with basic functions to import data using the ED-FI API'
#$FunctionsToExport = 'NLoad', 'NPost', 'Tap', 'ShowProggress', 'AddToErrorFile'
Expand Down
15 changes: 10 additions & 5 deletions ImportDataModules/ImportDataGarlandV0/ImportDataGarlandV0.psm1
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

using module ..\ImportDataBasicFunctions\ImportDataBasicFunctions.psm1

$ModuleVersion = '1.0.0'
Expand Down Expand Up @@ -392,7 +397,7 @@ function TransformEvaluationElementRating {
PerformanceEvaluationTitle = $PerformanceEvaluationTitle
PerformanceEvaluationTypeDescriptor = $PerformanceEvaluationTypeDescriptor
SchoolYear = $SchoolYear
TermDescriptor = $TermDescriptor
TermDescriptor = $TermDescriptor
}
EvaluationObjectiveRatingReference = [PSCustomObject]@{
EducationOrganizationId = $LocalEducationAgencyId
Expand All @@ -405,7 +410,7 @@ function TransformEvaluationElementRating {
PersonId = [System.Security.SecurityElement]::Escape($_.StaffUniqueId).Trim()
SchoolYear = $SchoolYear
SourceSystemDescriptor = $SourceSystemDescriptor
TermDescriptor = $TermDescriptor
TermDescriptor = $TermDescriptor
}
EvaluationElementRatingLevelDescriptor = "uri://tpdm.ed-fi.org/EvaluationElementRatingLevelDescriptor#$ratingResultTitle"
Results = (,[PSCustomObject]@{
Expand Down Expand Up @@ -495,12 +500,12 @@ Function Import-EdDataTPESS($Config, $PreviousResults) {
TransformTPESS |
Where-Object { -not $staffUniqueIdWithError.ContainsKey( (GetPersonId $_)) } |
NPost -Config $Config |
Tap -ScriptBlock { if($args[0] -is [ImportError]){ $staffUniqueIdWithError[(GetPersonId $args[0].Record)] = $true } }|
Tap -ScriptBlock { if($args[0] -is [ImportError]){ $staffUniqueIdWithError[(GetPersonId $args[0].Record)] = $true } }|
WriteToFileIfImportError -FilePath $Config.V0Files.Errors |
CountResults -InitialValues $PreviousResults |
ShowProggress -Activity "Importing data from $($Config.V0Files.TPESS)" |
Select-Object -Last 1

return $res
}

Expand All @@ -519,4 +524,4 @@ Function Import-EdData($Config) {
return $res
}

Export-ModuleMember -Function Import-EdData
Export-ModuleMember -Function Import-EdData
39 changes: 22 additions & 17 deletions ImportDataModules/ImportDataGarlandV1/ImportDataGarlandV1.psm1
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

using module ..\ImportDataBasicFunctions\ImportDataBasicFunctions.psm1

$ModuleVersion = '1.0.0'
Expand Down Expand Up @@ -42,7 +47,7 @@ function TransformSchool {
InstitutionTelephones = $institutionTelephones
SchoolCategories = (, [PSCustomObject]@{ SchoolCategoryDescriptor = "uri://ed-fi.org/SchoolCategoryDescriptor#" + [System.Security.SecurityElement]::Escape($_.SchoolCategory) })
GradeLevels = $gradeLevels
}
}
}
}

Expand Down Expand Up @@ -90,7 +95,7 @@ function TransformStaff() {
YearsOfPriorProfessionalExperience = [int][System.Security.SecurityElement]::Escape($_.YearsOfProfessionalExperience)
Email = [System.Security.SecurityElement]::Escape($_.Email)
Address = $address
}
}
}
}

Expand All @@ -99,7 +104,7 @@ function TransformStaffEducationOrganizationAssignmentAssociations($staffClassif
$staffUniqueId = [System.Security.SecurityElement]::Escape($_.StaffUniqueId).Trim()
$staffClassification = $staffClassificationMap[$staffUniqueId]

$staffClassificationDescriptor = if( ![String]::IsNullOrWhiteSpace($staffClassification)){
$staffClassificationDescriptor = if( ![String]::IsNullOrWhiteSpace($staffClassification)){
"uri://ed-fi.org/StaffClassificationDescriptor#$staffClassification"
} else { $null}

Expand All @@ -110,34 +115,34 @@ function TransformStaffEducationOrganizationAssignmentAssociations($staffClassif
EndDate = if($_.EndDate){([System.Security.SecurityElement]::Escape($_.EndDate) | Get-Date -Format 'yyyy-MM-dd')} else { $null }
PositionTitle = [System.Security.SecurityElement]::Escape($_.PositionTitle)
StaffClassificationDescriptor = $staffClassificationDescriptor # Missing in StaffOrgAssignSourceFle, found in StaffSourceFle
}
}
}
}

function Load-User() {
function Load-User() {
Write-Host "Working file '" $Config.UsersSourceFle "'"
$dataJSON = (
Import-Csv $Config.UsersSourceFle -Header StaffUSI, DistrictId , FirstName, MiddleName, LastName, Email,
SexDescriptor, StaffClassification, IsSupportStaff | Select-Object -Skip 1
Import-Csv $Config.UsersSourceFle -Header StaffUSI, DistrictId , FirstName, MiddleName, LastName, Email,
SexDescriptor, StaffClassification, IsSupportStaff | Select-Object -Skip 1
)
return $dataJSON
}

Function Import-EdData($Config) {
$SchoolFileHeaders = 'SchoolId', 'DistrictId', 'NameOfInstitution', 'ShortnameOfInstitution',
$SchoolFileHeaders = 'SchoolId', 'DistrictId', 'NameOfInstitution', 'ShortnameOfInstitution',
'SchoolCategory', 'AddressStreet', 'AddressCity', 'AddressZipCode', 'PhoneNumber'
$StaffFileHeaders = 'StaffUSI', 'StaffUniqueId', 'FirstName', 'MiddleName', 'LastSurname', 'StaffClassification',
'YearsOfProfessionalExperience', 'BirthDate', 'SexDescriptor', 'RaceDescriptor',
'Email', 'StateAbbreviationDescriptor', 'City', 'PostalCode'
$StaffOrgAssignFileHeaders = 'StaffUniqueId', 'SchoolId', 'PositionTitle', 'BeginDate', 'EndDate', 'SeparationReasonDescriptor'
$StaffFileHeaders = 'StaffUSI', 'StaffUniqueId', 'FirstName', 'MiddleName', 'LastSurname', 'StaffClassification',
'YearsOfProfessionalExperience', 'BirthDate', 'SexDescriptor', 'RaceDescriptor',
'Email', 'StateAbbreviationDescriptor', 'City', 'PostalCode'
$StaffOrgAssignFileHeaders = 'StaffUniqueId', 'SchoolId', 'PositionTitle', 'BeginDate', 'EndDate', 'SeparationReasonDescriptor'

Set-Content -Path $Config.ErrorsOutputFile -Value "$(Get-Date -Format 'yyyy-MM-ddTHH:mm:ss')"

Add-Content -Path $Config.ErrorsOutputFile -Value "`r`n$($Config.SchoolSourceFile)`r`n"

Write-Progress -Activity "Importing data from $($Config.SchoolSourceFile)" -PercentComplete -1

$res = NLoad $SchoolFileHeaders $Config.SchoolSourceFile |
$res = NLoad $SchoolFileHeaders $Config.SchoolSourceFile |
TransformSchool |
NPost -Config $Config |
WriteToFileIfImportError -FilePath $Config.ErrorsOutputFile |
Expand All @@ -149,9 +154,9 @@ Function Import-EdData($Config) {

Add-Content -Path $Config.ErrorsOutputFile -Value "`r`n$($Config.StaffSourceFile)`r`n"
$StaffClassificationMap = @{}
$res = NLoad $StaffFileHeaders $Config.StaffSourceFile |
Tap -ScriptBlock { $StaffClassificationMap[[System.Security.SecurityElement]::Escape($args.StaffUniqueId)] = [System.Security.SecurityElement]::Escape($args.StaffClassification).Trim() } |
TransformStaff |
$res = NLoad $StaffFileHeaders $Config.StaffSourceFile |
Tap -ScriptBlock { $StaffClassificationMap[[System.Security.SecurityElement]::Escape($args.StaffUniqueId)] = [System.Security.SecurityElement]::Escape($args.StaffClassification).Trim() } |
TransformStaff |
NPost -Config $Config |
WriteToFileIfImportError -FilePath $Config.ErrorsOutputFile |
CountResults -InitialValues $res |
Expand All @@ -170,4 +175,4 @@ Function Import-EdData($Config) {
return $res
}

Export-ModuleMember -Function Import-EdData
Export-ModuleMember -Function Import-EdData
24 changes: 0 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,27 +175,3 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading

0 comments on commit fe0dc02

Please sign in to comment.