university.batching - Importer Components

Batch processing components for academics objects.

Batch processors eat CSV files to add, update or remove large numbers of certain kinds of objects at once.

Here we define the processors for academics specific objects like faculties, departments and the like.

class waeup.kofa.university.batching.CertificateCourseProcessor[source]

Bases: waeup.kofa.university.batching.FacultyProcessor

The Certificate Course Processor needs more location fields. Certificate courses are stored inside the certificate container. Thus, faculty_code, department_code and the certificate_code are necessary to find the parent container. It furthermore needs the course and the level field to locate existing objects as they are part of the object id (code). Consequently, course and level can’t be updated. If the level has changed, the object must be replaced (removed and re-created), for instance by processing two import files.

__doc__ = "The Certificate Course Processor needs more location fields.\n Certificate courses are stored inside the certificate container.\n Thus, `faculty_code`, `department_code` and the\n `certificate_code` are necessary to find the parent container.\n It furthermore needs the `course` and the `level` field to locate\n existing objects as they are part of the object id (code).\n Consequently, `course` and `level` can't be updated. If the level\n has changed, the object must be replaced (removed and re-created),\n for instance by processing two import files.\n "
__implemented__ = <implementedBy waeup.kofa.university.batching.CertificateCourseProcessor>
__module__ = 'waeup.kofa.university.batching'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addEntry(obj, row, site)[source]
delEntry(row, site)[source]
entryExists(row, site)[source]
factory_name = 'waeup.CertificateCourse'
getEntry(row, site)[source]
getParent(row, site)[source]
iface = <InterfaceClass waeup.kofa.university.interfaces.ICertificateCourse>
location_fields = ['certificate_code', 'course', 'level', 'faculty_code', 'department_code']
mode = None
name = u'CertificateCourse Processor'
parentsExist(row, site)[source]
util_name = 'certificatecourseprocessor'
class waeup.kofa.university.batching.CertificateProcessor[source]

Bases: waeup.kofa.university.batching.FacultyProcessor

The Certificate Processor gets the parent object (the certificates attribute of the department container) in two ways. If both faculty and department codes are provided, getPartents uses these to locate the certificate. If department code or faculty code are missing, it use the certificates catalog to find the certificate.

__doc__ = 'The Certificate Processor gets the parent object (the\n `certificates` attribute of the department container) in two ways.\n If both faculty and department codes are provided, `getPartents` uses\n these to locate the certificate. If department code or\n faculty code are missing, it use the certificates catalog to find the\n certificate.\n '
__implemented__ = <implementedBy waeup.kofa.university.batching.CertificateProcessor>
__module__ = 'waeup.kofa.university.batching'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addEntry(obj, row, site)[source]
allowed_roles = ['waeup.local.CourseAdviser100', 'waeup.local.CourseAdviser200', 'waeup.local.CourseAdviser300', 'waeup.local.CourseAdviser400', 'waeup.local.CourseAdviser500', 'waeup.local.CourseAdviser600', 'waeup.local.CourseAdviser700', 'waeup.local.CourseAdviser800', 'waeup.local.DepartmentOfficer', 'waeup.local.ClearanceOfficer']
available_fields
checkHeaders(headerfields, mode='create')[source]
delEntry(row, site)[source]
entryExists(row, site)[source]
factory_name = 'waeup.Certificate'
getEntry(row, site)[source]
getParent(row, site)[source]
iface = <InterfaceClass waeup.kofa.university.interfaces.ICertificate>
location_fields = ['code']
mode = None
name = u'Certificate Processor'
parentsExist(row, site)[source]
util_name = 'certificateprocessor'
class waeup.kofa.university.batching.CourseProcessor[source]

Bases: waeup.kofa.university.batching.CertificateProcessor

The Course Processor works exactly in the same way as the Certificate Processor. It uses the courses catalog instead of the certificates catalog.

__doc__ = 'The Course Processor works exactly in the same way as the\n Certificate Processor. It uses the courses catalog instead of the\n certificates catalog.\n '
__implemented__ = <implementedBy waeup.kofa.university.batching.CourseProcessor>
__module__ = 'waeup.kofa.university.batching'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addEntry(obj, row, site)[source]
allowed_roles = ['waeup.local.Lecturer']
factory_name = 'waeup.Course'
getParent(row, site)[source]
iface = <InterfaceClass waeup.kofa.university.interfaces.ICourse>
location_fields = ['code']
mode = None
name = u'Course Processor'
util_name = 'courseprocessor'
class waeup.kofa.university.batching.DepartmentProcessor[source]

