How to open and save redline objects
The redline objects can be opened and saved on the local machine or on the server. To specify the location where users are allowed to
open or save redlines object, the following parameter can be used:
- <param name="redlinelocation" value="local">
- Available values are "local", "server" and "local&server"
- If "redlinelocation" is not defined, then the default location is "local"
When the user clicks on the open or save button in the redline tool bar, CADViewer will
- Popup a Window dialog box if the value="local" or "redlinelocation" parameter is not defined
- Ask the user to enter the name of the redline to be saved if the value="server"
- Popup a dialog box to choose whether user want to save to the local machine or to the server if the value="local&server"
If you want to save/open redline file to a folder on the server, make sure that this folder is web accessible (i.e You can use
a browser to browse this folder)
Important check list
CADViewer cannot open/save redline files unless the following requirements are met
- You must use one of the files "redsave.cgi", "redsave.pl", "cv7redsave.cgi" or "cv7redsave.pl" or use your own script
- The $location variable in the Perl script must be a web root or subdirectory of the web root
- Make sure that the Perl script has browseable permissions enable and write permissions on the server
- When the Perl script is executed from a browser, a file named "testsave.txt" file for debugging purposes will be created on the same folder as the Perl script
. If the file does not exist after the Perl script is executed, it means that the Perl
script does not have the write permissions on the server
- Make sure that the folders that contain redline files have browseable permissions enable
- Make sure that the folders that contain redline files do not have a default page such as "index.html", default.html, etc.
- Read examples at the end of this document
About the TMS scripts
When redline files are saved to the server, CADViewer will send the following parameters
- "dn" value= the drawing name
- "da" value= the name of the redline file
- "saveURL" value=true or false
- "saveLocation" value=the path where to save the file
- "red" value=the content of the redline file
If "saveURL=true", the "saveLocation" value will contain the path and redline file name. If "saveURL=false",
the name of the redline file will be "dn"_"da".red and the location will be the the "saveLocation"
When drawing and drawing+redline are saved, TMS uses the servlet "FileUploadServlet" and CADViewer send out
- saveLocation value=the path where to save the file
- redlinesdwf value=the content of the drawing or the drawing+redline
How to set up to open redline file on a local machine
- Do not require any parameter since the default location is "local"
- Optional: <param name="redlinelocation" value="local">
How to set up to open redline file on the server
- Open file a specified redline file at the time the drawing is loaded:
- <param name="open_redline_with_drawing" value="initial">
- <param name="load_redline_from_url" value="./demo.red">
- Always open the same specified redline file when the drawing is loaded as well as when the button is clicked:
- <param name="open_redline_with_drawing" value="always">
- <param name="load_redline_from_url" value="./demo.red">
- Open a specified redline when the redline open button is clicked:
- <param name="open_redline_with_drawing" value="always">
- <param name="load_redline_from_url" value="./demo.red">
- Allow users to browse on the server redline drawings with extension "*.red" and starts with drawing name + "_":
- <param name="redlinelocation" value="server">
- <param name="list_redline_files" value="*.red">
- <param name="redline_file_path" value="http://xyz.com/redlines/">
- Note that the redline_file_path value must be web accessible folder (i.e you can use a browser to browse this folder)
How to set up to save redline objects on a local machine
- Here are the parameters required:
- <param name="redlinelocation" value="local"> or
<param name="save_redline_method" value="local">
- CADViewer will display a File Dialog box to let users choose the location and file name on the local machines
- To hide the File Dialog box and force the redline file to be saved in a certain directory with a certain name:
- <param name="save_redline_directory" value="C:\temp\"> and
<param name="save_redline_filename" value="demo_red.red">
How to set up to save redline objects on the server
- To save redline objects to the server, the following parameters are required:
- <param name="redlinelocation" value="server">
- <param name="redline_cgi" value="http://www.xyz.com/cgi-bin/redsaver.cgi">
- The value is the URL of the script that will save the redline file
- To define where the redline file will be saved on the server, the follwing paramter is required:
- <param name="redline_file" value="../redlines/cv7redlines/">
- To save the redline file without user interaction:
- <param name="save_redline_to_url" value="http://www.xyz.com/cgi-bin/redsaver.cgi">
- <param name="save_redline_file_to_url" value="../redlines/redline.dwf">
Examples
- SAVE REDLINES TO LOCAL MACHINE
- Save with file dialog box displayed (OPTIONAL)
- <param name="save_redline_method" value="local">
- Save without file dialog box displayed
- <param name="save_redline_method" value="local"> (OPTIONAL)
- <param name="save_redline_directory" value="c:\">
- <param name="save_redline_filename" value="cadviewer.red">
- SAVE REDLINES TO SERVER
- Save with window dialog box displayed using TMS cgi script
- <param name="redlinelocation" value="server">
- <param name="redline_cgi" value="http://localhost/signedobfu/redsaver.cgi">
- <param name="redline_file_path" value="../drawing_redlined.dwf">
- Save redline only to the server without popup dialog box using TMS cgi script
- <param name="redlinelocation" value="server">(OPTIONAL)
- <param name="save_redline_to_url" value="http://localhost/signedobfu/redsaver.cgi">
- <param name="save_redline_file_to_url" value="../drawing_redlined.dwf">
- Save redline only to the server without popup dialog box using non TMS cgi script
- <param name="redlinelocation" value="server">(OPTIONAL)
- <param name="save_redline_to_url"
value="http://localhost/signedobfu/yourscript.cgi?saveLocation=../drawing_redlines.dwf&saveURL=true&dn=demo&red=">
- Save redline in drawing to the server without popup dialog box using TMS cgi script
- <param name="redlinelocation" value="server">(OPTIONAL)
- <param name="save_redline_to_url" value="http://localhost:8080/conversiontools/servlet/FileUploadServlet?saveLocation=../drawing_redlines1.dwf&redlinesdwf=">
- <param name="save_redline_in_drawing_as" value="redlinelayer">
- Save redline in drawing to the server without popup dialog box using non TMS cgi script
- <param name="redlinelocation" value="server">(OPTIONAL)
- <param name="save_redline_to_url"
value="../signedobfu/yourscript.cgi?saveLocation=../drawing_redlines.dwf&saveURL=true&dn=demo&red=">
- <param name="save_redline_in_drawing_as" value="redlinelayer">