Bug 41471 - Support for multi-value attributes
Support for multi-value attributes
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on: 41239
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-06 11:53 CEST by Jan Christoph Ebersbach
Modified: 2016-09-30 12:43 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Christoph Ebersbach univentionstaff 2016-06-06 11:53:02 CEST
As far as I understand the source code, there is currently no support for multi-value fields in ucs@school-import-tool.  For example, a user might have multiple e-mail addresses, a general one user@schools.example.org and multiple specific addresses like user@first-school.example.org.  This should be supported by ucs@school-import-tool.
Comment 1 Daniel Tröder univentionstaff 2016-06-07 15:08:33 CEST
Support for multi-value fields can be added. All it needs is a delimiter... configurable... default is comma which is already used in mutli-value fields "schools" and "classes"...
Adaptions will have to be done in ImportUser.prepare_udm_properties() and maybe in ImportUser.make_email().

I suggest to add the following configuration keys:

"delimiter": {
    "default":  str [2]: multi-value field separator symbol, default
    "phone":    str [3]: multi-value field separator symbol, for column 'phone'
    ...
}
Comment 2 Daniel Tröder univentionstaff 2016-06-08 15:26:02 CEST
Implemented in r69960.

Input mapping to a UDM attribute whos property_descriptions say it's a multivalue, is now split into a list by character in the configuration "csv/incell-delimiter". The value can vary for each attribute as described above.


"schule1,gsmitte","Anton","Meyer","1A","anton1@nstx.local","Dies ist ein Schüler","123-456,789-012"


dn: uid=A.14Meyer,cn=schueler,cn=users,ou=gsmitte,dc=uni,dc=dtr
ucsschoolRecordUID: Anton-Meyer-anton1@nstx.local
ucsschoolSchool: gsmitte
ucsschoolSchool: schule1
ucsschoolSourceUID: LegacyDB
description:: RGllcyBpc3QgZWluIFNjaMO8bGVy
telephoneNumber: 123-456
telephoneNumber: 789-012


Not directly related: A configuration option for the CSV-column-delimiter was added: "csv/delimiter".
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2016-06-15 21:56:52 CEST
34_import-users_via_cli_v2 now tests with csv:incell-delimiter:default=';' and mailAlternativeAddress.

ucs-test-ucsschool (3.0.12-5):
r70237 | Bug #41471: added test for multi value fields in 34_import-users_via_cli_v2

→ Verified
Comment 4 Florian Best univentionstaff 2016-06-28 18:24:55 CEST
UCS@school 4.1 R2 has been released:
http://docs.software-univention.de/release-notes-ucsschool-4.1R2v1-de.pdf

If this error occurs again, please use "Clone This Bug".