Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
Custom product CMDB properties
Samuel Slotsky
Website Platform CMDB property values can be checked by getting an instance of the `ProductSettings` class from the container. This object will have properties whose names match their respective CMDB properties.
What is the mechanism for checking product specific CMDB property values?
Find more posts tagged with
refinitiv-internal
Accepted answers
Samuel Slotsky
Well, since this little town I created has but chirping crickets and rolling tumbleweeds for inhabitants, I'll answer my own darn question
The way to do this is to define a `CustomSettings` class. The properties on this class have names that match their CMDB properties, just like `ProductSettings` does. You must also define a static method called `GetCurrent`, which returns your product's `CustomSettings` instance from the IoC container.
What this class actually does is retrieve values from your properties file, which is populated from CMDB in deployed environments. Therefore, when running locally, you must define all of your custom properties in your local properties file. Additionally, you can add properties to this file that are not configured in CMBD, if you define them in an XML file, although I don't remember what it's called or where it's located.
Here is an example of a `CustomSettings` class for GTLRMaxwell (BusinessLawAdvisor)
[DataContract(Name = "Cobalt.GTLRMaxwell.Web.CustomSettings", Namespace = "")]
public class CustomSettings
{
[DataMember]
public string Currents { get; private set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[DataMember]
public string WebContent { get; private set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
public static CustomSettings GetCurrent() { return IoC.GetForRequest().GetCustomSetting(); }
}
All comments
Samuel Slotsky
Well, since this little town I created has but chirping crickets and rolling tumbleweeds for inhabitants, I'll answer my own darn question
The way to do this is to define a `CustomSettings` class. The properties on this class have names that match their CMDB properties, just like `ProductSettings` does. You must also define a static method called `GetCurrent`, which returns your product's `CustomSettings` instance from the IoC container.
What this class actually does is retrieve values from your properties file, which is populated from CMDB in deployed environments. Therefore, when running locally, you must define all of your custom properties in your local properties file. Additionally, you can add properties to this file that are not configured in CMBD, if you define them in an XML file, although I don't remember what it's called or where it's located.
Here is an example of a `CustomSettings` class for GTLRMaxwell (BusinessLawAdvisor)
[DataContract(Name = "Cobalt.GTLRMaxwell.Web.CustomSettings", Namespace = "")]
public class CustomSettings
{
[DataMember]
public string Currents { get; private set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[DataMember]
public string WebContent { get; private set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
public static CustomSettings GetCurrent() { return IoC.GetForRequest().GetCustomSetting(); }
}
mark.maruska
I believe that the Currents property is the custom property. I'm not sure why there's a WebContent property since that should be a platform property already... maybe this is old or sample code.
Samuel Slotsky
Mark, why didn't you answer this one? Sheesh!
Ron Burke
Here's a link to the [Website Configuration][1] wiki page that shows how to add custom environmental (i.e., CMDB) and non-environmental settings.
[1]:
http://nsawiki.int.westgroup.com/wiki/index.php/Website_Configuration
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act