Difference between revisions of "Dynamic Selective List (Client)"
Line 13: | Line 13: | ||
* Through this Guid link, it's possible to get all property values on the selected item. | * Through this Guid link, it's possible to get all property values on the selected item. | ||
− | == | + | == Resolving dynamic items == |
The crucial part of this new solution is that it's dynamic, meaning the items to choose from can vary upon data changes of the following. | The crucial part of this new solution is that it's dynamic, meaning the items to choose from can vary upon data changes of the following. | ||
Revision as of 11:29, 23 November 2021
In property editing, UBIK® supports defining a list of values for users to choose from instead of letting them enter arbitrary values. These are what we call selective lists and selective list items.
Contents
Static & dynamic versions
Previously, such a list and list items are static and parts of a MetaProperty, which means it's difficult or even impossible to update once they are configured and delivered to the clients in productive environments.
In some scenarios where such lists or list items are known to change quite often, a more dynamic version is needed.
Technical concept
The items of a dynamic selective list are instances of ContentClass, also known as UBIK® objects. So picking a dynamic selective list item is just like picking a query result item during editing a Guid/link property. In fact, properties having dynamic selective lists are Guid properties and the feature is based on the same technology as the general Guid property editing. In other words:
- The items are found through a filter query (specifically a DSL_QUERY);
- The display strings of the selected item are presented as the display value of the property;
- The UID of the object/item is the actual value of the property;
- Through this Guid link, it's possible to get all property values on the selected item.
Resolving dynamic items
The crucial part of this new solution is that it's dynamic, meaning the items to choose from can vary upon data changes of the following.
Data hierarchy
To resolve the suitable dynamic selective list items, UBIK® first looks for so-called dependency objects, namely objects that the property being edited depends on. This is done through checking the data hierarchy upward, starting from the object being edited, with the following rules:
- The process is recursive. UBIK® looks up the hierarchy until it either reaches the top/root or finds an object with the dependency property.
- An object can have multiple parent objects. All those parents are taken into account in the item resolving process. Finding one dependency object along a parent lineage doesn't stop UBIK® from checking the other lineages and this is why it's possible to have multiple dependency objects.
- It's also possible that the dependency object is the one being edited itself.
The property values found on multiple dependency objects are used in the follow-up querying process with a "logic or" relation. For example, if a string value "A" is found on one suitable dependency object and "B" on another, the query will return those dynamic selective list items having either "A" or "B" in their QUERY_CRITERION_NAME'd property values. |
Dependency property values
Dependency property values are those values that directly determine which dynamic selective list items are available. Once UBIK® finds the dependency objects in the data hierarchy, it tries to extract values from the specified properties (dependency property name) on those objects.
The values are then used as inputs for the filter query (configured on the property being edited) according to the dynamic selective list criteria. From there on, the item resolving process becomes identical to offline querying.
Specially speaking, the multiple values are used with a value definition of "in a collection" during the querying process, effectively applying them in a "logic or" relation. Like in the general offline query feature, individual string values are compared using string contains whereas other types are compared using equality. |
Dynamic selective list criteria
UBIK® relies on special objects with the DSL_Criterion_CLS to resolve items dynamically. These objects carry the following properties and each of them serves a different purpose of configurability.
- DYNAMIC_SELECTIVE_LIST: The Guid of the DSL_QUERY instance that should be used in resolving dynamic selective list items.
- DEPENDENCY_CLASS: (Optional) The Guid of the MetaClass which instructs UBIK® the type of objects to exclusively look for when searching for dependency objects in the data hierarchy. If unspecified, any object having the specified dependency property can be a dependency object.
- DEPENDENCY_PROPERTY_NAME: The name of the property whose values determine the dynamic selective list items.
- QUERY_CRITERION_NAME: The name of the property that the resolved dependency property values should be filled into for querying.
- IS_MULTI_VALUE_STRING: (Optional) Whether the value of the dependency property should be interpreted as multiple string values separated by ";". Defaults to false.
- IGNORE_NULL: (Optional) Whether null dependency property values should serve as a filtering criterion or be ignored. Defaults to false.