implementation structure of cadviewer-script-library using Servlets
The repository contains a full setup of CADViewer with CAD Converters and script controllers for Servlets. It must be installed under tomcat /webapps/cadviewer. For war versions, please visit our download site.
1: CADViewer Servlet script library - in its preferred folder structure
2: AutoXchange AX2023 Converter and DWG Merge 2023 Converter - in their preferred folder structure
3: All structures for file-conversion, sample drawings, redlines, etc.
4: A number of HTML files with CADViewer samples.
5: The folder structure for Servlet script handlers for communication between CADViewer and the back-end AutoXchange 2023.
6: The converter folder structure contains a larger set of fonts, installed in /cadviewer/converters/ax2022/windows/fonts/, but a fuller set of fonts can be installed.
Read the sections on installing and handling Fonts in AutoXchange 2020 TechDocs and TroubleShooting.
Use as is.
In cadviewer/WEB-INF/web.xml, change all <!-- --> settings strings for AX2023 executable, DwgMerge executable, and all cadviewer paths so they match the tomcat/webapps/ setting in Linux install environment.
Unpack the tar.gz file with ax2023 executable in /cadviewer/converters/ax2023/linux folder.
Ensure ax2023_L64_xx_yy_zz has chmod 777 permissions.
Ensure /cadviewer/converters/files/ folder and all subfolders to this folder have full read and write permissions.
Once installed, open the HTML samples under /cadviewer/html/ can be run from a web-browser. Use http://localhost:xxxx/cadviewer/html/CADViewer_fileloader_80.html as a starting point (assuming that your have installed under http://localhost:xxxx).
This repository should contain the latest converters, but in case you need to update any of the back-end converters please follow:
-
Download AutoXchange (and other converters), install (unzip) AX2023 in cadviewer/converters/ax2023/windows or cadviewer/converters/ax2023/linux or in the designated folder structure.
-
Read the sections on installing and handling Fonts in AutoXchange 2023 TechDocs and TroubleShooting.
-
Try out the samples and build your own application!
For a CADViewer Servlets installation under Tomcat on Windows, the base file-structure should be as below:
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
c:\xampp\tomcat\webapps
└─── cadviewer
├── app
│ ├── cv
│ │ ├── cv-pro
│ │ │ ├── menu_config
│ │ │ ├── language_table
│ │ │ └── space
│ │ │ ├── css
│ │ │ └── html
│ │ ├── cv-core
│ │ │ ├── menu_config
│ │ │ └── language_table
│ │ └── cv-custom_commands
│ ├── fonts
│ ├── images
│ ├── js
│ ├── css
│ └── user_resources
├── converters
│ ├── ax2023
│ │ ├── windows
│ │ │ └── fonts
│ │ └── linux
│ │ └── fonts
│ ├── dwgmerge2023
│ │ ├── windows
│ │ │ └── fonts
│ │ └── linux
│ │ └── fonts
│ ├── linklist2023
│ │ ├── windows
│ │ │ └── fonts
│ │ └── linux
│ │ └── fonts
│ └── files
├── WEB-INF
│ ├── classes
│ └── lib
├── content
├── html
└── temp_print
1: Download and install CADViewer under this structure.
2: Download and install AutoXchange 2023 under this structure.
3: Optionally, Download and install DwgMerge 2023 under this structure.
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
In folder:
c:\xampp\tomcat\webapps
└─── cadviewer
└─── WEB-INF
├── classes
└── lib
4: Download install WEB-INF folder under this structure from the download Handlers section.
In folder /cadviewer/WEB-INF open and edit the file web.xml.
Locate and change all CADViewer Servlets related <param-name> / <param-value> pairs, so the paths and executable points properly to the values defined in your CADViewer installation structure.
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
In folder:
c:\xampp\tomcat\webapps
└─── cadviewer
└── html
identify your sample mysample.html file, and ensure the ServerUrl and ServerLocation variables points to the proper location on your structure:
// Location of installation folders
var ServerBackEndUrl = "";
var ServerUrl = "http://localhost:8080/cadviewer/";
var ServerLocation = "c:/xampp/tomcat/webapps/cadviewer/";
Open a web-browser pointing to your sample html file (any of the files in the /cadviewer/html/ folder): http:/localhost:8080/cadviewer/html/mysample.html
Use the server traces and browser development console for debugging, alternatively contact our Support
NOTE: Under Linux replace c:\xampp\tomcat\webapps with /var/lib/tomcat{X}.
For debugging, the folder:
c:\xampp\tomcat\
└─── temp
contains a debug files corresponding to each of the Servlets defined in /cadviewer/WEB-INF/classes folder. The debug files are of type: getFileServlet-log-err2938081564144043508.txt and ConversionServlet-log_8998081420588034766.txt.
Especially ConversionServlet-log_xxxxxx.txt lists the command line and traces in the communication with the back-end converter AutoXchange 2020.
If drawing files does not display, this file will contain useful information to pinpoint the issue.
One issue that often appears in installations is that interface icons do not display properly:
Typically the variables ServerUrl, ServerLocation or ServerBackEndUrl in the controlling HTML document in /cadviewer/html/ are not set to reflect the front-end server url or port.
var ServerBackEndUrl = ""; // or what is appropriate for my server; used for NodeJS server only
var ServerUrl = "http://localhost/cadviewer/"; // or what is appropriate for my server
var ServerLocation = "c:/xampp/htdocs/cadviewer/"; // or what is appropriate for my server