Bug 32407 - ucs_registerUDMModule library function
ucs_registerUDMModule library function
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Arvid Requate
Stefan Gohmann
: interim-3
Depends on: 32409
Blocks: 32421
  Show dependency treegraph
 
Reported: 2013-08-28 14:32 CEST by Arvid Requate
Modified: 2014-03-20 16:24 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
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:
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 Arvid Requate univentionstaff 2013-08-28 14:32:08 CEST
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>.
Comment 1 Arvid Requate univentionstaff 2013-08-28 16:18:59 CEST
The string <AppID>_<AppVersion> should be stored in an attribute univentionAppIdentifier as tracking reference e.g. for Bug 32418.
Comment 2 Arvid Requate univentionstaff 2013-08-28 16:41:59 CEST
ucs_unregisterUDMModule is also required (e.g. for unjoinscripts), to remove the object in case no App is registered any longer for it.
Comment 3 Arvid Requate univentionstaff 2013-09-10 16:38:37 CEST
Implemented in shell-univention-lib, first used in univention-management-console-module-appcenter. Changelog comitted.
Comment 4 Arvid Requate univentionstaff 2013-09-16 18:03:10 CEST
Now merged into more general functions:

ucs_registerLDAPExtension "$@" --udm_module <filename>

ucs_unregisterLDAPExtension "$@" --udm_module <objectname>
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2013-09-26 14:33:38 CEST
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
→ REOPEN

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
→ REOPEN

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, 
  11_update_extension_via_package_expected_fail and 
  12_update_extension_via_other_packagename
→ REOPEN

How do I register an icon for the UDM module? Currently all modules are shown without icon within the UMC.
→ REOPEN
Comment 6 Arvid Requate univentionstaff 2013-10-07 13:35:28 CEST
* 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 7.8.6.6 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.
Comment 7 Philipp Hahn univentionstaff 2013-10-08 09:21:16 CEST
# /usr/lib/univention-install/35univention-management-console-module-appcenter.inst
...
ERROR: Registered package version 3.0.30-7.187.201309121357 is newer, refusing registration.
# dpkg-query -W univention-management-console-module-appcenter
univention-management-console-module-appcenter  3.0.38-1.197.201310011400
Comment 8 Arvid Requate univentionstaff 2013-10-08 15:36:24 CEST
Comment 7: fixed.
Comment 9 Arvid Requate univentionstaff 2013-10-10 22:08:34 CEST
> How do I register an icon for the UDM module?

Like this:

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.
Comment 10 Arvid Requate univentionstaff 2013-10-14 18:47:17 CEST
Ok, needed to fix a couple of the new UDM syntaxes to be mappable by UMC-module/udm/syntax.
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2013-10-28 17:19:11 CET
The test 72_udm-extensions/32_file_integrity_udm_module fails to register more than one messagecatalog for an UDM module.
Comment 12 Arvid Requate univentionstaff 2013-10-28 19:27:43 CET
Fixed.

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.
Comment 13 Stefan Gohmann univentionstaff 2013-10-31 12:27:59 CET
The auto tests were passed.
Comment 14 Stefan Gohmann univentionstaff 2013-11-19 06:41:38 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

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