Current Page: NeXtMidas User's Guide WebSwing to deploy NeXtMidas as a Web App
| ### Deploying NeXtMidas as a Web Application using WebSwing WebSwing is an Open Source application that allows Java Swing applications to run a Web App. We, as well as a number of users, are looking into WebSwing being at least a partial solution for Java removing WebStart from JDK 11+ and having deprecated Applets (most browsers no longer support these anyhow). Though this is in the EXPERIMENTAL phase, we are providing some quick start instructions. We encourage users to see if WebSwing might meet their needs, and wanted to get at least this level of information out to users in the NeXtMidas 3.9.2 release. You are welcome to contact us with questions or for information on how to see a basic demo of NeXtMidas running as a web app via WebSwing. For typing in a Shell GUI brought up via WebSwing to work properly, NextMidas 3.9.2+ is required. #### Topics covered in this page Basic steps to install WebSwing and run NextMidas (from jar files) as a Web App Adjustments to bring up the Shell GUI from class files Adjustments to run percent macros from class files, by specifying them as the args in the URL Known Issues Residual graphics on popups - solved with refresh Sizing and resizing browser window issues Early Firefox (pre 53.0) with certain configuration is stealing right-clicks #### Basic steps to install WebSwing and run NextMidas (from jar files) as a Web App download WebSwing zip file copy and extract it where desired make sure JAVA_HOME is pointing to correct Java may need to run dos2unix on the on the webswing.sh file may need to sudo yum install dos2unix if not on your box when not running from a Dockerfile (Dockerfile would generally install dependencies and run webswing.sh: may need to install some dependencies xorg-x11-server-Xvfb-1.20.4-7.el7.x86_64 libXi-1.7.9-1.el7.x86_64 libXtst-1.2.3-1.el7.x86_64 xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps which cd into webswing folder ./webswing.sh start on your browser got to localhost:8080 enter the following: for username: admin for password: pwd click "manage" click "create new app" enter path for the url where you want your application to be hosted click "configure" in the Configuration Menu we set: under Security Security Module Name INHERITED for user name and password NONE for immediate access under Application General name: ... whatever you want .../li> font point to where your font is: ex: /usr/share/fonts/dejavu/DejavuSansMono.tff if need to yum install font for DejavuSansMono.tff: yum install dejavu-fonts-common add name for the font turn OFF DirectDraw Rendering under Application Java Working Directory build your code first (if using Docker, move code to Docker container) enter the path to your Java project Classpath: should point to folder containing your jars ex: path-to-nextmidas/jars/* JVM Arguments set as you need ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT="classpath" under Launcher Configuration Main class put yours we put: nxm.sys.lib.NeXtMidas Main Arguments put your path and command arguments - follow NXM docs for demo we put: path="SYS,DSP,UCL,NET,AUDIO,DATABASE,HWC" -cmd="demo" for the percent macro test_panel_menubar we put: path="SYS,DSP,UCL,NET,AUDIO,DATABASE,HWC" aux.homepath="path-to-nextmidas/nxm/sys/test" -cmd="%test_panel_menubar" to pass in the percent macro name in the url URL could be: http://nextmidas.com:8443/nxm-percent-macro/?args=test_plot_latloncontinuous and just updated the -cmd to be: -cmd="%${customArgs}" under Application - Session Max Connections - set to what desired Session Mode - 3 options are: CONTINUE_FOR_BROWSER CONTINUE_FOR_USER ALWAYS_NEW_SESSION otherwise we used the defaults when done, click "Apply" "Enable" this application if not already enabled go to the url and it will start the application #### Adjustments to bring up the Shell GUI from class files: in the Configuration Menu we set: under Application Java Classpath: should point to nextmidas tools folder ex: path-to-nextmidas/tools JVM Arguments set as you need: ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT=path-to-nextmidas -DHOME=path-to-percent-macros i.e. -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT=${webswing.rootDir}/release/nextmidas/ -DHOME=${webswing.rootDir}/release/nextmidas/nxm/sys/test under Launcher Configuration Main class: NmClassLoader Main Arguments: shell #### Adjustments to run percent macros from class files, by specifying them as the args in the URL: in the Configuration Menu we set: under Application Java Classpath: should point to nextmidas tools folder ex: path-to-nextmidas/tools JVM Arguments set as you need: ours were: -DNONATIVE=FALSE -DNMPID=1234 -DNMROOT=path-to-nextmidas under Launcher Configuration Main class: NmClassLoader Main Arguments: %${customArgs} #### Known Issues: Residual graphics on popups - solved with refresh Sizing and resizing browser window issues resizing the browser window can cause Midas panel based GUIs to allow panes to be dragged beyond panel bounds Java Sing based GUIs may need preferred size adjustments Early Firefox (pre 53.0) with certain configuration is stealing right-clicks Chrome, Firefox 53, and Edge have not seemd to ever have this issue Firefox versions earlier then 53.0 have a known issue with stealing right clicks, but even then we have not been able to replicate this issue seen by users