Creating a Custom HTML Viewer Template
How Designer Creates a Web Site
- As the user goes through the various panels in Designer, parameters are set for the web site. Additionally, the path for the directory is set.
- After the user has defined what will be in the web site, Designer creates the site's directory.
- Designer copies to this directory files archived in html.jar (found in Manager/Designer/templates directory).
- Designer modifies default.htm with title defined by user in Designer session.
- Designer modifies ArcIMSparam.js with a list of
parameters set by user in Designer session.
Create a Web Site with Designer
- Select HTML Viewer.
- Select defaults for all options.
- Create web site.
Modify the Web Site to New Look and/or Functions
- Make appropriate changes to web pages.
- Location and size of frames on page
- Colors
- Tool bar
- New or modified functions
- Must maintain frame names and file references.
- Modified toolbar.htm should work the same as the original.
- Display of tool buttons are dependent on values of associated parameters
Convert the Web Site into Template
- Modify default.htm.
- Set the value of variable theTitle to "###TITLE###"
- Designer will look for this value and change it to the user-defined title
- Modify ArcIMSparam.js.
- Replace these lines:
//*********************************************************************
//* parameters set by Designer
//*********************************************************************
var imsURL = 'http://yourMachine.yourDomain.com/servlet/com.esri.esrimap.Esrimap?ServiceName=yourService';
var imsOVURL = 'http://yourMachine.yourDomain.com/servlet/com.esri.esrimap.Esrimap?ServiceName=yourService';
var imsQueryURL = '';
var imsGeocodeURL = '';
.
.
.
var MapUnits = "Degrees";
var ScaleBarUnits = "Miles";
// End of Designer set parameters
|
- With these lines:
//Do not edit the following line
//DESIGNERSETSPARAMETERS
//Do not edit the above line
// End of Designer set parameters
|
- Designer will look for these lines and replace them with the user-defined parameters
- Designer will copy all other files without modification.
Create New Jar File for Designer
- Jar utility necessary.
- Provided with Java Compiler
- Bundled with JDK
- Create new jar in web site directory.
- Go to site directory
- Syntax: jar -cvf myhtml.jar *.*
- All files and subdirectories in site directory will be archived into jar file
- On NT/Windows enter in Command Prompt
- Alternative is WinZip® version 7 or newer
- Set File name with .jar extension
- Navigate to site directory
- In Add Dialog:
- Under Folders - check Include subfolders - uncheck Save full path info
- Click Add with wildcards button
- Rename original html.jar to html_original.jar.
- Original jar found in Manager/Designer/templates directory
- Rename your new jar file to html.jar.
- Copy your new jar to Manager/Designer/templates directory
Test New Template
- Create a new web site in Designer.
- Select HTML Viewer
- Select desired options
- Browse to new web site.
- Site will have "new" look