Skip to content

Commit

Permalink
Merge pull request #14 from moshen/master
Browse files Browse the repository at this point in the history
UW Courses Portlet / Schedule Portlet / Final Grades contrib
  • Loading branch information
Tim Levett committed Oct 8, 2014
2 parents 83ed110 + 1287e2f commit a8d87eb
Show file tree
Hide file tree
Showing 153 changed files with 8,335 additions and 714 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
73 changes: 70 additions & 3 deletions .gitignore
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/
25 changes: 4 additions & 21 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ under the License.

This project includes:
AOP alliance under Public Domain
Apache Log4j under The Apache Software License, Version 2.0
Commons Codec under The Apache Software License, Version 2.0
Commons Collections under The Apache Software License, Version 2.0
Commons FileUpload under The Apache Software License, Version 2.0
Commons IO under The Apache Software License, Version 2.0
Commons Lang under The Apache Software License, Version 2.0
Commons Logging under The Apache Software License, Version 2.0
CoursePortlet under Apache License Version 2.0
CoursePortlet - API under Apache License Version 2.0
Expand All @@ -30,50 +29,34 @@ This project includes:
Data Mapper for Jackson under The Apache Software License, Version 2.0
Ehcache Core under The Apache Software License, Version 2.0
Ehcache Web Filters under The Apache Software License, Version 2.0
FindBugs-jsr305 under The Apache Software License, Version 2.0
Guava: Google Core Libraries for Java under The Apache Software License, Version 2.0
Hamcrest Core under New BSD License
Hamcrest Core under BSD style
HttpClient under Apache License
HttpCore under Apache License
Jackson under The Apache Software License, Version 2.0
Java Portlet Specification V2.0 under Commons Development and Distribution License, Version 1.0
JAXB2 Basics - Runtime under BSD-Style License
JCL 1.1.1 implemented over SLF4J under MIT License
Joda time under Apache 2
Joda-Time JSP tags support under Apache 2
jstl under Commons Development and Distribution License, Version 1.0
JUL to SLF4J bridge under MIT License
JUnit under Common Public License Version 1.0
Log4j Implemented Over SLF4J under Apache Software Licenses
Logback Classic Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License
Logback Core Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License
Lang under The Apache Software License, Version 2.0
Mockito under The MIT License
Objenesis under MIT License
Portlet MVC Utilities under Apache License Version 2.0
Portlet Web Service Utilities under Apache License Version 2.0
Resource Server API under Apache License Version 2.0
Resource Server Content under Apache License Version 2.0
Resource Server Core under Apache License Version 2.0
Resource Server Utilities under Apache License Version 2.0
servlet-api under Commons Development and Distribution License, Version 1.0
SLF4J API Module under MIT License
Spring Portlet WebMVC Contributions under Apache License Version 2.0
Spring WS Core under The Apache Software License, Version 2.0
Spring XML under The Apache Software License, Version 2.0
spring-aop under The Apache Software License, Version 2.0
spring-asm under The Apache Software License, Version 2.0
spring-beans under The Apache Software License, Version 2.0
spring-context under The Apache Software License, Version 2.0
spring-context-support under The Apache Software License, Version 2.0
spring-core under The Apache Software License, Version 2.0
spring-expression under The Apache Software License, Version 2.0
spring-jdbc under Apache License, Version 2.0
spring-oxm under The Apache Software License, Version 2.0
spring-test under The Apache Software License, Version 2.0
spring-tx under Apache License, Version 2.0
spring-web under The Apache Software License, Version 2.0
spring-webmvc under The Apache Software License, Version 2.0
spring-webmvc-portlet under The Apache Software License, Version 2.0
standard under Apache License, Version 2.0
Streaming API for XML under Sun Binary Code License
WSDL4J under CPL

5 changes: 0 additions & 5 deletions courses-portlet-api/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ specific language governing permissions and limitations
under the License.

This project includes:
Commons Lang under The Apache Software License, Version 2.0
CoursePortlet - API under Apache License Version 2.0
Hamcrest Core under New BSD License
JAXB2 Basics - Runtime under BSD-Style License
Joda time under Apache 2
JUnit under Common Public License Version 1.0
SLF4J API Module under MIT License

20 changes: 20 additions & 0 deletions courses-portlet-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
Expand Down
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()));
}
}
}
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()));
}
}
}
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());
}
}
Loading

0 comments on commit a8d87eb

Please sign in to comment.