Skip to content

Conversation

felix-schwarz
Copy link
Contributor

@felix-schwarz felix-schwarz commented Jan 22, 2021

Description

Refactored Branding, introducing a new Branding class, unifying branding support with class settings while offering support for the legacy format and laying the ground for retrieving branding assets from a remote server.

The Branding.plist stays in place, but now every key in it has been replaced with a class setting:

Original key path Replacement ClassSettings flat identifier
URLs / Documentation branding.url-documentation
URLs / Help branding.url-help
URLs / Privacy branding.url-privacy
URLs / TermsOfUse branding.url-terms-of-use
feedbackMail branding.send-feedback-address
canAddAccount branding.can-add-account
canEditAccount branding.can-edit-account
Profiles branding.profile-definitions
Generic branding.theme-generic-colors
Themes branding.theme-definition

Example for an old Branding.plist (still supported via legacy support):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>canAddAccount</key>
	<false/>
	<key>canEditAccount</key>
	<true/>
	<key>organizationName</key>
	<string>ownCloud.online</string>
	<key>feedbackMail</key>
	<string></string>
	<key>Configuration</key>
	<dict/>
	<key>Profiles</key>
	<array>
		<dict>
			<key>identifier</key>
			<string>ownCloud.online</string>
			<key>name</key>
			<string>ownCloud.online</string>
			<key>welcome</key>
			<string>Welcome to ownCloud.online</string>
			/* … */
		</dict>
	</array>
	<key>URLs</key>
	<dict>
		<key>Help</key>
		<string>https://owncloud.online/faq/</string>
		<key>Privacy</key>
		<string>https://owncloud.online/privacy-policy/</string>
	</dict>
	<key>Generic</key>
	<dict>
		<key>Corporate</key>
		<dict>
			<key>Color</key>
			<string>#52DDA9</string>
		</dict>
		/* … */
	</dict>
	<key>Themes</key>
	<array>
		<dict>
			<key>Name</key>
			<string>ownCloud.online</string>
			/* … */
		</dict>
	</array>
</dict>
</plist>

Example for Branding.plist using new format:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>branding.can-add-account</key>
	<false/>
	<key>branding.can-edit-account</key>
	<true/>
	<key>branding.organization-name</key>
	<string>ownCloud.online</string>
	<key>branding.send-feedback-address</key>
	<string></string>
	<key>branding.profile-definitions</key>
	<array>
		<dict>
			<key>identifier</key>
			<string>ownCloud.online</string>
			<key>name</key>
			<string>ownCloud.online</string>
			<key>welcome</key>
			<string>Welcome to ownCloud.online</string>
			/* … */
		</dict>
	</array>
	<key>branding.url-help</key>
	<string>https://owncloud.online/faq/</string>
	<key>branding.url-privacy</key>
	<string>https://owncloud.online/privacy-policy/</string>
	<key>branding.theme-generic-colors</key>
	<dict>
		<key>Corporate</key>
		<dict>
			<key>Color</key>
			<string>#52DDA9</string>
		</dict>
		/* … */
	</dict>
	<key>branding.theme-definitions</key>
	<array>
		<dict>
			<key>Name</key>
			<string>ownCloud.online</string>
			/* … */
		</dict>
	</array>
</dict>
</plist>

(it is also possible to put any other parameters in here - not just branding parameters)

Configuration via MDM

All parameters previously only available through Branding.plist are now also available - in new notation - via class settings / MDM support. Documentation is available here.

Related Issue

#697 #792

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

- new Branding class
	- base class in ownCloudApp.framework to allow usage from all parts of the app
	- extensions in ownCloudAppShared.framework add app-specific parts, incl. static login profiles and themes
	- provides unified access to branded parameters, including a legacy/compatibility layer for existing brandings
	- structurally prepared to transparently retrieve branding assets from other sources, like f.ex. web servers, dynamically
	- make all branding parameters available via MDM
	- provide metadata/documentation for all branding parameters
- BrandingClassSettingsSource:
	- now based on Branding class
	- prepared to limit possible settings when branding parameters are not retrieved from a local file
- VendorServices: bridge calls over to new Branding class
- various app parts:
	- switch to Branding class to retrieve branding assets, like images
	- remove redundant code
- Branding examples in ownCloud/Resources/Theming:
	- Branding-default: standard branding information (empty)
	- Branding-owncloud-online-legacy: the ownCloud.online branding in legacy format
	- Branding-owncloud-online: the ownCloud.online branding in unified format
@CLAassistant
Copy link

CLAassistant commented Jan 22, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ hosy
❌ felix-schwarz
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Collaborator

@hosy hosy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to add here. Awesome implementation. Thanks @felix-schwarz !

Copy link
Contributor

@michaelstingl michaelstingl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hosy hosy merged commit a7fc78d into milestone/11.5 Feb 2, 2021
@delete-merged-branch delete-merged-branch bot deleted the feature/mdm+branding branch February 2, 2021 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't auto-guess /owncloud endpoint [FEATURE REQUEST] Support specifying Branding.plist parameters via MDM
4 participants