Creating Custom Configuration in eCatalog


Facilitating Dynamic System Customization:

eCatalog supports the creation of custom configurations that allow for flexible system adjustments through the settings page, enabling administrators to manage various system parameters easily. This capability is crucial for adapting the system to specific organizational needs without the need for direct code modifications.


Defining Custom Configurations:


Enumerate Configuration Options:


Programmers can define different configuration options by creating an enumeration that outlines various settings. This structured approach ensures that each configuration option is clearly identified and manageable.

Example of Configuration Enumeration:


public enum enumAppConfigs

    {

        [eCatalogDisplayName("Default Domain")]

        DEFAULTDOMAIN,

        [eCatalogDisplayName("Application Name")]

        APPNAME,

        [eCatalogDisplayName("Registration Type Full")]

        [eCatalogPropertyDef("Registration Type Full", enumPropertyType.DropDownList,

            Lookup_Source = typeof(CLIP_RegTypeCollection),

            Lookup_TextField = CLIP_RegTypeCollection.Field_Text,

            Lookup_ValueField = CLIP_RegTypeCollection.Field_Value,

            Lookup_AllowMultiple = false)

        ]

        REGTYPE_FULL,

        [eCatalogDisplayName("Doctor Expiry Method")]

        [eCatalogPropertyDef("Doctor Expiry Method", enumPropertyType.DropDownList,

            typeof(enumLatestDoctorExpiryMethod))]

        DOCTOREXPIRY_METHOD,

        [eCatalogDisplayName("Designation Service Registrar")]

        [eCatalogPropertyDef("Designation Service Registrar", enumPropertyType.CheckboxList,

            Lookup_Source = typeof(AccountDesignationCollection),

            Lookup_TextField = AccountDesignationCollection.Field_Text,

            Lookup_ValueField = AccountDesignationCollection.Field_Value,

            Lookup_AllowMultiple = true,

            ePropertyType = enumPropertyType.CheckboxList)

        ]

        DESIGNATION_SERVICEREGISTRAR ,

        [eCatalogDisplayName("Designation Registrar")]

        [eCatalogPropertyDef("Designation Registrar", enumPropertyType.CheckboxList,

            Lookup_Source = typeof(AccountDesignationCollection),

            Lookup_TextField = AccountDesignationCollection.Field_Text,

            Lookup_ValueField = AccountDesignationCollection.Field_Value,

            Lookup_AllowMultiple = true,

            ePropertyType = enumPropertyType.CheckboxList)

        ]



Implement Configuration Properties:


  • Each configuration option can be detailed with attributes that define how they should be displayed and interacted with on the settings page, such as dropdown lists or checkboxes.
  • Properties can be linked to data sources, providing dynamic content that administrators can select from.
  • Initialization of Properties: When registering the configuration for the first time, the system requires a default setup for each property. Programmers can override methods to specify these default values based on the property's intended use.



public override AccountPropertyDef getDefaultPropertyDef(string PropertyName)

        {

            AccountPropertyDef oDef = new AccountPropertyDef();


            oDef.PropertyName = PropertyName;

            oDef.PropertyDisplayName = PropertyName;

            oDef.PropertyDescription = PropertyName;


            #region Personal Particular

            if (

                PropertyName == FIELD_Name

                

                )

            {

                oDef.Category = CATEGORY_PERSONALPARTICULAR;

            }

            #endregion


            #region Employment

            if (

                PropertyName == FIELD_EmploymentEmployer

                )

            {

                oDef.Category = CATEGORY_EMPLOYMENT;

            }

            #endregion

..and so on.




Accessing Custom Configurations:


Administrator Interaction:

Administrators can navigate to the Settings page within eCatalog and access the Module Configuration section. Here, they will find all the custom configurations set up by programmers, which they can then modify as needed.


This interface allows administrators to adjust system settings dynamically, reflecting changes across the system without needing to restart or recompile the application.