Developer forum

Forum » Development » ProductCategoriesLanguageControl, Language and Variant are saved in GlobalSettings

ProductCategoriesLanguageControl, Language and Variant are saved in GlobalSettings

Harald Brouwers
Reply

When checking a Globalsettings file of one of our projects, I noticed that the ProductCategoriesLanguageControl was stored in the file. With 4 languages this gives 1700 !! lines of code. We are running DW9.2.17

<ProductCategoriesLanguageControl>
  <Language>
    <TestCat.Testveld>True</TestCat.Testveld>
      <A01.A>True</A01.A>
        ...
      <J13.Z1>True</J13.Z1>
    </Language>
    <Variant>
      <TestCat.Testveld>True</TestCat.Testveld>
        <A01.A>True</A01.A>
          ...
        <J13.Z1>True</J13.Z1>
    </Variant>
</ProductCategoriesLanguageControl>

Could this be removed from the globalsettings file?

Thanx in advance.

 

 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Harald

On the 9 branch, you can split config files into multiple files - but the settings will remain in files

  1. Rename GlobalSettings.aspx to GlobalSettings.config
  2. Now, you can take any section or part of a section and move into other *.config files. I.e. make Database.config file and move database related info to that:
    <?xml version="1.0"?>
    <Globalsettings>
      <System>
        <Database>
          <Password>*****</Password>
          <Type>ms_sqlserver</Type>
          <UserName>dw</UserName>
          <Database>dw9</Database>
          <SQLServer>localhost\SQLEXPRESS</SQLServer>
          <DWWebIP>
          </DWWebIP>
          <SQLServer2>
          </SQLServer2>
          <Database2>
          </Database2>
          <UserName2>
          </UserName2>
          <Password2>
          </Password2>
          <IntegratedSecurity>False</IntegratedSecurity>
          <ConnectionString>
          </ConnectionString>
          <ConnectionString2>
          </ConnectionString2>
          <Translation>
            <ConnectionString>
            </ConnectionString>
            <UserName>
            </UserName>
            <Database>
            </Database>
            <SQLServer>
            </SQLServer>
            <Password>
            </Password>
          </Translation>
          <DateFormat>
          </DateFormat>
        </Database>
      </System>
    </Globalsettings>

  3. Do the same with the field settings:
    <?xml version="1.0" encoding="utf-8"?>
    <Globalsettings>
      <Ecom>
        <ProductCategoriesLanguageControl>
          <Language>
            <Bikes.Frame_size>False</Bikes.Frame_size>
            <Bikes.Wheel_size>False</Bikes.Wheel_size>
            <Clothes.Fabric>False</Clothes.Fabric>
          </Language>
          <Variant>
            <Bikes.Frame_size>False</Bikes.Frame_size>
            <Bikes.Wheel_size>False</Bikes.Wheel_size>
            <Clothes.Fabric>False</Clothes.Fabric>
          </Variant>
        </ProductCategoriesLanguageControl>
      </Ecom>
    </Globalsettings>

In this way at least you have it seperated.

BR Nicolai

Votes for this answer: 1
 
Harald Brouwers
Reply

Hi Nicolai,

Splitting this into multiple files makes the config more organized and better managable, thanx.

I was wondering if, performance wise, it would be better to store this data in the database? Because I'm under the impression (sorry if I'm wrong) on application load all these lines are processed. Which takes some time.

Greetings Harald

 
Nicolai Pedersen
Reply

You are right - they are loaded on application load. I do not think there is much performance impact though - we have not seen that anyways, but I'll have it checked out at some point. You could aruge that having these values in memory at all times is overkille since it is only used in the backend.

For 9.4 we have a project related to these settings so they can be managed per user. We might move theses system wide settings to another storage pattern in that task.

Thanks for the input.

BR Nicolai

 

You must be logged in to post in the forum