|
1 | | -// This file was generated by Mendix Studio Pro. |
2 | | -// |
3 | | -// WARNING: Only the following code will be retained when actions are regenerated: |
4 | | -// - the import list |
5 | | -// - the code between BEGIN USER CODE and END USER CODE |
6 | | -// - the code between BEGIN EXTRA CODE and END EXTRA CODE |
7 | | -// Other code you write will be lost the next time you deploy the project. |
8 | | -// Special characters, e.g., é, ö, à, etc. are supported in comments. |
9 | | - |
10 | | -package communitycommons.actions; |
11 | | - |
12 | | -import com.mendix.systemwideinterfaces.core.IMendixObject; |
13 | | -import communitycommons.ORM; |
14 | | -import com.mendix.systemwideinterfaces.core.IContext; |
15 | | -import com.mendix.webui.CustomJavaAction; |
16 | | - |
17 | | -/** |
18 | | - * Clones objects |
19 | | - * |
20 | | - * - Source: the original object to copy |
21 | | - * - Target: the object to copy it into (should be of the same type, or a specialization) |
22 | | - * - includeAssociations: whether to clone associations. |
23 | | - * |
24 | | - * If associated objects need to be cloned as well, use deepClone, this function only copies the references, not the reffered objects. Target is not committed automatically. |
25 | | - */ |
26 | | -public class Clone extends CustomJavaAction<java.lang.Boolean> |
27 | | -{ |
28 | | - private IMendixObject source; |
29 | | - private IMendixObject target; |
30 | | - private java.lang.Boolean withAssociations; |
31 | | - |
32 | | - public Clone(IContext context, IMendixObject source, IMendixObject target, java.lang.Boolean withAssociations) |
33 | | - { |
34 | | - super(context); |
35 | | - this.source = source; |
36 | | - this.target = target; |
37 | | - this.withAssociations = withAssociations; |
38 | | - } |
39 | | - |
40 | | - @java.lang.Override |
41 | | - public java.lang.Boolean executeAction() throws Exception |
42 | | - { |
43 | | - // BEGIN USER CODE |
44 | | - return ORM.cloneObject(this.getContext(), source, target, withAssociations); |
45 | | - // END USER CODE |
46 | | - } |
47 | | - |
48 | | - /** |
49 | | - * Returns a string representation of this action |
50 | | - * @return a string representation of this action |
51 | | - */ |
52 | | - @java.lang.Override |
53 | | - public java.lang.String toString() |
54 | | - { |
55 | | - return "Clone"; |
56 | | - } |
57 | | - |
58 | | - // BEGIN EXTRA CODE |
59 | | - // END EXTRA CODE |
60 | | -} |
| 1 | +// This file was generated by Mendix Studio Pro. |
| 2 | +// |
| 3 | +// WARNING: Only the following code will be retained when actions are regenerated: |
| 4 | +// - the import list |
| 5 | +// - the code between BEGIN USER CODE and END USER CODE |
| 6 | +// - the code between BEGIN EXTRA CODE and END EXTRA CODE |
| 7 | +// Other code you write will be lost the next time you deploy the project. |
| 8 | +// Special characters, e.g., é, ö, à, etc. are supported in comments. |
| 9 | + |
| 10 | +package communitycommons.actions; |
| 11 | + |
| 12 | +import com.mendix.systemwideinterfaces.core.IMendixObject; |
| 13 | +import communitycommons.ORM; |
| 14 | +import com.mendix.systemwideinterfaces.core.IContext; |
| 15 | +import com.mendix.webui.CustomJavaAction; |
| 16 | + |
| 17 | +/** |
| 18 | + * Clones objects |
| 19 | + * |
| 20 | + * - Source: the original object to copy |
| 21 | + * - Target: the object to copy it into (should be of the same type, or a specialization) |
| 22 | + * - includeAssociations: whether to clone associations. |
| 23 | + * |
| 24 | + * If associated objects need to be cloned as well, use deepClone, this function only copies the references, not the reffered objects. Target is not committed automatically. |
| 25 | + */ |
| 26 | +public class Clone extends CustomJavaAction<java.lang.Boolean> |
| 27 | +{ |
| 28 | + private IMendixObject source; |
| 29 | + private IMendixObject target; |
| 30 | + private java.lang.Boolean withAssociations; |
| 31 | + |
| 32 | + public Clone(IContext context, IMendixObject source, IMendixObject target, java.lang.Boolean withAssociations) |
| 33 | + { |
| 34 | + super(context); |
| 35 | + this.source = source; |
| 36 | + this.target = target; |
| 37 | + this.withAssociations = withAssociations; |
| 38 | + } |
| 39 | + |
| 40 | + @java.lang.Override |
| 41 | + public java.lang.Boolean executeAction() throws Exception |
| 42 | + { |
| 43 | + // BEGIN USER CODE |
| 44 | + return ORM.cloneObject(this.getContext(), source, target, withAssociations); |
| 45 | + // END USER CODE |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Returns a string representation of this action |
| 50 | + * @return a string representation of this action |
| 51 | + */ |
| 52 | + @java.lang.Override |
| 53 | + public java.lang.String toString() |
| 54 | + { |
| 55 | + return "Clone"; |
| 56 | + } |
| 57 | + |
| 58 | + // BEGIN EXTRA CODE |
| 59 | + // END EXTRA CODE |
| 60 | +} |
|
0 commit comments