Jump to: navigation, search

Difference between revisions of "Data Replication (UBIK Client)"


(Show available data templates)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The {{UBIK}} WinX client supports 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.
+
The {{UBIK}} 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 ==
 
== Copy & paste ==
 
[[File:UBIK_WinX_UI_Copy_Content.gif|frame]]
 
  
 
On way to replicate data is through the copy & paste mechanism. A typical use case is as the following.
 
On way to replicate data is through the copy & paste mechanism. A typical use case is as the following.
Line 27: Line 26:
 
* or another copy is triggered, which overrides the old copy;
 
* or another copy is triggered, which overrides the old copy;
 
* or the copied branch is no longer available (E.g. deleted)}}
 
* or the copied branch is no longer available (E.g. deleted)}}
 
[[File:UBIK_WinX_UI_Paste_Content.gif|frame]]
 
  
 
=== Regarding paste ===
 
=== Regarding paste ===
Line 39: Line 36:
 
{{Attention|It is possible that some children (directly/indirectly) under the branch root are not copied even though they are locally available. For example, if a branch root workpackage is configured in a way that clients are not allowed to create tasks underneath. The client cannot violate that rule and, therefore, will ignore these tasks during replication. A quick way to check whether that's the case on the client is to browse to e.g. that workpackage and see if it's possible to create a task.}}
 
{{Attention|It is possible that some children (directly/indirectly) under the branch root are not copied even though they are locally available. For example, if a branch root workpackage is configured in a way that clients are not allowed to create tasks underneath. The client cannot violate that rule and, therefore, will ignore these tasks during replication. A quick way to check whether that's the case on the client is to browse to e.g. that workpackage and see if it's possible to create a task.}}
  
== Data templates{{Version/WinXSince|3.2.0}} ==
+
== Data templates{{Version/WinXSince|4.9}}{{Version/XamarinSince|4.9}} ==
 
On top of the standard copy & paste mechanism, {{UBIK}} also supports a certain type of objects, namely data templates to help organize and present what the users can replicate under different hierarchical contexts.
 
On top of the standard copy & paste mechanism, {{UBIK}} also supports a certain type of objects, namely data templates to help organize and present what the users can replicate under different hierarchical contexts.
  
Line 48: Line 45:
 
* The users browse to a certain context in the hierarchy where creating a certain type of objects (classified as templatable data) is allowed;
 
* The users browse to a certain context in the hierarchy where creating a certain type of objects (classified as templatable data) is allowed;
 
* There is at least one offline query configured that queries against that type of objects;
 
