The control reads the definition from the current context object and displays a [[Coding box|code editing box]] for each eligible property or method, its appearance depending on status of the actual property/method:
{| class="wikitable" | width = "5080%"
|-
! Appearance!! Example !! Comment
The Code Editor features a toolbar with the following items, from left to right:
{| class="wikitable" | width = "5080%"
|-
! Item !! Purpose
In this view mode you can override certain events that are thrown by a {{UBIK}} object. This means that custom code can be executed once the event raises. The following events are currently exposed by {{UBIK}} objects:
{| class="wikitable sortable" | width = "5080%"
|-
! Event!! Exposed by !! Description
|- align="left"
| OnBeforeDelete|| All || event fired when a base object is deleted; possibility to cancel the deletion
|- align="left"
| OnPrepareForSave|| All || event fired just before a base object is about to get saved; possibility to edit the object right before saving {{Version/ServerSince|2.4.4}}
|- align="left"
| OnBeforeSave|| All || event fired when a base object is saved; possibility to cancel the saving
|- align="left"
| OnLocalFileDocumentUpdated|| Document || event fired when the current document was updated
|- align="left"
| OnBeforeDeleteFile || Document || event fired when the belonging local file copy of a document is about to be deleted; possibility to cancel the file deletion
|- align="left"
| BeforeImportStatusChange|| Proxy || Event fired before the Import Staus of a proxy instance is changed. Possibilty to cancel the status change.
|- align="left"
| BeforeExportStatusChange|| Proxy || Event fired before the Export Staus of a proxy instance is changed. Possibilty to cancel the status change.
|- align="left"
| ImportStatusChanged|| Proxy || Event fired after the import status was changed for the proxy instance.
|- align="left"
| ExportStatusChanged|| Proxy || Event fired after the export status was changed for the proxy instance.
|- align="left"
| OnInterfaceError|| InterfaceExecution||
|- align="left"
| OnInterfaceFinished|| InterfaceExecution||
|- align="left"
| OnInterfaceStarted|| InterfaceExecution||
|- align="left"
| OnProxyError|| InterfaceExecution||
|- align="left"
| OnProxyFinished|| InterfaceExecution||
|- align="left"
| OnBeforeCheckOut|| ContentClass||Event fired if the systems ask whether the check out of the object is supported
|- align="left"
| OnBeforeRelease|| ContentClass||Event fired if the systems ask whether the release of the object is supported
|- align="left"
| OnSerialized|| Context||Event fired when a set of content objects is serialized and provided via the UBIK WebService
|}
[[Category:Coding|Code Editor]]
[[Category:Studio controls|Code Editor]]
===Methods===
In this view mode you can override certain properties and methods that are exposed by an {{UBIK}} object.
{| class="wikitable sortable" | width = "5080%"
|-
! Name !! Kind !! Exposed by !! Description
|- align="left"
| DisplayString|| Property || All || -Concatenated from DisplayString[0] and DisplayString[1], separated by a space character; define how objects are displayed in a property configured with a [[MetaProperty#Reference|reference]].
|- align="left"
| DisplayStrings|| Property || All || -Array of strings defining how objects are visualized on the {{UBIK Client}} (array items 0 and 1 only) as well as in the [[View Test Environment]] (all array items).
|- align="left"
| DisplayStringItem || Method || All || -Optional method to individually define the items of the DisplayStrings array.
|- align="left"
| NumberOfDisplayStrings || Method || All || Method to define the number of expected display strings (default = 2, set to a higher number if necessary)
|- align="left"
| ToString || Method || All || The string representation of the objectcan be overwritten here; is evaluated in most of the {{UBIK}} Studio controls.
|- align="left"
| EvaluateRowCollection|| Method || Query || Method to evaluate the base (primary) collection of result items for the current query; this member must be overwritten if the default functionality (using a database query) does not match; every single row item is validated by ValidateSingleRowResult
| ValidateSingleRowResult|| Method || Query || This member is used to validate every single row item that is evaluated in the primary collection with EvaluateRowCollection(); only items where the validation returns true will be part of the Evaluate() collection
|- align="left"
| EvaluateChildrenCollectionEvaluateBaseChildrenCollection|| Method || ViewViewItem || -Method to evaluate the base (primary) collection of children items for the current view item; this member must be overwritten if the default functionality does not match; every single parent item is validated by ValidateSingleParentResult
|- align="left"
| EvaluateParentsCollectionEvaluateBaseParentsCollection|| Method || ViewViewItem || Method to evaluate the base (primary) collection of parent items for the current viewitem; this member must be overwritten if the default functionality does not match; every single parent item is validated by ValidateSingleParentResult
|- align="left"
| EvaluateRootObjectsCollection|| Method || View|| Method to evaluate the base (primary) collection of root object items for the current view; this member must be overwritten if the default functionality does not match; every single root item is validated by ValidateSingleRootObject
|- align="left"
| ValidateSingleChildResult|| Method || View|| This member is used to validate every single child item that is evaluated in the primary collection with EvaluateChildrenCollectionEvaluateBaseChildrenCollection(); only items where the validation returns true will be part of the Children collection
|- align="left"
| ValidateSingleParentResult|| Method || View|| This member is used to validate every single parent item that is evaluated in the primary collection with EvaluateParentsCollectionEvaluateBaseParentsCollection(); only items where the validation returns true will be part of the Parents collection
|- align="left"
| ValidateSingleRootObject|| Method || View|| This member is used to validate every single root item that is evaluated in the primary collection with EvaluateRootObjectsCollection(); only items where the validation returns true will be part of the root objects collection
|- align="left"
| FilterSingleChild || Method || ViewItem || This member is used to validate every single child item that is evaluated in the primary collection with EvaluateBaseChildrenCollection(); only items where the validation returns '''false''' will be part of the Children collection
|- align="left"
| FilterSingleParent || Method || ViewItem || This member is used to validate every single parent item that is evaluated in the primary collection with EvaluateBaseParentsCollection(); only items where the validation returns '''false''' will be part of the Parents collection
|- align="left"
| PreloadBaseChildrenCollection || Method || ReferenceViewItem || Method to evaluate the collection of items that should be preloaded by the ReferenceViewItem configured as reverse evaluation; the base implementation preloads all instances of the referenced TargetMetaclass; this member must be overwritten if the default functionality does not fullfill the project requirements.
|- align="left"
| PreloadBaseParentsCollection || Method || ReferenceViewItem || Method to evaluate the collection of items that should be preloaded by the ReferenceViewItem configured as forward evaluation; the base implementation preloads all instances of the referenced TargetMetaclass; this member must be overwritten if the default functionality does not fullfill the project requirements.
|- align="left"
| PreloadBaseRelationDataCollection || Method || RelationViewItem || Method to evaluate the collection of relation data items that should be preloaded by the RelationViewItem; the base implementation preloads all relation data instances of the referenced relation; this member must be overwritten if the default functionality does not fullfill the project requirements.
|- align="left"
| PreloadBaseChildrenCollection || Method || RelationViewItem || Method to evaluate the collection of possible child items that should be preloaded by the RelationViewItem; the base implementation preloads all relation data instances of the configured Metaclass; this member must be overwritten if the default functionality does not fullfill the project requirements.
|- align="left"
| EnabledForContentObject || Method || PropertyValueValidation ||
|- align="left"
| ValidationValue || Method || PropertyValueValidation ||
|- align="left"
| CreateReferenceDescription || Method || Rule ||
|- align="left"
| CreateReferenceMetaPropertyDescription || Method || Rule ||
|- align="left"
| CreateReferenceMetaPropertyName || Method || Rule ||
|- align="left"
| CreateRelationDescription || Method || Rule ||
|- align="left"
| CreateRelationName || Method || Rule ||
|- align="left"
| CreateScopeDescription || Method || Rule ||
|- align="left"
| CreateScopeName || Method || Rule ||
|- align="left"
| CreateViewItemDescription || Method || Rule ||
|- align="left"
| CreateViewItemName || Method || Rule ||
|- align="left"
| CustomGroupRights || Method || All ||
|- align="left"
| CustomPropertyGroupRights || Method || All ||
|- align="left"
| TryConvertProxyValueFrom|| Method || Proxy||
|- align="left"
| TryConvertProxyValueTo|| Method || Proxy||
|- align="left"
| CreateProxyScannerInstance|| Method || InterfaceExecution||
|- align="left"
| ExecuteExport|| Method || InterfaceExecution||
|- align="left"
| ExecuteImport|| Method || InterfaceExecution||
|- align="left"
| AddSystemAssemblies|| Method || CustomizingClass|| Provides the possibility to define Assemblies being added to the compiler You can find an example code [[CUSTOMIZING|here]]. {{Version/ServerSince|2.5.0}}
|}
[[Category:Coding|Code Editor]]
[[Category:Studio controls|Code Editor]]
===MetaProperties===
In this view mode you can modify the code that is executed within the accessors of a {{UBIK}} [[MetaProperty]]
{{Hint|The Code Editor will not display inherited MetaProperties, but only without the ones defined directly code located at the context objectits inherit base!}}
===Custom===
In this view mode it is possible to store code which is not related to events, methods or MetaProperties but shall still be assembled with a MetaClass or with the entire customizing. Use this if you want to provide a code library or classes that shall be used by your custom event or property/method code.
* {| class="wikitable sortable" | width = "80%"|- align="left"! style="width:10em" | Section!! Exposed by !! Description|- style="text-align:left;width:30%"| Custom Object Code: this || All || The code placed here will be assembled into the class code of teh the current {{UBIK}} object. Any classes, methods, properties, etc. can be accessed via an instance of this MetaClass.* |- align="left"| UBIK Code Library: this || All || This code will be assembled only once per customizing, and is therefore available across all MetaClassesobjects. Static classes, methods, properties, etc. can be directly accessed by its type via the namespace ''UBIK.Runtime''.|}
==Code snippets==
//*** Calling UBIK Workflow: WFICON Assign icon
Dictionary<string, object> args = new Dictionary<string, object>();
IDictionary<string, object> outArgs;
args.Add("UBIKObject", this);
outArgs = UBIK.WorkflowBase.Invoker.InvokeWorkflow(this.MetaClassEnvironment.AllWorkflowsUBIKDataFactory()_.FindContentObject(p => pnew System.ID == Guid("2bf8f8e9-156d-4914-bd25-fd133148638d")) as UBIK.Kernel.Workflow, args);
//*** End of calling UBIK Workflow
</source>
This code locates the workflow object at the MetaClass of the object using its ''UID'', loads the declared [http://en.wikipedia.org/wiki/Extensible_Application_Markup_Language XAML] code and sends it to the invoker. The calling object will be passed to the workflow as first and only parameter ''UBIKObject''. {{Hint|If you need the workflow to be executed conditionally, just wrap the conditions (e.g. an <code>if</code> block around the generated snippet!}}
==Other functionality=={{Hint|If you need the workflow to be executed conditionally, just wrap the conditions (e.g. an <code>if</code> block) around the generated snippet!}}
==See also==
* [[Debugger]]
[[Category:UBIK Coding|Code Editor]][[Category:Studio Controlscontrols|Code Editor]]