Bases: waeup.kofa.university.batching.FacultyProcessor

The Department Processor works in the same way as the Faculty Processor. Since department codes are not necessarily unique, it needs the faculty_code to create and update objects.

__doc__ = 'The Department Processor works in the same way as the Faculty\n Processor. Since department codes are not necessarily unique, it needs the\n `faculty_code` to create and update objects.\n '
__implemented__ = <implementedBy waeup.kofa.university.batching.DepartmentProcessor>
__module__ = 'waeup.kofa.university.batching'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addEntry(obj, row, site)[source]
allowed_roles = ['waeup.local.ApplicationsManager', 'waeup.local.DepartmentOfficer', 'waeup.local.DepartmentManager', 'waeup.local.ClearanceOfficer', 'waeup.local.UGClearanceOfficer', 'waeup.local.PGClearanceOfficer', 'waeup.local.ReportsOfficer', 'waeup.local.CourseAdviser100', 'waeup.local.CourseAdviser200', 'waeup.local.CourseAdviser300', 'waeup.local.CourseAdviser400', 'waeup.local.CourseAdviser500', 'waeup.local.CourseAdviser600', 'waeup.local.CourseAdviser700', 'waeup.local.CourseAdviser800', 'waeup.local.LocalStudentsManager', 'waeup.local.Lecturer']
delEntry(row, site)[source]
entryExists(row, site)[source]
factory_name = 'waeup.Department'
getEntry(row, site)[source]
getParent(row, site)[source]
iface = <InterfaceClass waeup.kofa.university.interfaces.IDepartment>
location_fields = ['code', 'faculty_code']
mode = None
name = u'Department Processor'
parentsExist(row, site)[source]
util_name = 'departmentprocessor'
class waeup.kofa.university.batching.FacultyProcessor[source]

Bases: waeup.kofa.utils.batching.BatchProcessor

The Faculty Processor processes faculties in the faculties container. The FacultyProcessor class also serves as a baseclass for all other batch processors in the academic section.

The processor makes some efforts to set local roles. If new roles are provided, the updateEntry method first removes all existing roles and then sets the new roles as given in the import file. That means the entire set of local roles is replaced.

__doc__ = 'The Faculty Processor processes faculties in the `faculties` container.\n The `FacultyProcessor` class also serves as a baseclass for all other \n batch processors in the academic section.\n\n The processor makes some efforts to set local roles.\n If new roles are provided, the `updateEntry` method first removes\n all existing roles and then sets the new roles as given in the import\n file. That means the entire set of local roles is replaced.\n '
__implemented__ = <implementedBy waeup.kofa.university.batching.FacultyProcessor>
__module__ = 'waeup.kofa.university.batching'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addEntry(obj, row, site)[source]
allowed_roles = ['waeup.local.DepartmentOfficer', 'waeup.local.DepartmentManager', 'waeup.local.ClearanceOfficer', 'waeup.local.UGClearanceOfficer', 'waeup.local.PGClearanceOfficer', 'waeup.local.CourseAdviser100', 'waeup.local.CourseAdviser200', 'waeup.local.CourseAdviser300', 'waeup.local.CourseAdviser400', 'waeup.local.CourseAdviser500', 'waeup.local.CourseAdviser600', 'waeup.local.CourseAdviser700', 'waeup.local.CourseAdviser800', 'waeup.local.LocalStudentsManager', 'waeup.local.LocalWorkflowManager', 'waeup.local.TranscriptOfficer', 'waeup.local.TranscriptSignee']
available_fields
checkConversion(row, mode='create')[source]

Validates all values in row.

delEntry(row, site)[source]
entryExists(row, site)[source]
factory_name = 'waeup.Faculty'
getEntry(row, site)[source]
getParent(row, site)[source]
iface = <InterfaceClass waeup.kofa.university.interfaces.IFaculty>
location_fields = ['code']
mode = None
name = u'Faculty Processor'
parentsExist(row, site)[source]
updateEntry(obj, row, site, filename)[source]

Update obj to the values given in row.

util_name = 'facultyprocessor'