Difference between revisions of "HowTo:Provide system definitions with a custom plugin"
m |
|||
Line 735: | Line 735: | ||
this.CodedNamespace = "System.MyPlugin"; | this.CodedNamespace = "System.MyPlugin"; | ||
this.CodedDescription = "My classification"; | this.CodedDescription = "My classification"; | ||
− | + | ||
− | + | // Derives from SystemDesignMetaClass, see above for metaproperty definition | |
} | } | ||
} | } | ||
Line 764: | Line 764: | ||
#endregion System Classifications | #endregion System Classifications | ||
− | + | ||
// ... | // ... | ||
} | } | ||
Line 789: | Line 789: | ||
public override UBIKClassList<SelectiveList> DefineSystemSelectiveLists(UBIKEnvironment environment) | public override UBIKClassList<SelectiveList> DefineSystemSelectiveLists(UBIKEnvironment environment) | ||
{ | { | ||
− | + | UBIKClassList<SelectiveList> selectiveLists = new UBIKClassList<SelectiveList>(); | |
− | + | ||
− | + | // MyEnumType should be an integer enum | |
+ | SystemSelectiveList fromEnum = new SystemSelectiveList(environment, typeof(MyEnumType)); | ||
fromEnum.SetUID(GuidUtility.SLFROMENUM); | fromEnum.SetUID(GuidUtility.SLFROMENUM); | ||
− | + | selectiveLists.Add(fromEnum); | |
− | + | ||
− | + | SystemSelectiveList customList = new SystemSelectiveList(environment); | |
− | + | customList.SetItemValueType(PropertyTypes.String); | |
− | + | customList.AddSelectiveItem("any object of supported type", "description"); | |
− | + | customList.Name = "SL_STR"; | |
− | + | customList.SetUID(GuidUtility.SLSTR); | |
− | + | selectiveLists.Add(customList); | |
− | + | ||
− | + | return selectiveLists; | |
} | } | ||
#endregion System Selective Lists | #endregion System Selective Lists | ||
− | + | ||
// ... | // ... | ||
} | } | ||
Line 827: | Line 828: | ||
{ | { | ||
// ... | // ... | ||
− | + | ||
public override void PreProcessDatabaseUpdate(Version previousVersion, UBIKEnvironment environment) | public override void PreProcessDatabaseUpdate(Version previousVersion, UBIKEnvironment environment) | ||
{ | { | ||
base.PreProcessDatabaseUpdate(previousVersion, environment); | base.PreProcessDatabaseUpdate(previousVersion, environment); | ||
− | + | ||
// This code will be executed whenever the system is upgraded, | // This code will be executed whenever the system is upgraded, | ||
− | + | // before a schema upgrade for this SystemDefinitions package | |
} | } | ||
Line 839: | Line 840: | ||
{ | { | ||
base.PostProcessDatabaseUpdate(previousVersion, environment); | base.PostProcessDatabaseUpdate(previousVersion, environment); | ||
− | + | ||
// This code will be executed whenever the system is upgraded, | // This code will be executed whenever the system is upgraded, | ||
− | + | // after a schema upgrade and before content initialization and upgrade | |
− | + | // for this SystemDefinitions package | |
} | } | ||
− | + | ||
public override void InitializeSystemContent(UBIKEnvironment env) | public override void InitializeSystemContent(UBIKEnvironment env) | ||
{ | { | ||
− | + | base.InitializeSystemContent(env); | |
− | + | ||
// This code will be executed whenever the system is initialized, | // This code will be executed whenever the system is initialized, | ||
− | + | // after an optional schema upgrade and before an optional content adaptation | |
− | + | // for this SystemDefinitions package | |
} | } | ||
− | + | ||
public override void UpdateSystemContent(UBIKEnvironment env) | public override void UpdateSystemContent(UBIKEnvironment env) | ||
{ | { | ||
− | + | base.UpdateSystemContent(env); | |
− | + | ||
// This code will be executed whenever the system is upgraded, | // This code will be executed whenever the system is upgraded, | ||
− | + | // after all other steps for this SystemDefinitions package | |
− | + | } | |
− | + | ||
// ... | // ... | ||
} | } |
Revision as of 15:43, 26 November 2024
This tutorial explains how to provide any kind of preconfigured UBIK® data (system definitions) using a custom plugin.
General concept
When rolling out a UBIK® customizing into a (productive) environment, there is always the challenge regarding the transportation of the data model and basic data. The sustainable solution is to deliver versioned packages of system definitions in plugins, because that allows for easy deployment and upgrade, and for the direct application of state-of-the-art software development strategies for plugin development.
UBIK® plugins are detected when an Environment is initialized, and the user is prompted with a database upgrade if necessary. The technical maintenance of the database is automatic and allows for arbitrary adaptations. The plugin developer can decide whether to make meta definitions immutable or further customizable by the user. Custom scripts can be executed everytime the Environment is connected or just during an upgrade.
Prerequisites
To understand the code, knowledge about the UBIK® ER-model and the plugin injection mechanism is required.