Jump to: navigation, search

Changes


Data Replication (UBIK Client)

3,179 bytes added, 15:45, 14 January 2021
The {{UBIK}} WinX client supports clients support data replication mechanism so that users can create and maintain data more efficiently. For example, a user can quickly replicate a local branch and create multiple copies of it in other parts of the hierarchy.{{Hint|The feature is demonstrated below using UBIK.UWP. However, with some XAML customizings, it is also available in UBIK.Xamarin because of the shared [[#XAML_Commands|XAML commands]].}}
== Copy & paste ==
* [[media:UBIK_WinX_UI_Data_Template_Selection.mp4|Filtering & Selecting data templates]]
 
{{Clear}}
 
== XAML Commands ==
 
=== Show available data templates ===
 
The AddTemplatableDataCommand can be used for this. It support the following parameter.
* Uid: Mandatory, specifies the Uid of the [[SYSCLS_OFFLINE_TEMPLATE_QUERY|offline data template query]];
* FilterContext: Optional, specifies the Uid of the context object from which the filter criteria values should be extracted and used. If unspecified, the current parent/context object where the command is triggered is used;
* EnableFilloutCriteria: Optional, whether the filter criteria of the offline data template query should be automatically filled out using the FilterContext. False if unspecified;
* SkipDialog: Optional* (see attention below), whether the app should skip showing the compact dialog and jump right to the full query page for displaying results. False if unspecified.
 
{{Attention|Since UBIK.Xamarin presents most results in pages instead of dialogs due to device dimensions, SkipDialog should always be set to True there.}}
 
<tabs>
<tab name="UWP">
<source lang = "xml">
<Button
...
xmlns:controls="using:UBIK.WinX.Controls"
x:Name="SomeRandomButton"
DataContext="{Binding}"
Command="{Binding AddTemplatableDataCommand}">
<Button.CommandParameter>
<controls:KeyValueList>
<controls:KeyValueParameter Key="Uid" Value="{Binding DataContext.OfflineTemplateQueries[0].UID, ElementName=SomeRandomButton}" />
<controls:KeyValueParameter Key="FilterContext" Value="01475137-5028-400B-8E03-AB66C2444D30" />
<controls:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
<controls:KeyValueParameter Key="SkipDialog" Value="false" />
</controls:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
</tab>
 
<tab name="Xamarin">
<source lang = "xml">
<Button
...
xmlns:classes="clr-namespace:UBIK.CPL.Classes;assembly=UBIK.CPL"
x:Name="SomeRandomButton"
BindingContext="{Binding}"
Command="{Binding AddTemplatableDataCommand}">
<Button.CommandParameter>
<classes:KeyValueList>
<classes:KeyValueParameter Key="Uid" Value="{Binding BindingContext.OfflineTemplateQueries[0].UID, Source={x:Reference SomeRandomButton}}" />
<classes:KeyValueParameter Key="FilterContext" Value="01475137-5028-400B-8E03-AB66C2444D30" />
<classes:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
<classes:KeyValueParameter Key="SkipDialog" Value="true" />
</classes:KeyValueList>
</Button.CommandParameter>
</Button>
</source>
</tab>
</tabs>
 
=== Replicating data templates ===
There are two commands for this.
* ReplicateAsDataCommand
* ReplicateAsTemplateCommand
Both replicate the current context object/branch and require no additional parameters. Their differences are explained [[#Replicating_data_templates|above]].
[[Category:Version 3.1|Data Replication (UBIK WinX)]]
[[Category:WinX|Data Replication (UBIK WinX)]]
[[Category:Client|Data Replication (UBIK Client)]]
[[Category:Xamarin|Data Replication (UBIK Client)]]