CONFIGURATION

Environments

NOTE : The environment is specified in web.config in "appsettings" section using key "environment". Available environments are :
  • dev
  • dev2
  • qa
  • prod

Config Files

  1. Exist for each environment
  2. Folder location is CommonLibrary.CMS\Config\env\
  3. File format is MS .ini ( this is for simplicity and for to allow config file inheritance - see below )
  4. They are inherited so prod.config inherits settings from qa.config which inherits settings from dev.config. This removes the need to duplicate settings for each environment. But if you want to override a setting in dev.config with production values in prod.config then you just need to place that key/value pair in prod.config.

Environment Config File Inherits Description
dev <root>\Config\Env\dev.config none Development
dev2 <root>\Config\Env\dev2.config dev.config Development environment # 2
qa <root>\Config\Env\qa.config dev.config Quality Testing Environment
prod <root>\Config\Env\prod.config qa.config Production environment


Application Settings

There are currently very few settings in the web.config file because:
  1. Most settings are placed in the environment specific config files above
  2. All services / settings are configured in global.asax ( to show through code how components are configured )

There are however the below settings in web.config:

<appSettings>
      <add key="environment" value="dev"/>
      <add key="useRealData" value="true"/>
      <add key="clearData" value="false"/>
      <add key="loadSchema" value="false"/>
      <add key="updateSchema" value="true"/>
      <add key="loadData" value="false"/>
      <add key="assembliesForExtensions" value="CommonLibrary.Web.Modules"/>
</appSettings>

Setting Description
environment Specify the environment here ( e.g. dev, dev2, qa, prod )
useRealData Whether or not use a real data-store ( local sql express or to use In-Memory repositories )
clearData Whether or not to clear the data in the data-store on load
loadSchema Whether or not to create the database schema
updateSchema Whether or not to update the database schema ( for 0.9.5 this is defaulted to true )
loadData Whether or not to load sample data into the database
assembliesForExtensions Comma delimited list of assemblies to check for extensions ( widgets, infos, macros, models )


Database Connections

Database connection strings are specified in each environment specific config file listed above ( e.g. dev.config, qa.config, prod.config ) in the section [Database]

[ Database ]
server: kishore_pc1
username: testuser1
password: password
database: testdb
connectstr: data source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|cms.mdf;Integrated Security=True;User Instance=True
databasetype: System.Data.SqlClient

Default Data

  1. Default data is loaded into the database if "loadData" application setting is set to true ( see above )
  2. All the data that is immediately loaded by the application is imported from either .csv or .ini files located in <root>\src\apps\CommonLibrary.CMS\Config\Data
  3. The data is imported into the repositories / system only if it doesn't already exist in the system. This is accomplished by checking for same records by the values of specific fields

Last edited Feb 22, 2011 at 3:39 AM by kishore_reddy, version 6

Comments

No comments yet.