Bug 40827 - Additional App data for App Appliances
Additional App data for App Appliances
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-1-errata
Assigned To: Johannes Keiser
Alexander Kläser
:
Depends on: 38957
Blocks: 40006
  Show dependency treegraph
 
Reported: 2016-03-02 18:33 CET by Johannes Keiser
Modified: 2016-03-09 15:52 CET (History)
4 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:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Patch for pickle files (3.13 KB, patch)
2016-03-07 18:16 CET, Dirk Wiesenthal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Keiser univentionstaff 2016-03-02 18:33:17 CET
A ISV will have the possibilty to specify Modules that should be displayed in the Appliance category tab in the umc.

For that we need to add an additional property to the app object created from the ini file that contains a list with the wanted modules.
Comment 1 Johannes Keiser univentionstaff 2016-03-02 18:51:21 CET
r 67855

univention-appcenter (5.0.20-11):
* Bug #40827: added attribute to created app object from ini file
Comment 2 Alexander Kramer univentionstaff 2016-03-03 10:01:47 CET
FYI - how to use:

ApplianceCategoryModules expects a comma separated list of modules.

to display a flavor use --> module:flavor[/flavor]
e.g. udm:users/user or appcenter:packages

to display a module wihtout a flavor just use the module name
e.g. diagnostic

A complete example can look like this:
ApplianceCategoryModules=udm:users/user, appcenter:packages, diagnostic
Comment 3 Johannes Keiser univentionstaff 2016-03-03 13:39:54 CET
r 67868
univention-appcenter (5.0.20-12):
* Bug #40827: added primary and secondary color to created app object from
  ini file

YAML: added
r 67869
Comment 4 Johannes Keiser univentionstaff 2016-03-03 16:45:16 CET
r 67878

univention-appcenter (5.0.20-14):
* Bug #40827: added css background property for appliances

YAML: r 67879
Comment 5 Alexander Kläser univentionstaff 2016-03-04 13:25:34 CET
Could you please add the following properties, as well:

ApplianceBootsplashLogo
ApplianceUmcHeaderLogo
ApplianceWelcomeScreenLogo
Comment 6 Johannes Keiser univentionstaff 2016-03-04 13:58:05 CET
(In reply to Alexander Kläser from comment #5)
> Could you please add the following properties, as well:
> 
> ApplianceBootsplashLogo
> ApplianceUmcHeaderLogo
> ApplianceWelcomeScreenLogo

Added properties

r 67911
univention-appcenter (5.0.20-15):
* Bug #40827: added bootSplashLogo UmcHeaderLogo and WelcineScreenLogo
  properties for app appliances
Comment 7 Johannes Keiser univentionstaff 2016-03-04 14:00:18 CET
YAML: r 67912
Comment 8 Johannes Keiser univentionstaff 2016-03-04 15:35:22 CET
r 67922
univention-appcenter (5.0.20-16):
* Bug #40827: removed the properties for app appliances in
  univention-appcenter. App appliance specific properties
  are moved to app-appliance-branding package

YAML: r 67923
Comment 9 Alexander Kläser univentionstaff 2016-03-07 13:59:54 CET
Changes: OK, this works really nice. For the appliances, the code can now be written as follows :-) ...

---------- 8< ----------
import univention.appcenter.app as app

class App(app.App):
    appliance_category_modules = app.AppListAttribute()
    appliance_primary_color = app.AppAttribute()
    appliance_secondary_color = app.AppAttribute()
    appliance_css_background = app.AppAttribute()
    appliance_bootsplash_logo = app.AppAttribute()
    appliance_umc_header_logo = app.AppAttribute()
    appliance_welcome_screen_logo = app.AppAttribute()
    appliance_logo = app.AppAttribute()

class AppManager(app.AppManager):
    _AppClass = App
---------- 8< ----------

YAML file: FAIL, please adjust the YAML file accordingly
→ REOPEN
Comment 10 Dirk Wiesenthal univentionstaff 2016-03-07 18:16:36 CET
Created attachment 7520 [details]
Patch for pickle files

Please keep in mind that the AppManager caches the python objects for performance reasons.

You need to use a different pickle_file. Or none at all.

class AppManager(app.AppManager):
  _pickle_file = None
  _cache = []

otherwise you may end up loading Apps without appliance_* attributes. You also need to use a different cache object. Just in case you mix old AppManager and new AppManager.
Comment 11 Johannes Keiser univentionstaff 2016-03-08 15:29:56 CET
(In reply to Dirk Wiesenthal from comment #10)
> Created attachment 7520 [details]
> Patch for pickle files

r 67987
univention-appcenter (5.0.20-20):
* Bug #40827: Support the use of no pickle file for app appliances


> Please keep in mind that the AppManager caches the python objects for
> performance reasons.
> 
> You need to use a different pickle_file. Or none at all.
> 
> class AppManager(app.AppManager):
>   _pickle_file = None
>   _cache = []
> 
> otherwise you may end up loading Apps without appliance_* attributes. You
> also need to use a different cache object. Just in case you mix old
> AppManager and new AppManager.

r 67986
univention-app-appliance-branding (0.2.2-8):
* Bug #39465: always load new ini file. ignore possible caches from
        appcenter


YAML: r 67988
Comment 12 Alexander Kläser univentionstaff 2016-03-08 15:53:13 CET
Changes: OK, the changes work as expected.
YAML: OK, as discussed, I adapted the description (r67991).

→ VERIFIED
Comment 13 Janek Walkenhorst univentionstaff 2016-03-09 15:52:17 CET
<http://errata.software-univention.de/ucs/4.1/127.html>