* There is at least one offline query configured that queries against that type of objects;
* The users click a button (in the top-right corner of the child area by default) to check what can be copied and pasted under the current context;
+
* The users click a button (see [[Data_Replication_(UBIK_Client)#Show_available_data_templates|example "Show available data templates"]]) to check what can be copied and pasted under the current context;
* The result list is determined by the offline query (the one selected by the users if there are more than one). {{UBIK}} will try to automatically fill out all query criteria by extracting relevant information from the context (those that cannot be found will simply be ignored/skipped);
+
* The result list is determined by the configured offline query. {{UBIK}} will try to automatically fill out all query criteria by extracting relevant information from the context (those that cannot be found will simply be ignored/skipped);
* The list is initially presented in a dialog. However, if the users do not find the data templates they are looking for, or there are still too many in the list, they can click the {{key press|...}} button to open the offline query page and manually query for results;
+
* If the users do not find the data templates they are looking for, or there are still too many in the list, they can [[Offline_Query_(UBIK_WinX)#Query_with_context_filter_values|manually enter values]] (either to overrule the context filter value or add extra filter values) and reevaluate the query for results.
* By default, all data templates displayed in the list can be expanded (otherwise known as the double level view feature) so that users get the chance to easily check what's underneath.
+
 
+
{{Hint|Since the same queries are used every time users look for available data templates, their criteria are reset every time so that any criteria set manually by the users previously do not affect future querying. Nevertheless, the context information (if there is any) is still extracted and used automatically during each querying.}}
+
  
 
=== Replicating data templates ===
 
=== Replicating data templates ===
[[File:UBIK_WinX_UI_Data_Template_As_Data.gif|frame]]
 
[[File:UBIK_WinX_UI_Data_Template_As_Template.gif|frame]]
 
 
Essentially, replicating using data templates is nothing more than regular copying & pasting objects instances. They will carry the same information (property values, display strings, etc.) as the original data templates. However, according to whether the replicated instances appear in the selection list afterwards, the replication can be divided into two types.
 
Essentially, replicating using data templates is nothing more than regular copying & pasting objects instances. They will carry the same information (property values, display strings, etc.) as the original data templates. However, according to whether the replicated instances appear in the selection list afterwards, the replication can be divided into two types.
  
 
==== As regular data ====
 
==== As regular data ====
In this case, the replicated instances will not appear in the template selection list. This can be done by clicking/tapping the data template item in the list.
+
In this case, the replicated instances will not appear in the template selection list.
  
 
A typical user scenario of this is field workers generating a large number of work packages out of existing data templates.
 
A typical user scenario of this is field workers generating a large number of work packages out of existing data templates.
  
 
==== As data templates ====
 
==== As data templates ====
In this case, the replicated instances will appear in the template selection list. This can be done by clicking/tapping the additional button (at the right side by default) in each data template item.
+
In this case, the replicated instances will appear in the template selection list.
  
 
A typical user scenario of this is administrators/work planners creating work package data templates from similar templates that already exist.
 
A typical user scenario of this is administrators/work planners creating work package data templates from similar templates that already exist.
  
== Demo Videos ==
+
== XAML Commands ==
* [[media:UBIK_WinX_UI_Copy_Paste_Branch.mp4|Copy & pasting a branch]]
+
  
* [[media:UBIK_WinX_UI_Copy_Paste_Documents.mp4|Copy & pasting documents with files]]
+
=== Show available data templates ===
  
* [[media:UBIK_WinX_UI_Copy_Paste_Availability.mp4|When copy or paste is impossible]]
+
The AddTemplatableDataCommand can be used for this. It supports the following parameters.
 +
* 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 or the default parent/context object. False if unspecified.
 +
 
 +
<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="UID_OF_YOUR_CHOSEN_QUERY" />
 +
            <controls:KeyValueParameter Key="FilterContext" Value="UID_OF_YOUR_CHOSEN_CONTEXT_OBJECT" />
 +
            <controls:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
 +
        </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="UID_OF_YOUR_CHOSEN_QUERY" />
 +
            <classes:KeyValueParameter Key="FilterContext" Value="UID_OF_YOUR_CHOSEN_CONTEXT_OBJECT" />
 +
            <classes:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
 +
        </classes:KeyValueList>
 +
    </Button.CommandParameter>
 +
</Button>
 +
</source>
 +
</tab>
 +
</tabs>
 +
 
 +
[[Category:Client|Data Replication (UBIK Client)]]
 +
[[Category:Version 3.1|Data Replication (UBIK WinX)]]
 +
[[Category:WinX|Data Replication (UBIK WinX)]]
 +
[[Category:Xamarin|Data Replication (UBIK Client)]]
 +
 
 +
=== 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]].
 +
 
 +
{{Hint|ReplicateAsTemplateCommand is only available if the user is allowed to do so. Please refer to the [[SYSCLS_TEMPLATABLE_DATA|relevant classification]] for details.}}
 +
 
 +
[[Category:Client|Data Replication (UBIK Client)]]
 +
[[Category:Version 3.1|Data Replication (UBIK WinX)]]
 +
[[Category:WinX|Data Replication (UBIK WinX)]]
 +
[[Category:Xamarin|Data Replication (UBIK Client)]]
  
* [[media:UBIK_WinX_UI_Data_Template_Selection.mp4|Filtering & Selecting data templates]]
+
== See also ==
 +
* [[HowTo:Customize_Templates_and_Replication]]
 +
* [[SYSCLS_TEMPLATABLE_DATA]]
 +
* [[Offline_Query_(UBIK_WinX)#Query_with_context_filter_values|Query with context filter values]]
  
 +
[[Category:Client|Data Replication (UBIK Client)]]
 
[[Category:Version 3.1|Data Replication (UBIK WinX)]]
 
[[Category:Version 3.1|Data Replication (UBIK WinX)]]
 
[[Category:WinX|Data Replication (UBIK WinX)]]
 
[[Category:WinX|Data Replication (UBIK WinX)]]
 +
[[Category:Xamarin|Data Replication (UBIK Client)]]

Latest revision as of 14:47, 12 November 2024

The UBIK® 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.

IC Hint square.pngThe 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.

Copy & paste

On way to replicate data is through the copy & paste mechanism. A typical use case is as the following.

  • Navigates to the branch that should be replicated;
  • Brings up the bottom app bar and press Copy;
  • Navigates to the destination where the branch should be replicated;
  • Brings up the bottom app bar and press Paste.

In principal, the usage is comparable to the copy & paste mechanisms in any other apps out there. However, there are some unique UBIK® details worthing mentioning.

Regarding copy

When copying, an entire branch is involved. This includes

  • The branch root object and all its local children (direct or indirect);
  • Files of all (in)direct child documents. However, there are exceptions to this, namely
    • if a file download fails;
    • if the app is in offline mode.
  • The data of the above mentioned objects: Display strings, user rights, etc.;
  • The properties of the above mentioned objects: Their values, user rights, validations, etc.;
    • All data users can interact with (e.g. values, validations) will only be copied if the MetaProperty allows.

The Copy action is only available when the app initialization is complete and there is something to copy in the specified branch.

IC Hint square.pngValidity of a copy: After triggering a copy, users can paste the same branch as many time as they want until
  • either users log out;
  • or another copy is triggered, which overrides the old copy;
  • or the copied branch is no longer available (E.g. deleted)

Regarding paste

When pasting, an entirely independent copy of the specified branch is created and added as a child of the destination object. The Paste action is only available when

  • The user has triggered a copy and it is still valid (see Hint|Validity of a copy);
  • And the destination object allows modification. In other words, it is not locked due to user rights, MRO status or scan status;
  • And the destination object allows the root of the copied branch as a child object. Namely the creation of the branch root's MetaClass should be allowed in the destination MetaClass. (See step 8).
IC Attention.pngIt is possible that some children (directly/indirectly) under the branch root are not copied even though they are locally available. For example, if a branch root workpackage is configured in a way that clients are not allowed to create tasks underneath. The client cannot violate that rule and, therefore, will ignore these tasks during replication. A quick way to check whether that's the case on the client is to browse to e.g. that workpackage and see if it's possible to create a task.

Data templates

On top of the standard copy & paste mechanism, UBIK® also supports a certain type of objects, namely data templates to help organize and present what the users can replicate under different hierarchical contexts.

Selecting & Querying data templates

A major issue with the standard copy & paste mechanism is its relatively low efficiency when users need to copy & paste the same object instances to different locations in the hierarchy many times, especially when the total number of available source instances grows larger. The users would have to find the instance they want to replicate out of the many and repeat that process for every round of copy & paste.

To improve the usability in this case, UBIK® allows classifying objects in a way that they are queried against and presented when users want to see what they can copy & paste under a certain hierarchical context. More specifically, it works as the following.

  • The users browse to a certain context in the hierarchy where creating a certain type of objects (classified as templatable data) is allowed;
  • There is at least one offline query configured that queries against that type of objects;
  • The users click a button (see example "Show available data templates") to check what can be copied and pasted under the current context;
  • The result list is determined by the configured offline query. UBIK® will try to automatically fill out all query criteria by extracting relevant information from the context (those that cannot be found will simply be ignored/skipped);
  • If the users do not find the data templates they are looking for, or there are still too many in the list, they can manually enter values (either to overrule the context filter value or add extra filter values) and reevaluate the query for results.

Replicating data templates

Essentially, replicating using data templates is nothing more than regular copying & pasting objects instances. They will carry the same information (property values, display strings, etc.) as the original data templates. However, according to whether the replicated instances appear in the selection list afterwards, the replication can be divided into two types.

As regular data

In this case, the replicated instances will not appear in the template selection list.

A typical user scenario of this is field workers generating a large number of work packages out of existing data templates.

As data templates

In this case, the replicated instances will appear in the template selection list.

A typical user scenario of this is administrators/work planners creating work package data templates from similar templates that already exist.

XAML Commands

Show available data templates

The AddTemplatableDataCommand can be used for this. It supports the following parameters.

  • Uid: Mandatory, specifies the Uid of the 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 or the default parent/context object. False if unspecified.

UWP

<Button
   ...
   xmlns:controls="using:UBIK.WinX.Controls"
   x:Name="SomeRandomButton"
   DataContext="{Binding}"
   Command="{Binding AddTemplatableDataCommand}">
    <Button.CommandParameter>
        <controls:KeyValueList>
            <controls:KeyValueParameter Key="Uid" Value="UID_OF_YOUR_CHOSEN_QUERY" />
            <controls:KeyValueParameter Key="FilterContext" Value="UID_OF_YOUR_CHOSEN_CONTEXT_OBJECT" />
            <controls:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
        </controls:KeyValueList>
    </Button.CommandParameter>
</Button>

Xamarin

<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="UID_OF_YOUR_CHOSEN_QUERY" />
            <classes:KeyValueParameter Key="FilterContext" Value="UID_OF_YOUR_CHOSEN_CONTEXT_OBJECT" />
            <classes:KeyValueParameter Key="EnableFillOutCriteria" Value="true" />
        </classes:KeyValueList>
    </Button.CommandParameter>
</Button>

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 above.

IC Hint square.pngReplicateAsTemplateCommand is only available if the user is allowed to do so. Please refer to the relevant classification for details.

See also