|
1 | | -// This file was generated by Mendix Modeler. |
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.StringUtils; |
14 | | -import com.mendix.systemwideinterfaces.core.IContext; |
15 | | -import com.mendix.webui.CustomJavaAction; |
16 | | - |
17 | | -/** |
18 | | - * Stores an base 64 encoded string plain in the provided target file document |
19 | | - * |
20 | | - * Note that targetFile will be committed. |
21 | | - */ |
22 | | -public class Base64DecodeToFile extends CustomJavaAction<Boolean> |
23 | | -{ |
24 | | - private String encoded; |
25 | | - private IMendixObject __targetFile; |
26 | | - private system.proxies.FileDocument targetFile; |
27 | | - |
28 | | - public Base64DecodeToFile(IContext context, String encoded, IMendixObject targetFile) |
29 | | - { |
30 | | - super(context); |
31 | | - this.encoded = encoded; |
32 | | - this.__targetFile = targetFile; |
33 | | - } |
34 | | - |
35 | | - @Override |
36 | | - public Boolean executeAction() throws Exception |
37 | | - { |
38 | | - this.targetFile = __targetFile == null ? null : system.proxies.FileDocument.initialize(getContext(), __targetFile); |
39 | | - |
40 | | - // BEGIN USER CODE |
41 | | - StringUtils.base64DecodeToFile(getContext(), encoded, targetFile); |
42 | | - return true; |
43 | | - // END USER CODE |
44 | | - } |
45 | | - |
46 | | - /** |
47 | | - * Returns a string representation of this action |
48 | | - */ |
49 | | - @Override |
50 | | - public String toString() |
51 | | - { |
52 | | - return "Base64DecodeToFile"; |
53 | | - } |
54 | | - |
55 | | - // BEGIN EXTRA CODE |
56 | | - // END EXTRA CODE |
57 | | -} |
| 1 | +// This file was generated by Mendix Modeler. |
| 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.StringUtils; |
| 14 | +import com.mendix.systemwideinterfaces.core.IContext; |
| 15 | +import com.mendix.webui.CustomJavaAction; |
| 16 | + |
| 17 | +/** |
| 18 | + * Stores an base 64 encoded string plain in the provided target file document |
| 19 | + * |
| 20 | + * Note that targetFile will be committed. |
| 21 | + */ |
| 22 | +public class Base64DecodeToFile extends CustomJavaAction<Boolean> |
| 23 | +{ |
| 24 | + private String encoded; |
| 25 | + private IMendixObject __targetFile; |
| 26 | + private system.proxies.FileDocument targetFile; |
| 27 | + |
| 28 | + public Base64DecodeToFile(IContext context, String encoded, IMendixObject targetFile) |
| 29 | + { |
| 30 | + super(context); |
| 31 | + this.encoded = encoded; |
| 32 | + this.__targetFile = targetFile; |
| 33 | + } |
| 34 | + |
| 35 | + @Override |
| 36 | + public Boolean executeAction() throws Exception |
| 37 | + { |
| 38 | + this.targetFile = __targetFile == null ? null : system.proxies.FileDocument.initialize(getContext(), __targetFile); |
| 39 | + |
| 40 | + // BEGIN USER CODE |
| 41 | + StringUtils.base64DecodeToFile(getContext(), encoded, targetFile); |
| 42 | + return true; |
| 43 | + // END USER CODE |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * Returns a string representation of this action |
| 48 | + */ |
| 49 | + @Override |
| 50 | + public String toString() |
| 51 | + { |
| 52 | + return "Base64DecodeToFile"; |
| 53 | + } |
| 54 | + |
| 55 | + // BEGIN EXTRA CODE |
| 56 | + // END EXTRA CODE |
| 57 | +} |
0 commit comments