Current Import Process
RadGrad administrators can use the Manage Internships page to import internships from InterAloha.
The 'Delete Internships' button removes all the currently defined internship documents.
The 'Upload Internships' button starts the process of getting the internships from InternAloha.
- We increment the missed upload count for each defined internship. (This might be obsolete)
- We start the process of getting the internships by calling
processInternAlohaInternships
.processInternAlohaInternships
is located inimports/api/internship/import/process-canonical.ts
.- We get all the internships by looping over the internAlohaUrls in
settings.ics.development.json
file. - We then loop over all the internships:
- removing any HTML from the description
- adding interests based upon the Interest Keyword mappings. See the
imports/api/interest/InterestKeywordCollection.ts
. - updating the internship location.
- Then we filter out any internships without any interests.
- Then we collapse the duplicate internships we find from different sites into a single internship with multiple URLs.
- We then add a GUID to the internship. Our GUIDs are of the format
internship-${internship.company}_${internship.position}_${internship.description.length}
. This might be redundant because theInternship.define
method ignores the GUID. - Then we create a map
interestsMap
of Interest slugs to array of internships with that interest. - We loop until we get the
Meteor.settings.public.internshipCountLimit.import
internships.- In the loop we loop over each of the interests in
interestsMap
adding the first internship to the list of internships. We ignore duplicates and if we've used all the internships for an interest we move on to the next interest.
- In the loop we loop over each of the interests in
- We get all the internships by looping over the internAlohaUrls in
- We set the list of internships to define to the results.
The 'Define Internships' button starts the process of looping over the imported internships and calling defineMethod
for the InternshipCollection. If there are duplicate GUIDs, there will be fewer than Meteor.settings.public.internshipCountLimit.import
defined internships.