RDN-126
1

Configuration Manager needs to be built

Scott on 7/1/2015 8:27 PM

Scott on 11/27/2015 4:27 AM

%
(hrs)
Logged

0 (hrs)


 Description

We need to build a configuration manager for all the settings the application has.

  1. This will be built in RDN.Raspberry.
  2. You need to create a new table called Site_Configuration that will attach to a class called SiteConfiguration.
  3. The database portion of this along with the datacontext and models will be built within Common.Site project.  RDN.Raspberry will reference the project.
  4. You are free to copy and replace code from the Common.EmailServer.Library.Database.Context and Base name spaces.
  5. You will need to create the following columns Id (Seed), Key (The Name of the configuration property), Value (the value of the property), Description.  This should be created from the SiteConfiguration Class.
  6. The class should inherit from a new base class called InheritDb which can also be copied from the common.emailserver library.
  7. You should create a new page on RDN.Rasperry called configuration.
  8. The configuration page should display all the results of the configuration table in the database.  You should be able to add, EDIT and DELETE a configuration property.
  9. When a delete occurs, you should only soft delete the property.  Meaning, you should set the flag IsRemoved  == true within the InheritDb class.
  10. You need to use the EntityFramework and Code First migrations to create this table.
  11. RDN.DBUpdate is your migrating project, so you can add the new context and configuration to the RDN.DbUpdate.Migrations.Configuration Class.
  12. An example of the confuration and migrations can be seen as the CEmail class in the configuration file.
  13. You should build a  manager class in Common.Site to manage all the properties/access/delete/get from the database.

After you are finished with this update, you will need to take ALL the properties from LibraryConfig (in RDN.Library) and access the new database table from that class.  Do not delete the class, just change how the class receives its configurationproperties.

Skip Navigation Links
 

Pradeep Saturday, October 24, 2015 10:45 AM #

Scott, All the AppSettings config values of RDN.League has been added into LibraryConfig.cs file other then IsProduction because as my previous comment is has been called into GetCache(System.Web.Caching.Cache cache) so it makes recursive call for GetConfiguration(). IsProduction called as it is.

 

Scott Wednesday, October 21, 2015 6:51 PM #

On RDN.Raspberry, please move the Edit and Delete buttons to the left side of the table, not on the right.

 

Scott Wednesday, October 21, 2015 6:44 PM #

There are a few AppSettings fields you missed on LibraryConfig.

Please make sure to update those too.

 

Scott Wednesday, October 21, 2015 1:24 AM #

Have you created the SQL script to add the initial values?

Before committing and pushing this, please create the script so I can run it along with the other developers.

 

Pradeep Saturday, October 17, 2015 5:07 PM #

Scott, As per RDN-126, all the configurations of RDN.League will be taken care from database rather then web.Config but IsProduction config entry has been moved into database but It has been used from web.Config becuase we are calling the property into GetCache(System.Web.Caching.Cache cache) so it makes recursive call for GetConfiguration(). 

 

Scott Saturday, September 26, 2015 6:02 PM #

There should be no string length requirement on the key or value.  Go ahead an remove the string length.

[StringLength(50), Required] + [StringLength(400), Required]

Also, please do NOT commit unless its all completed.  Since this isn't completely working with a script to run on the database, the developers and I must roll back the changes you made... until your fully complete.

 

Scott Wednesday, September 09, 2015 6:45 PM #

Looks good so far.

  1. ViewConfigurations page, need to spell Kye as Key please.
  2. Please Add a new Method to RDN.Library.Cache.SiteCache.
    1. GetConfiguration
    2. Copy the GetAllLogos method.  If the Cofiguration isn't currently there, load it to the cached.Configurations object.
  3. Add a new method to the same file.
    1. GetConfigurationValue(string key)
    2. Get the GetConfiguration().where(x=>x.Key == key).FirstOrDefault().Value
  4. Go to the RDN.League/Web.config.
    1. Each setting in appsettings XML namespace need to be inserted into the Site_Configuration table.
    2. Please create a .sql file with all the inserts into appsettings.
    3. You will need to insert each of these properties.
    4. Save the .sql file in RDN.League.App_Data.
  5. Replace all the properties in RDN.Library.Classes.Config.LibraryConfig with a LINQ where from SiteCache.
    1. Select each property based on the key of the property. For example, PublicSite {get{  return SiteCache.GetConfigurationValue("PublicSite")}}
  6.  
 

Scott Tuesday, September 01, 2015 6:53 PM #

Please commit and push Common.Site

Please rename the controller from ConfigationsController to ConfigurationsController

Please put the CSS in a site.css file.

+<style type="text/css"> + + .valign { + vertical-align: top; + width:150px; + } + textarea { + resize: none; +}

Do not truncate the description... 

@if (item.Discription.Length > 0) + { + description = item.Discription.Length > 60 ? item.Discription.Substring(0, 59) + "..." : item.Discription; + }

Please put all the javascript into a ConfigurationsViewModel

 

Scott Sunday, August 23, 2015 5:38 PM #

Can you give me a status update on this item?  Where are you?

 

Scott Saturday, August 08, 2015 8:22 PM #

Please use the Site.Common.Datamodels.SiteContext for the context.  Do not create your own.

Please call it ConfigurationManager, NOT configurationFactory.  

I want to Edit and Create a new item INLINE.  I don't want to use another page to create and edit the configuration item.  You can do this with Javascript. 

Good work so far!

 


Powered by BugNET 1.6.339.0