-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from moshen/master
UW Courses Portlet / Schedule Portlet / Final Grades contrib
- Loading branch information
Showing
153 changed files
with
8,335 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,71 @@ | ||
/.settings | ||
/.project | ||
/.classpath | ||
|
||
#### MAC | ||
.DS_STORE | ||
|
||
|
||
#### Vim | ||
|
||
|
||
*.s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
*~ | ||
|
||
|
||
#### Maven | ||
|
||
|
||
target/ | ||
|
||
|
||
#### Eclipse | ||
|
||
|
||
*.pydevproject | ||
.project | ||
.metadata | ||
bin/** | ||
tmp/** | ||
tmp/**/* | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.classpath | ||
.settings/ | ||
.loadpath | ||
|
||
# External tool builders | ||
.externalToolBuilders/ | ||
|
||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
|
||
# CDT-specific | ||
.cproject | ||
|
||
# PDT-specific | ||
.buildpath | ||
|
||
|
||
#### NetBeans | ||
|
||
|
||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
nbactions.xml | ||
nb-configuration.xml | ||
|
||
|
||
#### IntelliJ | ||
|
||
|
||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...rtlet-api/src/main/java/org/jasig/portlet/courses/util/CourseCompareByDeptAndCatalog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Licensed to Jasig under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work | ||
* for additional information regarding copyright ownership. | ||
* Jasig licenses this file to you 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. | ||
*/ | ||
package org.jasig.portlet.courses.util; | ||
|
||
import java.util.Comparator; | ||
|
||
import org.jasig.portlet.courses.model.xml.personal.Course; | ||
|
||
/** | ||
* Method will sort the Courses in Department Short Decr and Catalog Nbr | ||
* There are lots of Null checks because we are dealing with generated objects | ||
* TODO: Check into AspectJ for adding an Aspect for comparing. | ||
*/ | ||
public class CourseCompareByDeptAndCatalog implements Comparator<Course> { | ||
|
||
@Override | ||
public int compare(Course c1, Course c2) { | ||
//check for null Course objects eliminate possibility of NPE | ||
if((null == c1) && (null == c2)){ return 0;} | ||
if(null == c1){ return -1;} | ||
if(null == c2){ return +1;} | ||
|
||
//Are the Department objects null? | ||
if(c1.getCourseDepartment() == c2.getCourseDepartment()) { | ||
if(c1.getCode() == c2.getCode()) return 0; | ||
if(null == c1.getCode()) return -1; | ||
if(null == c2.getCode()) return +1; | ||
return (c1.getCode().compareTo(c2.getCode())); | ||
} | ||
if(null == c1.getCourseDepartment()) return -1; | ||
if(null == c2.getCourseDepartment()) return +1; | ||
//Check for Department Name null | ||
if(c1.getCourseDepartment().getName() == c2.getCourseDepartment().getName()) { | ||
if(c1.getCode() == c2.getCode()) return 0; | ||
if(null == c1.getCode()) return -1; | ||
if(null == c2.getCode()) return +1; | ||
return (c1.getCode().compareTo(c2.getCode())); | ||
} | ||
if(null == c1.getCourseDepartment().getName()) return -1; | ||
if(null == c2.getCourseDepartment().getName()) return +1; | ||
if(! ( c1.getCourseDepartment().getName().equals((c2.getCourseDepartment().getName())) ) ) { | ||
return (c1.getCourseDepartment().getName().compareTo(c2.getCourseDepartment().getName())); | ||
} | ||
else { | ||
if(c1.getCode() == c2.getCode()) return 0; | ||
if(null == c1.getCode()) return -1; | ||
if(null == c2.getCode()) return +1; | ||
return (c1.getCode().compareTo(c2.getCode())); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../main/java/org/jasig/portlet/courses/util/CourseMeetingCompareByRoomAndStreetAddress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Licensed to Jasig under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work | ||
* for additional information regarding copyright ownership. | ||
* Jasig licenses this file to you 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. | ||
*/ | ||
package org.jasig.portlet.courses.util; | ||
import java.util.Comparator; | ||
import org.jasig.portlet.courses.model.xml.CourseMeeting; | ||
public class CourseMeetingCompareByRoomAndStreetAddress implements | ||
Comparator<CourseMeeting> { | ||
/** | ||
* Method will sort the Courses Meeting Location | ||
*/ | ||
@Override | ||
public int compare(CourseMeeting cm1, CourseMeeting cm2) { | ||
if(cm1 == cm2) return 0; | ||
if(null == cm1) return -1; | ||
if(null == cm2) return +1; | ||
if(cm1.getLocation() == cm2.getLocation()) return 0; | ||
if(null == cm1.getLocation()) return -1; | ||
if(null == cm2.getLocation()) return +1; | ||
if(!(cm1.getLocation().getRoom() == cm2.getLocation().getRoom())) { | ||
if(null == cm1.getLocation().getRoom()) return -1; | ||
if(null == cm2.getLocation().getRoom()) return +1; | ||
return (cm1.getLocation().getRoom().compareTo(cm2.getLocation().getRoom())); | ||
} else { | ||
if(cm1.getLocation().getStreetAddress() == cm2.getLocation().getStreetAddress()) return 0; | ||
if(null == cm1.getLocation().getStreetAddress()) return -1; | ||
if(null == cm2.getLocation().getStreetAddress()) return +1; | ||
return (cm1.getLocation().getStreetAddress().compareTo(cm2.getLocation().getStreetAddress())); | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...portlet-api/src/main/java/org/jasig/portlet/courses/util/CourseSectionCodeComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Licensed to Jasig under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work | ||
* for additional information regarding copyright ownership. | ||
* Jasig licenses this file to you 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. | ||
*/ | ||
package org.jasig.portlet.courses.util; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Comparator; | ||
|
||
import org.jasig.portlet.courses.model.xml.CourseSection; | ||
import org.joda.time.DateTime; | ||
|
||
public class CourseSectionCodeComparator implements Comparator<CourseSection> { | ||
public static final CourseSectionCodeComparator INSTANCE = new CourseSectionCodeComparator(); | ||
|
||
|
||
@Override | ||
public int compare(CourseSection o1, CourseSection o2) { | ||
if (o1 == o2) { | ||
return 0; | ||
} | ||
if (o1 == null) { | ||
return -1; | ||
} | ||
if (o2 == null) { | ||
return 1; | ||
} | ||
|
||
//Code comparison | ||
if(o1.getCode() == o2.getCode()) return 0; | ||
if(null == o1.getCode()) return -1; | ||
if(null == o2.getCode()) return +1; | ||
return o1.getCode().compareTo(o2.getCode()); | ||
} | ||
} |
Oops, something went wrong.