Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ex401.4.x generally complete
John Gasper committed Sep 21, 2018
1 parent 825023f commit c011b8f
Showing 8 changed files with 939 additions and 83 deletions.
25 changes: 25 additions & 0 deletions ex401/class-files/VisitingScholars.txt
@@ -0,0 +1,25 @@
glee303
jlee308
cbutler313
cwalters316
bbutler317
mwilliams323
jgrady326
ewalters329
aroberts334
mgrady336
gdavis354
hpeterson355
clee357
mwalters363
svales364
sthompson365
iwhite370
sdavis372
aclark373
pmartinez374
anielson378
adavis379
gbutler381
clopez383
apeterson387
52 changes: 49 additions & 3 deletions ex401/data-generator.html
@@ -135,14 +135,18 @@
//Create lists of non-faculty (staff) banner users
makeNonFacultyBannerUsersLists(people);

//Create lists of visiting scholars
makeVisitingScholarsLists(people);

console.log(people);

//Generate Output
var ldif = "";
for (j = 0; j < people.length; j++) {
ldif += formatPersonLdif(people[j], peopleOu);
}
ldif += formatGroupLdif(people, peopleOu);
ldif += formatVpnUsersGroupLdif(people, peopleOu);
ldif += formatCommunityGroupLdif(people, peopleOu);
document.getElementById('ldif').value = ldif;

var sql = "";
@@ -186,7 +190,7 @@
return output + "\n";
}

function formatGroupLdif(people, ou) {
function formatVpnUsersGroupLdif(people, ou) {
var vpnOutput =
"dn: cn=vpn_users,ou=groups,dc=internet2,dc=edu\n" +
"objectClass: groupOfNames\n" +
@@ -202,6 +206,23 @@
return vpnOutput + "\n";
}

function formatCommunityGroupLdif(people, ou) {
var vpnOutput =
"dn: cn=community_members,ou=groups,dc=internet2,dc=edu\n" +
"objectClass: groupOfNames\n" +
"objectClass: top\n" +
"cn: community_members\n"

for (j = 0; j < people.length; j++) {
if (people[j].affiliations.indexOf('community') >= 0 ) {
vpnOutput = vpnOutput + "member: uid=" + people[j].uid + ',' + ou + "\n"
}
}

return vpnOutput + "\n";
}


function sqlHeader() {
return "CREATE TABLE SIS_COURSES (\n" +
" termId varchar(255) NOT NULL,\n" +
@@ -261,7 +282,8 @@

if (person.affiliations[i] == 'staff'
|| person.affiliations[i] == 'faculty'
|| person.affiliations[i] =='student') {
|| person.affiliations[i] =='student'
|| person.affiliations[i] =='community') {
temp = template.replace(/<id>/g, person.idNumber);
temp = temp.replace(/<role>/g, person.affiliations[i]);
output += temp;
@@ -351,6 +373,23 @@
document.getElementById('bannerGsh').value = gshOutput;
}

function makeVisitingScholarsLists(people) {
var csvOutput = "";
var gshOutput = 'addGroup("app:lms:ref", "visiting_scholars", "visiting_scholars");\n';
var sampleCount = 25;

for (i = 300; i < people.length && sampleCount > 0; i++) {
if (people[i].affiliations.indexOf('community') >= 0) {
csvOutput = csvOutput + people[i].uid + "\n";
gshOutput = gshOutput + 'addMember("app:lms:ref:visiting_scholars","' + people[i].uid + '");\n';
sampleCount--;
}
}

document.getElementById('visitingScholarsCsv').value = csvOutput;
document.getElementById('visitingScholarsGsh').value = gshOutput;
}

</script>
</head>

@@ -387,6 +426,13 @@
<p>
Non-faculty Banner Users GSH: <br /><textarea cols="100" rows="15" id="bannerGsh"></textarea> <br />
</p>
<p>
Visiting Scholars Users CSV: <br /><textarea cols="100" rows="15" id="visitingScholarsCsv"></textarea> <br />
</p>
<p>
Visiting Scholars Users GSH: <br /><textarea cols="100" rows="15" id="visitingScholarsGsh"></textarea> <br />
</p>

</body>

</html>
298 changes: 298 additions & 0 deletions ex401/ex401.1.1/container_files/seed-data/sisData.sql

Large diffs are not rendered by default.

0 comments on commit c011b8f

Please sign in to comment.