Univention Bugzilla – Bug 32407
ucs_registerUDMModule library function
Last modified: 2014-03-20 16:24:19 CET
A function ucs_registerUDMModule schould be implemented in univention-lib which
* takes the name of an existing UDM module file
* creates an univentionUDMModule object in UDM
* saves the given file to the UDM property "univentionUDMModule"
* sets the UDM property "univentionUDMModuleFilename"
* sets some other attributes useful to track creator package and version number.
* The creator package (.deb) and version number is detected automatically.
* The cn schould reflect <basename of the file>_<version number>.
The string <AppID>_<AppVersion> should be stored in an attribute univentionAppIdentifier as tracking reference e.g. for Bug 32418.
ucs_unregisterUDMModule is also required (e.g. for unjoinscripts), to remove the object in case no App is registered any longer for it.
Implemented in shell-univention-lib, first used in univention-management-console-module-appcenter. Changelog comitted.
Now merged into more general functions:
ucs_registerLDAPExtension "$@" --udm_module <filename>
ucs_unregisterLDAPExtension "$@" --udm_module <objectname>
ucs_registerLDAPExtension does not write UNIVENTION_APP_IDENTIFIER to LDAP.
Setting the app identifier via UDM CLI seems to work flawlessly
→ found by ucs-test 04_register_and_verify_test_app_id
ucs_registerLDAPExtension does not write version start and version end to LDAP.
Setting the range via UDM CLI seems to work flawlessly
→ found by ucs-test 05_register_and_verify_version_start_end
ucs_registerLDAPExtension does not compare the package versions correctly. The new package always seems to have a lower package version number.
→ found by ucs-tests 10_update_extension_via_package,
How do I register an icon for the UDM module? Currently all modules are shown without icon within the UMC.
* ucs_registerLDAPExtension does not write UNIVENTION_APP_IDENTIFIER to LDAP.
The environment variable needs to be exported. I updated the API documentation for this.
* ucs_registerLDAPExtension does not write version start and version end to LDAP.
Ok, adjusted, this was only done for ldapacl extensions.
* ucs_registerLDAPExtension does not compare the package versions correctly.
Hmm, 11_update_extension_via_package_expected_fail works for me, is see the message:
ERROR: Registered package version 220.127.116.11 is newer, refusing registration.
and the object is not updated.
* How do I register an icon for the UDM module?
Unspecified in the design document. Probably the same applies to translation files. If this is required, we probably need additional options for the --udm_module case.
ERROR: Registered package version 3.0.30-7.187.201309121357 is newer, refusing registration.
# dpkg-query -W univention-management-console-module-appcenter
Comment 7: fixed.
> How do I register an icon for the UDM module?
ucs_registerLDAPExtension -udm_module file_for_settings_foo.py \
--umcregistration file_for_settings_foo.xml \
--icon udm-settings-small(16x16).png \
--icon udm-settings-larger(50x50).png \
--messagecatalog de.mo \
--messagecatalog it.mo ## or whatever
* The filename format for the messagecatalog is "<language>.mo" and <language> needs to be a subdir of /usr/share/locale (I couldn't find out in reasonable time what the relation between locale (de_DE) and these subdirs are, so I stick with the simple solution).
Needs some additional testing and ucs-test case coverage.
Ok, needed to fix a couple of the new UDM syntaxes to be mappable by UMC-module/udm/syntax.
The test 72_udm-extensions/32_file_integrity_udm_module fails to register more than one messagecatalog for an UDM module.
Multivalued UDM properties with complex syntax need to be set with --append, otherwise the last value wins. This is in contrast to multivalued UDM properties with simple syntax, which may be set with --set.
The auto tests were passed.
UCS 3.2 has been released:
If this error occurs again, please use "Clone This Bug".