SwiftView Plug-In Reference Manual
Release 6.2
Glenn Widener
4/10/02
This specification describes the SwiftView plug-in modes of operation,
appearance, configuration, and integration into Web pages. Much of this
description also applies to the SwiftView C/IE ActiveX Control ("SAX");
the SAX reference manual documents the differences.
Contents
Plug-in User Interface Modes
General Features
Including SwiftView Files in Your HTML Documents
Configuring the Plug-In
MIME Types and Suffixes
How the SwiftView Executable is Started
Document Transfer to SwiftView
LiveConnect
Native Language Support
Security
See also the plug-in release notes
(http://www.swiftview.com/tech/npsvreadme.txt, or installed with the plug-in)
for:
- installation and deinstallation notes
- configuring web server MIME types
- known bugs
- licensing
See the SwiftView Technical Reference Manual for more information on basic
SwiftView features, configuration, and application programming.
Plug-in User Interface Modes
A web page can have multiple instances of SwiftView plug-in documents.
The plug-in instance can appear in a rectangular window in the HTML
document, as a separate web page taking over the full browser window, or
in a separate SwiftView window (looks much like a helper application; we
will call it "partner mode").
Full-Page Plug-ins
Full-page SwiftView plug-ins are incorporated by a simple URL to a file
that is one of the SwiftView-supported MIME types. The document is
displayed in-line, taking over the full browser document window.
The default user interface for full-page plug-ins includes a control bar
on the right side of the window containing "All", "Wide", "Rotate",
"Print", "Tips", and "Swift" iconic buttons, plus a page number
display/selector.
The "All" button redraws the full page to fit the window. The "Wide"
button redraws the full page to fill the window horizontally. The
"Rotate" button redraws the full page to fit the window rotated 90 degrees
clockwise from the current rotation. The "Help" button pops up a dialog
identifying the plug-in and displaying a brief description of the mouse
and keyboard commands. The "Swift" button displays product information
about the plug-in. (F9 to displays information about the SwiftView
executable.)
The page selector consists of previous and next page icons, and a
current/total page indicator, that when clicked displays a page selection
dialog.
ToolTips are provided for all control bar fields and buttons.
The vertical scrollbar selects pages in a multi-page document, or pans a
single page document. A horizontal scrollbar is displayed when the
current page is not fully visible in the horizontal dimension.
Note that normal SwiftView document printing can be accessed from the
browser print button in full-page mode. Unfortunately, this does not work
with Internet Explorer or on Unix, so a separate plug-in print button is
also provided in the plug-in control bar.
Although full-page plug-ins are very simple to incorporate into your web
pages, they do not allow:
- displaying a SwiftView document simultaneously with related web pages
- directing the first-time user to the SwiftView plug-in installation
page.
Embedded and "partner" plug-ins offer these features.
Embedded Plug-ins
All other SwiftView plug-in modes are implemented using the EMBED tag in
the HTML page; we will refer to them as "embedded plug-ins". EMBED tags
can have attributes that configure the plug-in user interface. Most
attributes correspond to gui ics commands that can be used to configure
the SwiftView plug-in any mode. See "Including SwiftView Files in Your
HTML Documents" for details on creating EMBED tags, and "Configuring the
Plug-In" for details on the various ways of changing the plug-in's user
interface.
An embedded plug-in operates in either a "partner plug-in" mode or an
"in-line embedded" mode. The mode is selected by the EMBED tag attributes
"INLINE", "HIDDEN", "WIDTH", and "HEIGHT".
Partner Plug-ins
If an embedded plug-in has attributes INLINE=false, HIDDEN=true, WIDTH=0,
or HEIGHT=0, the SwiftView plug=in operates in "partner" mode. The
document is displayed in the SwiftView window, which is popped up over the
browser window. If HIDDEN=false, WIDTH>0, and HEIGHT>0. a "Show document"
button is displayed in the plug-in window, so the user can command the
document to be displayed or redisplayed. This button is 27 pixels square,
so the EMBED tag attributes width=27 height=27 should be given.
Hitting the browser "back" button hides the SwiftView window. Note -
HIDDEN fails with Internet Explorer; use WIDTH=0 and HEIGHT=0 instead
for portability.
Hitting the browser "back" button hides the SwiftView window.
If HIDDEN=true, WIDTH=0, or HEIGHT=0, or INLINE=false and AUTOSTART=false
is not given, the document is displayed immediately when the HTML page
containing the EMBED tag is viewed.
In-Line Embedded Plug-ins
If an embedded plug-in does not have INLINE=false HIDDEN=true, WIDTH=0, or
HEIGHT=0, the document is displayed in the plug-in window embedded in the
current HTML document, sized according to the EMBED tag attributes HEIGHT,
WIDTH, and UNITS. This can be a fixed size in pixels, or a percentage of
the browser window. A one-pixel border is drawn by default.
The CONTROLS embed attribute controls display of a control bar. The
control bar can be placed at the right side of the plug-in, just like
full-page mode, at the top of the plug-in window, or not shown, depending
on CONTROLS="topbuttons", "rightbuttons", or "none". By default, the
control bar is not displayed for embedded plug-ins.
The SCROLLBAR embed attribute controls display of the scrollbars. Values
are "vertical", "horizontal", "both", or "none". The default is "both",
but note that the scrollbars don't actually appear until the page is
zoomed in.
For in-line plug-ins, AUTOSTART is ignored.
Multiple In-Line Embedded Plug-ins
With in-line embedded plug-ins, multiple drawings can be visible
simultaneously.
On Windows, each document instance gets it's own SwiftView program, so the
entire user interface state is maintained as the user switches between
instances.
On UNIX, SwiftView's output is multiplexed among the plug-in instances.
Each document is transferred to sview as needed to respond to user
requests. Multiplexing instead of running an sview instance for each
instance significantly reduces memory consumption and speeds initial page
drawing time, but makes switching among multiple instances on the same
HTML page slower. Simply clicking on a different in-line plug-in instance
causes this context switch. The document must be completely reloaded from
the cached file when the user switches among multiple instances. User
interface state (e.g. rotate, zoom, page number) is not maintained in the
plug-in instance, and is reset to the initial value (as specified in the
ICS file, else page 1, zoomed to show all).
Because of this, a larger SwiftView file cache size may be needed to
display multiple large documents efficiently (see the "set cachesize" ICS
command).
General Features
The Plug-in supports all standard SwiftView key commands and selection
with the mouse. (Exceptions: Netscape prevents use of certain control and
function keys, so five commands are accessed via other keys. F9 or F10
presents the sview copyright/version info, not that of the plug-in itself,
which is provided by the Swift icon.
Including SwiftView Files in Your HTML Documents
SwiftView documents are incorporated into HTML pages in one of two ways:
- A simple URL to a file that is one of the SwiftView-supported MIME
types.
- An EMBED tag which contains various attributes defined by the Netscape
or SwiftView plug-in. Embedded plug-ins can occupy a rectangular area
of the HTML page or display the document in a separate SwiftView
window. Attributes take the forms
NAME=value
NAME
where NAME is case-insensitive. A NAME with no value is the same as
NAME=true. Attributes used by SwiftView are:
Defined by Netscape:
SRC="URL[#ics cmds]" - where to get the SwiftView document/ics file
file. Follows standard URL syntax,
including file: or http:. If the URL
contains the '#' character, everything
after it is processed as ICS commands,
prior to other EMBED tags.
TYPE=MIME - The document MIME type
PLUGINSPAGE="URL" - where to get the plug-in itself
WIDTH=val
HEIGHT=val - the area of the HTML document taken by
the plug-in instance if not full-page.
val is in pixels, or nnn%, a
percentage of the browser document window.
"100%" sets the size to match the
window, less a small margin (fixed in
Netscape, config with xxxMARGIN
in IE). Note that SAX defaults to
CONTROLS=rightbuttons if WIDTH=100%.
In partner mode, must be set to 27x27,
the size of the "Show" button, except if
width or height is zero, INLINE=false
and AUTOSTART=true are set, creating a
"HIDDEN" plugin (except SAX, where you
must set both explicitly).
LEFTMARGIN=pixels
RIGHTTMARGIN=pixels
TOPMARGIN=pixels
BOTTOMMARGIN=pixels - IE only - set the margin between the
browser document window and the page.
SCROLL=false|true - IE only - if true, the browser document
window scrollbar is now shown
HIDDEN=false|true - if true, the plug-in window is not
created by the browser, and INLINE=false
and AUTOSTART=true are implied.
Default "false". Note - fails with
Internet Explorer; use WIDTH=0 and
HEIGHT=0 instead for portability.
Defined by SwiftView:
INLINE=false|true - if true, show the SwiftView document
in-line in the HTML document, else in a
separate "partner" SwiftView window,
with a "Show" button in the HTML page.
Default "true".
Equivalent ICS command: gui inline
CONTROLS=rightbuttons|topbuttons|none
- if INLINE=true, show a set of buttons
at the top or right of the document,
within the plug-in instance area.
Default "rightbuttons" if WIDTH=100% in
SAX, else "none". Ignored if INLINE=false;
use COMMANDS PARAMeter.
Equivalent ICS command: gui controls display
SCROLLBARS=vertical|horizontal|both|none
- show the desired scrollbars.
Default "both". Ignored if INLINE=false;
use COMMANDS PARAMeter.
Equivalent ICS command: gui scrollbars
display
BORDERWIDTH=n - width of border around entire plug-in.
Default 1 for embedded, 0 for full-page
Border is inside WIDTH/HEIGHT.
New in 4.0
Equivalent ICS command: gui borderwidth
AUTOSTART=false|true - if true, show the SwiftView document
as soon as the HTML page is viewed.
Default "false". Ignored if INLINE=true.
Equivalent ICS command: gui autostart
COMMANDS="ics commands" - a string of ICS commands to process
The string may contain multiple commands
separated by newline or pipe ("\\n" or "|").
Use """ to embed a double quote.
FIRSTICS="ics commands" - Same as COMMANDS, but processed before
SRC.
The EMBED tag is a very flexible and powerful mechanism, and is highly
recommended. For example, "partner" mode allows the referencing HTML page
to remain visible in the browser while the SwiftView document is being
viewed. EMBED tag entry is supported to some degree by HotMeTal, and
quite well by Microsoft FrontPage.
As noted, the SwiftView-specific EMBED tags have equivalent ICS commands;
see the SwiftView Technical Reference Manual for details. Also note that
EMBED tags CONTROLS, SCROLLBARS, and BORDERWIDTH do not affect the partner
mode user interface (if INLINE=false); use COMMANDS= to configure controls
and scrollbars in this case.
The SRC attribute references the SwiftView document file.
The TYPE attribute is an alternative way to specify the MIME type of the
document, but even when the server handles suffix-to-MIME mapping, use of
TYPE allows faster plug-in loading.
The NOEMBED tag should be used after the EMBED tag to invoke SwiftView
directly as a helper in browsers that do not support plug-ins:
Use the SwiftView helper from http://www.swiftview.com/dload/dlmain.htm
We recommend use of the "PLUGINSPAGE=URL" EMBED tag attribute. This
attribute tells Navigator 3.0 where to get the plug-in for the MIME type
specified by the EMBED tag. If the plug-in is not installed, Navigator
makes a CGI GET request to that URL with the MIME type as the
QUERY_STRING. We supply a web page at
http://www.swiftview.com/dload/euinstall.htm
that can be referenced by the PLUGINSPAGE attribute of any webpage to
install the plug-in if not already installed. Read
http://www.swiftview.com/howto/webhowto1.htm for more details.
Note that this implies that you should use the EMBED tag even for
large documents that would normally be incorporated in full-page mode.
Example EMBED tag HTML code:

This is an EMBED tag with INLINE=true and CONTROLS=topbuttons:

View this document with standalone SwiftView from
http://www.swiftview.com/dload/dlmain.htm
Configuring the Plug-In
All plug-in modes are configurable using any of the ICS commands
documented in the SwiftView Technical Reference Manual. In fact, the mode
itself is configurable!
ICS commands can be given in one of the following locations. All files
that consist of ICS commands begin with the line "ICS". A command in a
location later in the following list overrides the same command in an
earlier location.
1. The local system/LAN SwiftView configuration files:
Windows: ICSN= commands from both of the following:
A. \sview.ini ( is typically
c:\windows or c:\winnt)
B. sview.ini wherever sview.exe is installed.
Unix:
$NDGUTIL/svstart.ics
If $NDGUTIL is not set, it is set to the sview directory installed
under the browser's home directory: $MOZILLA_HOME/sview, else
/usr/local/lib/netscape/sview. This applies to all uses of
$NDGUTIL described here.
Caution: These files do not affect the user interface of embedded or
full-page plug-ins, only partner mode. Also,
they are overridden by the plug-in default user interface settings (gui
commands), so should not be depended on to configure the plug-in user
interface. Put any user interface configurations that you want to
apply to both plug-in and standalone both here and in the following
file:
2. The local system SwiftView plug-in configuration file:
Windows up to version 4.2:
/npsview.ics
Windows after version 4.2: the first of the following files found:
npsview.ics in the , else (plug-in only, not SAX), else if the plug-in is LAN
licensed (or demo?), in the PATH.
Windows after version 5.1.2: the first of the following files found:
npsview.ics in the , else SwiftView program
directory (normally c:\Program Files\SwiftView), else if the plug-in
is LAN licensed (or demo?), in the PATH.
Unix:
$NDGUTIL/npsview.ics
3. The web site SwiftView configuration file, per the URL's protocol:
http:///npsview.ics, or
ftp:///npsview.ics
Note that the "user@" in "ftp://user@/" is dropped, and anonymous
ftp used to obtain this and the license file.
This configuration file does not apply to file: or mail attachments.
4. The FIRSTICS EMBED tag. This is needed for certain ICS commands that
must be issued before the ldoc.
5. The document file. If the SwiftView document is an ICS file, any
ICS commands can appear in it; commands can also appear in a stamped
non-ICS document file. Stamp ICS commands are processed by sview.exe
at the first lpage or ldoc.
In SAX, commands in the document ICS file are not processed within the
control until after items 5 and 6 below, thus overriding gui settings
in 5 and 6.
6. #fragment - a "#" character in the URL is followed by ICS commands.
This does not work under IE, with either plug-in or Active-X control.
Note that spaces, pipes, and quote characters in HTML generally must be
escaped, e.g. "%20" for space, or appear in a quoted string. The ICS
commands are processed after the SRC file is loaded.
This feature allows SwiftView to load a document and go to a particular
point in the document. Examples:
http://www.swiftview.com/tech/svm.pcl#lpage 3|search string "Chapter 2" matchcase yes
file://l:/file.pcl#lpage 3|draw widetop|scroll down 50
7. EMBED tags other than FIRSTICS. Caution: these EMBED attributes are
processed in the order listed above in the Netscape plugin, but in
indeterminate order under IE; do not depend on processing order. Also,
#fragment is loaded after EMBED tags in SAX.
8. Beginning with release 5.1.1, you can now associate ICS files with your
document files. A web site site or a directory can be configured to
load a common ICS file, or a per-document ICS file of the same name as
the document but with a different suffix. Examples:
To configure a web site to look for a .mrk file for each document,
put in npsview.ics on the root of the web server:
set ldocinit "set nofileerror n|ldoc \"\$docdir()\$docbase().mrk" | set nofileerror y | rotate 0 | scale default"
To configure a specific directory to look for a .mrk file for each
document in that directory, put the per-directory config file
command in npsview.ics at the root of the web site, or in a local
system or LAN configuration file:
set ldocinit "set nofileerror n|ldoc \"\$docdir()config.ics\" | set nofileerror y | rotate 0 | scale default"
And in config.ics in the specific directory:
ICS
ldoc "$docdir()$docbase().mrk"
$docbase expands to the simple filename of the current document, if any,
without any directory path prefix or trailing dot and suffix.
MIME Types and Suffixes
The SwiftView MIME type is application/vnd.SwiftView, used for extensions
ics. This type is registered with IANA. Our plug-in registers
itself for all applicable suffixes but not for all applicable publically
defined MIME types. The full set of applicable types/suffixes is:
MIME Type Suffixes File Menu Option
-----------------------------------------------------------------------------
application/vnd.SwiftView-ICS .ics SwiftView (*.ics)
application/vnd.SwiftView-ZIP .zhp Any of above, zipped (*.zhp)
application/vnd.hp-PCL .pcl HP-pcl (*.pcl)
application/vnd.hp-HPGL .hp.hpg.hpgl
.hgl.plt HP-hpgl (*.hpg,*.hgl,*.hpgl,*.hp,*.plt)
image/tiff .tif.tiff.001 tiff (*.tif,*.tiff,*.001)
image/jpeg (not registered, see below)
image/vnd.SwiftView-jpeg .jpg.jpeg.jpe JPEG (*.jpg,*.jpeg,*.jpe,*.jfif,
.jfif.pipeg.pip *.pipeg,*.pip)
image/pcx (not registered, see below)
image/vnd.SwiftView-pcx .pcx .dcx PC-Paintbrush (*.pcx,*.dcx)
application/cals-1840 (not registered, see below)
image/vnd.SwiftView-cals .cal .ras Cals (*.cal,*.ras)
vnd.hp-PCLXL is apparently PCL level 6, which we do not support yet.
When the plug-in is installed and Navigator is restarted for the first
time, Navigator is configured to use the plug-in for all the types it
registers with compiled-in resources. At present, browsers have no manual
control for selecting among plug-in/helper/internal support for a given
MIME type, or selecting different viewers for embedded images than for
full pages. If two plug-ins register for the same MIME type, the first
one loaded wins. Configured helpers override internal support, and
plug-ins override both.
Some users may find that they prefer different viewers for certain data
types that frequently appear embedded in HTML pages (e.g. image/jpeg).
Currently, the only way to choose is to remove a plug-in or recompile it
with a different set of MIME types resources. SwiftView is available in a
version that registers only application/vnd.SwiftView-ics and it's
suffixes. You can also re-register a different set of suffixes yourself,
following the instructions under "Non-Standard Installations" in
http://www.swiftview.com/tech/npsvreadme.txt.
The SwiftView plug-in cannot register for public MIME types in common
use (e.g. image/jpeg), as the user will see the 30-second license message
when reading a document of such a type from an unlicensed server.
So the SwiftView plug-in registers for all suffixes and all MIME types
except image/jpeg, image/pcx, and application/cals-1840. image/tiff is
registered because we don't see much current use of tiff on the web.
How the SwiftView Executable is Started
The SwiftView plug-in consists of a shared module that is dynamically
loaded by the browser (npsview.dll on Windows, npsview.so on Unix), and
standard SwiftView (sview.exe/sview). The shared module starts an
instance of sview for each plug-in instance on Windows, and one shared
sview on Unix. Except for partner mode, it is started invisibly (using
SW_HIDE on CreateProcess()). It has no Open or Exit button.
Sview is executed from one of the following locations, in order:
Windows:
0. In version 5.2 or later, the SwiftView program directory (normally
c:\Program Files\SwiftView)
1. The directory from which the browser .exe was loaded
(actually all elements of the brower's App Paths registry entry)
2. current directory of the browser
3. The local system directory
4. The local windows directory
5. $PATH
Unix:
1. $MOZILLA_HOME/sview/sview, if defined
2. /usr/local/lib/netscape/sview/sview
5. $PATH
The user can configure his path to include a directory on a remote server
where sview is installed, complete with the usual SwiftView configuration
and font files, or install sview locally. The standard plug-in install
puts sview in the SwiftView program directory on Windows, or in
$MOZILLA_HOME/sview/sview else /usr/local/lib/netscape/sview/sview on
Unix.
Document Transfer to SwiftView
The SwiftView file referenced by an HREF or SRC tag can be an actual
document file or a SwiftView "ICS" file. The file is downloaded by the
browser when the plug-in instance is created. The file is sent to
SwiftView, immediately if INLINE=true, HIDDEN=true, AUTOSTART=true, WIDTH=0
or HEIGHT=0, or when the user presses the "Show" button if INLINE=false,
HIDDEN=false, AUTOSTART=false, WIDTH>0, and HEIGHT>0.
Non-ICS files are passed to sview by saving them in the browser's
cache and sending the following commands to sview:
ldoc
draw
Note that this means that entire file is downloaded by the browser before
sview begins viewing the file.
ICS files are handled differently. The plug-in passes the contents of the
ICS file (less the starting "ICS" line, if any) directly to SwiftView.
This saves opening/reading the ICS file in sview, and allows the actual
document transfer to be done incrementally by SwiftView, using SwiftServe
or remote file service. The plug-in does not send a "draw" command for
ICS files, so initial page selection, scaling, and drawing is under the
control of the ICS file. SwiftView features such as markup and user
interface configurtion can be used in the ICS file.
A typical ICS file contains:
ICS
ldoc
draw
The document file can be one of the following:
//server_hostname/document_path
l:\document_path
http://server_hostname/document_path
ftp://server_hostname/document_path
In the first case, SwiftServe running at server_hostname is used to obtain
the actual document. In the second case, remote file service is used.
Either of these methods is significantly more interactive because only the
ICS file and the first part of the document file must be downloaded for
SwiftView to begin display.
In the third and fourth cases, the entire document file is fetched to the
Internet Explorer browser cache by SwiftView, then loaded. While this
method does not improve interactivity, and in fact adds some minor delays
before the document can be displayed, it does permit ICS file control of
document presentation using only http: protocols.
The document file (or, for that matter any file ldoced from a
configuration file) cannot contain ICS commands that configure the plug-in
UI, as it is not parsed in the plug-in.
Note that multi-file, multi-page (.001, .002, ...) documents cannot be
transferred by the browser; only the first file is downloaded. Therefore
these documents can only be accessed as local files (file:///), by an ICS
file that references a .001 local file, or using an http: or SwiftServe
URL. Use of an ICS file with onpage use commands is highly recommended,
as it improves performance by downloading pages only as they are viewed.
Example:
ICS
onpage reset
onpage 1-5 use sourcename "http://www.swiftview.com/tech/byer.%03d"
initdoc
draw
XXX put byer up on www.swiftview.com.
The new SwiftPageServer product can automatically generate this ICS file,
quickly precounting the .nnn pages on the server.
LiveConnect
Starting with release 4.2.5, the plug-in supports LiveConnect under
Netscape browsers on 32-bit Windows platforms. LiveConnect permits Java
and JavaScript to control and observe the actions of any number of
instances of the SwiftView plug-in on the current web page. The
Java/JavaScript code can send ICS commands to a named plug-in instance and
request ICS callbacks from an instance.
To avoid the overhead of starting the Java Runtime, the default plug-in
installation package does not enable LiveConnect (by not installing
plugins\SwiftViewPlugin.class). A LiveConnect-ready installation package
is available at http://www.swiftview.com/dload/npsvlive.jar. We recommend
that developers using LiveConnect point their users at a download page on
their own site that points to a copy of this package. See
http://www.swiftview.com/howto/webhowto1.htm for information on setting
up your
own download page.
Please refer to the Netscape LiveConnect documentation for how
connections are set up between Java and/or JavaScript and the plug-in's
Java API. The following resources are recommended:
http://home.netscape.com/eng/mozilla/3.0/handbook/plugins
http://developer.netscape.com/docs/technote/javascript/liveconnect/liveconnect_rh.html
The SwiftView plug-in registers "SwiftViewPlugin" as a subclass of the
Netscape Plugin class if the file \plugins\SwiftViewPlugin.class exists. SwiftViewPlugin provides
the following methods:
public native void sendCmd(char *cmd)
Submit the supplied ICS command string to the associated plug-in
instance. A terminating newline is not required. Any ICS command can
be sent, the same as the COMMANDS= embed attribute. Note, however,
that COMMANDS= commands are submitted before the initial plug-in user
interface configuration. If sendCmd is called after the plug-in is
completely initialized, the client is required to send the command "gui
controls update" when it is finished sending gui configuration commands
to cause the commands to take effect and the user interface to be
(re-)constructed.
Any errors are reported to the callback handler; an error dialog is
also displayed. This dialog can be suppressed with the ICS command
"gui dialogs disable", but note that if this is done the GUI:MESSAGE,
OUTPUT:START, and OUTPUT:START callbacks that pop dialogs must be
implemented by the client.
public native String getCallback(boolean check)
This function returns one callback line with the terminating newline
removed as its value. If check is true and no callback string is
immediately available it returns null, otherwise it blocks until a
callback string is available. Note that null may be returned if the
function is called before plug-in initialization is complete.
See the SwiftView Technical Reference Manual for the specification of
callback strings.
Ideally, the client starts a separate callback reader thread that
continuously calls getCallback with check == false. However, we have
as yet found no means of accomplishing this, so at present the
interface must be polled with check == true. In addition, a plug-in
instance which is to provide callbacks must supply the following
parameter:
CALLBACKS=true
This tells the plug-in to queue all callback strings until they are
read by a getCallback() call. Otherwise, they will be discarded and
getCallback() will return null.
LiveConnect Programming Hints
We recommend JDK 117b, which was used to build the plug-in.
Compile your Java code e.g. as follows:
javac -O -classpath ".;c:\Program Files\Netscape\Communicator\Program\Java\Classes\java40.jar" PluginTest.java
Your .class files can be installed locally, in the plugins or java/download
directory, or in your web site.
We have not been able to get direct Java->plugin access to work, e.g.
import SwiftViewPlugin;
import netscape.javascript.JSObject;
...
SwiftViewPlugin plugin;
JSObject win, doc;
win=JSObject.getWindow(this);
doc=(JSObject)win.getMember("document");
plugin=(SwiftViewPlugin)doc.getMember("viewics");
/* plugin is null here */
plugin=(SwiftViewPlugin)win.eval("document.viewics");
/* Error here:
netscape.javascript.JSException: access disallowed from scripts at
[unknown origin] to documents at another domain */
/* So you can't do this: */
plugin.getCallback(true);
Instead, your Java code must access the Plugin class indirectly through a
JavaScript function:
--------
In your .html:
--------
<

APPLET MAYSCRIPT code="PluginTest.class" width=600 height=210>
--------
In Java:
--------
import netscape.javascript.JSObject;
public class PluginTest extends java.applet.Applet implements Runnable {
JSObject win;
public void init() {
win=JSObject.getWindow(this);
...
win.eval("sendCmd(\"message \\\"hello there from Java!\\\"\");");
--------
Complete sample code including access to callbacks from Java and
JavaScript is available. Contact tech@swiftview.com for more information.
Known LiveConnect Problems
Errors detected in the plug-in are not reported in a callback, and the
error dialog from the plug-in is not suppressed by gui dialogs disable.
Native Language Support
All user-visible text presented by SwiftView (standalone, plug-in,
SwiftView C/IE ActiveX Control, or SwiftInside) can be translated into any
language supportable by the Latin-1 character set (i.e. western European
languages). This translation is done in two editable text files, one for
the controls, and one for the standalone SwiftView program used by the
controls.
With release 5.2, native language translation files are selected
automatically based on the current Windows locale setting (Control Panel,
Regional Settings).
All Windows controls load a file specified by "trans=" in the sview.ini
file, else if this variable is not set, a file in the SwiftView program
directory (normally c:\Program Files\SwiftView), else a file in $PATH.
Except for trans=, the file is named "sview_.tra", else
"sview_.tra", else "sview.tra". is the current Windows
system locale setting, according to the system call setlocale(LC_CTYPE,
NULL), e.g. "French_France.1252". is the language portion of the
locale, i.e. the locale string without the portions beginning with
underscore or period, e.g. "French". This allows installation of a single
file for all countries and code pages defined for a given language.
To ease identification of the current locale setting, the F12 key pops a
dialog (ICS command gui dialog locale) that displays the locale string.
The translation files contain an ordered list of text strings, one per
line:
This is a comment
sview.msg1:This is a message
sview.msg2:This is another message
sview.msg4:Rotate
This is a comment
...
sview.msgNNN:This is a %s message\nwith two lines\n
This is a comment
The file sview.tra included in the plugin/SAX/SwiftInside package is a
dummy file; the file sview.str contains the default (English) strings
embedded in the program. To translate, you can simply copy this file to
sview.tra or "sview_.tra" and edit it with a plain text file
editor such as notepad. The strings must remain in numerical order, but
strings may be omitted. If a string is omitted, the program default is
used. Any string that does not begin with sview.msg is a comment.
Note that it is important not to rearrange or add %-substitutions in a
string; the program replaces each %-substitution in order with another
string (using the ANSI C function sprintf()). Newlines can be embedded in
the text string with "\n", and existing newlines can be removed. The
string may increase in length by up to 120 percent or 60 characters,
whichever is larger. If this limit is exceeded, an error dialog is
displayed, or an error message is sent to the file specified by
$NDGDBUG_FILE.
The string file may contain multiple versions of a given message. Only
the last one in the file is used by the most recent version of SwiftView
and needs to be translated. Subsequent releases only append strings to
the file, so prior translations of strings that have not been changed in
the new release will continue to function. Only changed/new strings need
to be (re-)translated and appended to a previously translated file.
Strings contained in standalone SwiftView (sview.exe) such as error
messages and most dialogs are visible under the plug-in, and are
translated by the same mechanisms as the plug-in, from the same file.
The SwiftView print dialog is translatable by Microsoft Windows
mechanisms. Currently, the open dialog cannot be translated.
The translation file permits changing the following non-text item:
Arial Narrow - the font used in the page number field - must be a valid
font name.
The Unix plug-in is translated in a similar manner, from lines beginning
with "NDGSview.Npsview.Msg" in the X resource file NDGSview found in the
first of the following directories whose environment variable is defined:
$XAPPLRESDIR
$NDGCONFIG
$NDGUTIL
$MOZILLA_HOME/sview
/usr/local/lib/netscape/sview
The Unix plug-in, like the Windows plug-in, allows multiple translation
files to be installed. If the user has a locale set (e.g. with $LANG),
the resource file NDGSview is found in a subdirectory of the name of the
locale under the above directory, e.g. for french, LANG=fr:
$MOZILLA_HOME/sview/fr/NDGSview
A sample file NDGSview.np is provided that can be copied to the desired
location and edited.
On Unix, the same NDGSview resource file is used for sview as for plug-in
strings. For more information on Unix SwiftView translation, see
"Internationalizing Unix SwiftView" in the SwiftView Technical Reference
Manual.
Security
All "plot", "system", and "save" commands are disallowed except for "plot
99" on Windows, which plots to the current windows printer. This
restriction is necessary because these commands allow writing an arbitrary
file. This includes commands in ICS files obtained from the web server
and commands from LiveConnect or Active-X interfaces.
ICS files obtained via SwiftServe or commands configured on keys or
buttons are currently deemed safe and are not restricted. However, they
may be restricted in the future.
In summary, the only file that can be written by SwiftView without the
user explicitly naming the file or pressing a button or key on the
SwiftView user interface is sview.ini in the Windows directory.