Integrate WebViewer into a Mendix Web Module

This sample provides a Mendix backend module that facilitates server side operations that work with WebViewer

WebViewer provides a slick out-of-the-box responsive UI that enables you to view, annotate and manipulate PDFs and other document types inside any web project.

Click the button below to view the full project in GitHub.

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
10package webviewer.actions;
11
12import com.mendix.systemwideinterfaces.core.IContext;
13import com.mendix.webui.CustomJavaAction;
14import com.mendix.systemwideinterfaces.core.IMendixObject;
15
16public class GetFileId extends CustomJavaAction<java.lang.String>
17{
18 /** @deprecated use inputFile.getMendixObject() instead. */
19 @java.lang.Deprecated(forRemoval = true)
20 private final IMendixObject __inputFile;
21 private final webviewer.proxies.File inputFile;
22
23 public GetFileId(
24 IContext context,
25 IMendixObject _inputFile
26 )
27 {
28 super(context);
29 this.__inputFile = _inputFile;
30 this.inputFile = _inputFile == null ? null : webviewer.proxies.File.initialize(getContext(), _inputFile);
31 }
32
33 @java.lang.Override
34 public java.lang.String executeAction() throws Exception
35 {
36 // BEGIN USER CODE
37 return "" + this.inputFile.getMendixObject().getId().toLong();
38 // END USER CODE
39 }
40
41 /**
42 * Returns a string representation of this action
43 * @return a string representation of this action
44 */
45 @java.lang.Override
46 public java.lang.String toString()
47 {
48 return "GetFileId";
49 }
50
51 // BEGIN EXTRA CODE
52 // END EXTRA CODE
53}
54

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales