Class UCSBCurriculumService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUCSBCurriculumService
(org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder) -
Method Summary
Modifier and TypeMethodDescriptiongetAllSections
(String enrollCode, String quarter) This method retrieves all of the sections related to a certain enroll code.getConvertedSections
(String subjectArea, String quarter, String courseLevel) getFinalsInfo
(String quarter, String enrollCd) getJSONbyQtrEnrollCd
(String quarter, String enrollCd) getPrimaries
(String subjectArea, String quarter, String courseLevel) This method retrieves course information and reformats it so that each primary is a single object, that has a list of all of it's secondaries.getRequirementCodesByCollege
(String collegeCode) getSection
(String enrollCode, String quarter) This method retrieves exactly one section matching the enrollCode and quarter arguments, if such a section exists.getSectionJSON
(String subjectArea, String quarter, String courseLevel)
-
Field Details
-
CURRICULUM_ENDPOINT
- See Also:
-
SUBJECTS_ENDPOINT
- See Also:
-
SECTION_ENDPOINT
- See Also:
-
ALL_SECTIONS_ENDPOINT
- See Also:
-
FINALS_ENDPOINT
- See Also:
-
GE_ENDPOINT
- See Also:
-
-
Constructor Details
-
Method Details
-
getJSON
- Throws:
Exception
-
getConvertedSections
public List<ConvertedSection> getConvertedSections(String subjectArea, String quarter, String courseLevel) throws Exception - Throws:
Exception
-
getPrimaries
public List<Primary> getPrimaries(String subjectArea, String quarter, String courseLevel) throws Exception This method retrieves course information and reformats it so that each primary is a single object, that has a list of all of it's secondaries.As a reminder, the UCSB course registration systems (GOLD, Blue, Star, etc.) treat all courses as "sections", even what we typically call "lectures". In the database, some courses have both primary and secondary sections. Primary sections have section numbers ending in 00 (e.g. 100, 200, 300, up to 9900), while secondaries have numbers ending with 01, 02, 03, etc. and "belong" with a primary.
What we typically refer to as "lectures" are primary sections ending in 00 (e.g. 100, 200, 300). What we typically refer to as discussion sections are secondaries and end with 01, 02, 03, etc.
The UCSB API almost does this, but not quite. It returns a list of all sections, but does not group them into primaries and secondaries. This method relies on the
getPrimaries
method of thePage
class to reformat the data so that each primary section is a single object, with a list of all of its secondaries.- Parameters:
subjectArea
-quarter
-courseLevel
-- Returns:
- a list of Primaries
- Throws:
Exception
-
getSectionJSON
public String getSectionJSON(String subjectArea, String quarter, String courseLevel) throws Exception - Throws:
Exception
-
getSubjectsJSON
- Throws:
Exception
-
getSection
This method retrieves exactly one section matching the enrollCode and quarter arguments, if such a section exists.- Throws:
Exception
-
getAllSections
This method retrieves all of the sections related to a certain enroll code. For example, if the enrollCode is for a discussion section, the lecture section and all related discussion sections will also be returned.- Throws:
Exception
-
getJSONbyQtrEnrollCd
- Throws:
Exception
-
getFinalsInfo
- Throws:
Exception
-
getGeneralEducationInfo
- Throws:
Exception
-
getRequirementCodesByCollege
- Throws:
Exception
-