V92 angular portal: Where do the application theme preferences get stored ?

Hi, 

In the v92 angular portal, we're going to supress the option of user interface settings (under the logged user) and leave only one corporate theme. We would like to know where this setting get stored per user, so we could update it in the database with a fixed value.

Thanks!

Parents Reply Children
  • i can see the file stored in DB and in IIS site folder but users only get the custom theme after manually selecting it from user interface settings in portal

  • Hello Hector,

    From my understanding the config key 'ServerLevelConfig/DefaultHtmlTheme' is picked-up by the portal APIServer when configed:
    'bin\CCC.CompositionApi.global.json' contains
    {"Scopes":[{"AppliesTo":"imx","Ignore":false,"Data":{"ServerLevelConfig/DefaultHtmlTheme":"eui-dark-theme"...

    The following end-point will publish this setting:.../apiserverdev/imx/config
    {... "DefaultHtmlTheme": "eui-dark-theme",...}

    If an user configures his own personal default theme 'User Interface Settings' this takes precedence over
    the server level default. This is saved in ConfigurationData@DialogUserConfiguration

    	SELECT u.Ident_QBMXUser
    		,CONVERT(VARCHAR(MAX), CAST('' AS XML).value('xs:base64Binary(sql:column("ConfigurationData"))', 'VARBINARY(MAX)')) AS DialogUserConfiguration
    	FROM DialogUserConfiguration
    	JOIN QBMXUser u ON u.UID_QBMXUser = DialogUserConfiguration.UID_QBMXUser
    	WHERE UID_DialogProduct IN (
    			SELECT UID_DialogProduct
    			FROM QBMProduct
    			WHERE Ident_Product = 'WebDesigner'
    			)
    
    Or
    
    Imports Newtonsoft.Json
    
    Public Function CCC_GetUserConfiguration(
    	ByVal uidQBMXUser As String) As String
    	
    	Dim uidDialogProduct As String = Session.Source().GetSingleValue(Of String)(Query _
    			.From(Table.QBMProduct) _
    			.Where(Session.SqlFormatter.Comparison(Table.QBMProduct.Ident_Product, "WebDesigner",
    					ValType.String, CompareOperator.Equal, FormatterOptions.None)) _
    			.Select(Table.QBMProduct.UID_DialogProduct))
    	
    	Dim userConfiguration As DialogUserConfiguration = Nothing
    	If Not Session.Source.TryGet(Of DialogUserConfiguration)(
    			New DbObjectKey(Table.DialogUserConfiguration, New String() {uidDialogProduct, uidQBMXUser}),
    			EntityLoadType.Interactive, userConfiguration) Then Exit Function
    
    	Return TryDeserializeConfigurationData(userConfiguration.Entity)
    End Function
    
    Private Function TryDeserializeConfigurationData(ByVal e As IEntity) As String
    	Dim bytes As Byte() = e.GetValue(Of Byte())("ConfigurationData")
    	
    	Dim configurationSettings As New List(Of ConfigurationSetting)
    	configurationSettings = JsonConvert.DeserializeObject(Of List(Of ConfigurationSetting))(Encoding.UTF8.GetString(bytes))
    	
    	Dim configOverview = New StringBuilder()
    	For Each setting In configurationSettings
    		configOverview.AppendLine($"{setting.Key} = {setting.Value}")
    	Next		
    	
    	Return configOverview.ToString()
    End Function
    
    Public Class ConfigurationSetting
    	Public Property Key As String
    	Public Property Value As String
    End Class

    LastLookupDate = [{"Context":"UserProcess","Date":"2024-08-29T07:18:23.1620208Z"}]
    ProfileSettings = {"TimeZoneId":"","PreferredAppThemes":"eui-light-theme"}
    QerProfileSettings = {}

    Some aditional info about the DialogUserConfiguration entries:
    Lost bookmarks after change of authentication method

  • Hello Niels ! thank you very much for the detailed answer !

    I can find such configuration encoded in Base64 in the DialogUserConfiguration table but only for users that have manually selected the custom theme in "User Interface Settings" in Portal (and it works),

    I'll try to describe my issue here:

    • I install a custom yellow theme using software loader
    • Configure that custom yellow  theme in Administration Portal so it should be default to every user in WebPortal
    • The custom yellow theme appears in the "User Interface Settigns" list in profile settings
    • Users manually selecting the custom theme in "User Interface Settigns" get the correct yellow theme
    • Users entering the Portal without selecting the custom theme in "User Interface Settigns" get the 1IM default blue theme 
  • Just to take the "custom theme" out of the equation for now.
    What happens when you select the "dark theme" as the server default?

    So now:

    • Users entering the Portal without selecting the custom theme in "User Interface Settigns" should get the dark theme