Difference between revisions of "HowTo:Customize Templates and Replication"
(Created page with "With {{UBIK}}, it is possible to replicate (basically, copy and paste) objects and even complex object hierarchies, based on a template configuration. This article explains w...") |
(→Server side replication) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
In case of client side replication, the mobile client application provides a {{key press|Copy}} and a {{key press|Paste}} button that can be used to replicate an object directly in the app. | In case of client side replication, the mobile client application provides a {{key press|Copy}} and a {{key press|Paste}} button that can be used to replicate an object directly in the app. | ||
− | For this, you have to add the [[SYSCLS_TEMPLATABLE_DATA|Templatable Data Classification]] to the ACM context scope of the [[MetaClass]] you want to be templatable. It is important to note that the ISTEMPLATE property of this classification has some interesting implicit behavior: If the lock status of this property is set to read-only in the ACM scope, all other properties will be read-only, too. If you don't want the user to modify the ISTEMPLATE property, but you need them to modify other properties, just set the visibility of ISTEMPLATE to hidden, but leave the lock status at read-write. | + | For this, you have to add the [[SYSCLS_TEMPLATABLE_DATA|Templatable Data Classification]] to the ACM context scope of the [[MetaClass]] you want to be templatable. |
+ | |||
+ | It is important to note that the ISTEMPLATE property of this classification has some interesting implicit behavior: If the lock status of this property is set to read-only in the ACM scope, all other properties will be read-only, too. If you don't want the user to modify the ISTEMPLATE property, but you need them to modify other properties, just set the visibility of ISTEMPLATE to hidden, but leave the lock status at read-write. | ||
+ | |||
+ | Also, if you want to paste an object somewhere, the respective ACM scope must be a possible child of the parent scope. So, you have to configure the ACM to allow the copy to be pasted below the new parent object. | ||
+ | |||
== Server side replication == | == Server side replication == | ||
Line 25: | Line 30: | ||
Finally, you need to create some custom code actually executing the replication. For example, let's say we want to copy an object when it is saved. You have to fetch the replication configuration and the thing you want to replicate. Then, you can call the replicate method of the configuration object, with the replication target as a parameter. The result will be a collection of replicated objects. | Finally, you need to create some custom code actually executing the replication. For example, let's say we want to copy an object when it is saved. You have to fetch the replication configuration and the thing you want to replicate. Then, you can call the replicate method of the configuration object, with the replication target as a parameter. The result will be a collection of replicated objects. | ||
− | The respective code could look like the following: | + | The respective code could look like the following (example from a real project): |
<source lang = "csharp"> | <source lang = "csharp"> | ||
Line 68: | Line 73: | ||
} | } | ||
</source> | </source> | ||
+ | |||
+ | [[Category:Coding|Customize Templates and Replication]] | ||
+ | [[Category:How-To|Customize Templates and Replication]] | ||
+ | [[Category:Replicating|Customize Templates and Replication]] | ||
+ | [[Category:Version 2.6|Customize Templates and Replication]] | ||
+ | [[Category:WinX|Customize Templates and Replication]] | ||
==See also== | ==See also== | ||
Line 74: | Line 85: | ||
* [[SYSCLS_TEMPLATABLE_DATA|Templatable Data Classification for client side replication]] | * [[SYSCLS_TEMPLATABLE_DATA|Templatable Data Classification for client side replication]] | ||
* [[Data_Replication_(UBIK_Client)]] | * [[Data_Replication_(UBIK_Client)]] | ||
+ | |||
+ | [[Category:How-To|Customize Templates and Replication]] | ||
+ | [[Category:Replicating|Customize Templates and Replication]] | ||
+ | [[Category:WinX|Customize Templates and Replication]] | ||
+ | [[Category:Version 2.6|Customize Templates and Replication]] | ||
+ | [[Category:Coding|Customize Templates and Replication]] |
Latest revision as of 12:36, 9 September 2021
With UBIK®, it is possible to replicate (basically, copy and paste) objects and even complex object hierarchies, based on a template configuration.
This article explains what options you have to enable this and how to do it in your project customizing.