Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update 201.1 student years to 2022-2025
credman committed Jun 11, 2021
1 parent 9e86ea3 commit a6edf1a
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ex201/ex201.1.1/container_files/seed-data/bootstrap.gsh
@@ -22,7 +22,7 @@ setGroupAttr("etc:studentTermLoader", "grouperLoaderQuery", "select distinct id
// Stub out class groups. These will be filled out by the studentTermLoader
addStem("ref", "student", "student");
def classList = [:]
(2019..2024).each { term ->
(2020..2025).each { term ->
classList[term] = addGroup("ref:student", "class${term}", "class${term}")
}

18 changes: 16 additions & 2 deletions ex201/ex201.1.1/container_files/seed-data/sisData.sql
@@ -3740,9 +3740,23 @@ INSERT INTO HR_PEOPLE_ROLES(id, role) VALUES ('80000999','community');
INSERT INTO HR_PEOPLE(id, surname, givenName) VALUES ('80001000','Davis','Bill');
INSERT INTO HR_PEOPLE_ROLES(id, role) VALUES ('80001000','community');

/* make the original term ranges more relevant to the current year -- October 2020 should have 2019-2024 */
/*
COUNT(*) | TERM
---------+-----
59 | 2018
53 | 2019
55 | 2020
55 | 2021
55 | 2022
61 | 2023
*/

/*
* Make the original term ranges more relevant to the current year -- June 2021 should have 2020-2025 (2021=recent grads, 2025=incoming 1st year).
* Note, also edit the ref group range to 2020..2025 in bootstrap.gsh
*/

ALTER TABLE SIS_STUDENT_TERMS DROP PRIMARY KEY;
UPDATE SIS_STUDENT_TERMS SET term = CONVERT(term, UNSIGNED INTEGER) + 1;
UPDATE SIS_STUDENT_TERMS SET term = CONVERT(term, UNSIGNED INTEGER) + 2;
ALTER TABLE SIS_STUDENT_TERMS ADD PRIMARY KEY (id, term);

8 changes: 4 additions & 4 deletions ex201/ex201.1.end/container_files/seed-data/bootstrap.gsh
@@ -23,17 +23,17 @@ attributeAssign.getAttributeValueDelegate().assignValue("etc:objectTypes:grouper
// addGroup("ref:student", "class2022", "class2022");
// addGroup("ref:student", "class2023", "class2023");

(2021..2024).each { term ->
(2022..2025).each { term ->
addMember("ref:student:students","ref:student:class${term}");
}

//Set expiration out Dec 31, 2020 days
java.util.Calendar cal = Calendar.getInstance();
cal.set(2021, Calendar.MARCH, 31, 17, 0, 0)
cal.set(2021, Calendar.DECEMBER, 31, 17, 0, 0)

addMember("ref:student:students","ref:student:class2020");
addMember("ref:student:students","ref:student:class2021");
group = GroupFinder.findByName(gs, "ref:student:students", true);
subject = GroupFinder.findByName(gs, "ref:student:class2020", true).toSubject();
subject = GroupFinder.findByName(gs, "ref:student:class2021", true).toSubject();
group.addOrEditMember(subject, true, true, null, cal.getTime(), false);

// ex 201.1.2

0 comments on commit a6edf1a

Please sign in to comment.