PTAGIS frameset
From PTAGISWiki
The PTAGIS web site is currently built using a frameset containing 3 major frames.
- Top frame for navigation and branding
- Left frame for navigation
- Right frame for content
These frames are labeled:
- menu (the top frame: top.jsp)
- left (the left navigation frame: nav.jsp)
- main (main.jsp)
The user generally sees a URL like this in their location bar:
http://www.ptagis.org/ptagis/frame.jsp?menu=1&main=main.jsp
The frame.jsp is the main entry point and dispatches requests for all subpages (top.jsp, nav.jsp, main.jsp). The function of frame.jsp is convert those numeric codes in the URL to the corresponding URL components, ie.
- menu=1 --> data/data_left.html
- menu=2 --> software/software_left.html
Moving from one page in the site to another could potentially require all three frames to update their content. This is achieved by the navigation menu with code that looks like this:
<a href="top.jsp?menu=6"
onClick="top.left.location.replace('nav.jsp?menu=6');top.main.location.replace('main.jsp?menu=6');"
onmouseover="imgOn('info2')"
onmouseout="imgOff('info2')">
This snippet of code has one href link (top.jsp?menu=6) and two javascript onClick links that handle the other two frames. The user is clicking on this link in the top/menu frame, so the href link affects that frame by default. The onClick links are explicitly described like so: top.main.location.replace and top.left.location.replace.
A plan needs to be developed for replicating the functionality of the site without using the frameset so that it is easier to link into and navigate the site. The presence of the framesets makes navigation much more complicated. When you press the back button, which of the three frames should go back? All of them? When you press the refresh button, which frames should refresh? Currently, pressing the refresh button logs you out of the site.
Linking deeply into the site is made difficult both by the frameset and the Flash navigation menu.
The flash navigation bar within the site has been replaced by dhtml and javascript, but the front page of the site (http://www.ptagis.org/ptagis/) still is a monolithic flash object. Replacing that page would probably mean giving up the flashy animation of the moving fish.
Contents |
Options
One static page for each submenu
A straightforward replacement of the frames could be done with static html pages and folding the content of each current frame into a single page using CSS to achieve the desired layout. Given there are about 20 submenus, there would be about 20 pages with highly redundant content, but with different highlighting and text.
This is the simplest solution. It would be easiest to understand and would allow for simple modifications, but some changes would have to be done in many places. Twenty pages is not an unreasonable maintenance burden, however. And there is a high degree of confidence that this approach could match the look and feel of the current site as well as provide a functional Back button.
One static page for each top-level menu
This is the same solution as above, but involves some dynamic server-side includes to build a page upon request that displays the proper content. There would be one complex top level page that displays the menu bar and includes the desired nav bar and main content based on parameters, in a similar fashion to what is done now with jsp and frames.
This solution might be able to reuse many of the existing components since it is architecturally very similar to the existing design. It remains to be seen if server-side includes can perform as a functional replacement to frames in this situation.
Just replace frame.jsp
There is only one file that defines our frameset: frame.jsp. If I could just make changes to that one file to replace frames with CSS and jsp includes, that would be the most elegant solution.
Actually, other pages also have references to the frameset. top.jsp and nav.jsp must reference the frameset in order to reload pages in the proper places. Every reference to code like this:
if (menuItem.mainUrl!=""){
sNavUrl+= "top.main.location.replace('"+menuItem.mainUrl+"');";
}
That code must be replaced with some equivalent form of jsp:include to load the correct content into the correct section of the page. There are also many pieces of code like this in each submenu:
<a href="changePwd.jsp" title="Click to change your password." target="main" onClick="highlightItem(1)">Change Password</a>
That code relies on the feature of framesets that allows a click in one frame to update another.
My first attempt at modifying frames.jsp is resulting in only one of the three pages being included.
One thing that was preventing the top frame from being included was a symlink. I guess tomcat couldn't resolve the sylink from top.jsp to top.jsp.dhtml. When I removed the symlink and moved top.jsp.dhtml to top.jsp, it worked fine.
The other thing that is apparently a problem for jsp:include is nested includes.
- frame.jsp includes main.jsp which then tries to dispatch to an html file based on a parameter through jsp:include. The target html contains a flash movie with. The result of my nested include is that it always displays the warning that flash is not installed instead of the flash movie. If I go directly to the html, the flash movie is displayed properly.
Even going through a single jsp:include, the flash movie is not displayed.
The flash should be replaced with static images anyway. The movies in question are the short animations that introduce each major section (data, software, library, logon or home, support, search).
Replacing the flash with a simple static image now results in a single page that duplicates the functions of the three frames: http://snapper.psmfc.org:8080/ptagis/frameset.jsp?menu=1
Reinstall SREE on my desktop
The standard ptagis pages now display properly out of the frameset, but the SREE pages are not. I need to install a fresh, working copy of SREE on my desktop for testing.
I found a likely jar file and started the install like this:
java -cp ./sree_e1310868.jar install
That brought up the splash screen and then hung. When I attach an strace to the process I get just this:
[rday@snapper ~]$ strace -p 13326 Process 13326 attached - interrupt to quit futex(0xb7f93bd8, FUTEX_WAIT, 13327, NULL
Maybe my download is corrupt. I'd get a fresh copy, but the inetsoft web page appears to be down.
Got a good download and successfully installed, but I can't get the webapp to start in tomcat. What does it want JAVA_HOME set to? The base of SDK? The java binary? Which version? And why does it think that the netscape browser still exists? This code must have stopped working 5 years ago.
This is the /usr/local/bin/StyleReportEE/bin/em.sh script:
#!/bin/sh
export JAVA_HOME=/etc/alternatives/java_sdk_1.6.0
export DERBY_INSTALL=/usr/local/bin/StyleReportEE/Tomcat/webapps/sree/WEB-INF/database
export CLASSPATH="${DERBY_INSTALL}/lib/derby.jar:${DERBY_INSTALL}/lib/derbytools.jar:${DERBY_INSTALL}/lib/derbynet.jar:${CLASSPATH}"
cd ${DERBY_INSTALL}/frameworks/NetworkServer/bin
./startNetworkServer.ksh &
/usr/local/bin/StyleReportEE/Tomcat/bin/catalina.sh run
sleep 6
HOSTNAME=localhost
PORT=8000
if [ "$HOSTNAME" = "" ]; then
netscape -remote openURL http://localhost:8080/sree/EnterpriseManager
else
netscape -remote openURL http://$HOSTNAME:$PORT/sree/EnterpriseManager
fi
