Programmatically, as a Jar file from which you can directly access webclient classes.
As a Java Bean, that can be embedded in a program using a bean enabled development tool.
Windows NT 4.0 SP3 and greater
Solaris 2.6 and greater
linux PENDING(edburns): what dist and versions?
MacOS 8
JDK 1.1.7 and JDK1.2.1 and greater from Sun Microsystems
Linux JDK PENDING(edburns): what dist and version?
Macintosh MRJ 2.1.4 from Apple
Mozilla Milestone 9
Internet Explorer 5
Hot Java Browser Bean
Webclient puts the burden of "keeping up with the Joneses" where it belongs, on those who have the business need and the resources to keep up with current standards and rendering demands.
The flexible API allows one to provide an implementation for application specific circumstances, for example, small footprint devices; PENDING(edburns): add more value adds for wrapping the major browsers.
Webclient gives developers who are building application GUIs with Java world-class HTML rendering capabilities. By world-class we mean: super-fast, fully-functional, and fully-standard-supporting, well supported, widely used, well tested, etc.
Multi-browser implementation
Webclient will wrap the above mentioned
browsers.
Scalability
The full webclient API will expose the union of the
capabilities of all the underlying browsers, however, the api
will behave gracefully if the underlying browser
implementation doesn't support all of the webclient API
features. For example, suppose there is a webclient
implementation for a small footprint browser, let's say the
beduin browser for pJava. This browser may not include the
capability for "find in document", but the "find in document"
API exists in webclient. This will not pose a problem: either
the method(s) for "find in document" will do nothing, or there
will be a subset of the full webclient API that can be
implemented in the case of a reduced capability browser.
If the underlying browser doesn't implement a particular
method of the spec the
org.mozilla.webclient.UnimplementedException
should be thrown.
Another facet of scalability is partitioning. For example. Parts of the webclient API may use Java2 API's such as the Swing UI toolkit, but webclient will still be deployable in non-Java2 environments.
Low overhead
Webclient is a thin layer of software on top of a browser and,
as such, will not cause major memory consumption outside of
that already caused by the browser and the VM in which
webclient is running.
Accessibility
Webclient will have APIs to make the entire user experience
accessibly to persons with disabilities. PENDING(edburns):
need to investigate.
java.awt.Canvas
subclass,
BrowserControlCanvas
, that can be inserted in to the
custom app's display hierarchy as the developer sees fit.
Webclient pops up no dialogs. Instead, the API will notify the
application of events (see listener interfaces below). The custom
app developer must provide all GUI elements. A
BrowserControlCanvas
instance is a browser window.
It may display frames within itself when a page containing frames
is visited. It is perfectly permissible to have multiple
BrowserControlCanvas
instances in a custom app, but
it is the custom app's business to manage the collection of
BrowserControlCanvas
instances. For Each
BrowserControlCanvas
instance there will be a way to
access the below methods. Invoking any of the below methods will
affect only the BrowserControlCanvas
instance from
which the methods were accessed. See the section on functional partitioning for more
information.
The programmatic interface to webclient is a collection of Java
interfaces and one Java class, with the interfaces organized by
functionality. All of the following classes and interfaces are
implemented by webclient and are callable from the custom app.
See also the EventListener interfaces, which
are implemented by the custom app and are called by
webclient.
class webclient.BrowserControlFactory | ||
webclient.BrowserControl |
newBrowserControl()
| Create a new BrowserControl instance |
interface webclient.BrowserControl | ||
Object |
queryInterface(java.lang.String interfaceClassName)
|
Gain access to any of the
interfaces in the webclient API. The following strings are currently
the only valid arguments to this method. Calling queryInterface with
any one of these strings returns an instance of the appropriate
class:
|
interface webclient.Bookmarks PENDING(edburns): define the type for a bookmark entry | ||
void |
addBookmark(java.lang.Object mayBeNullParent, webclient.BookmarkEntry bookmark)
|
|
javax.swing.tree.TreeModel |
getBookmarks()
|
|
void |
removeBookmark(webclient.BookmarkEntry bookmark)
|
interface webclient.BrowserControlCanvas | ||
void |
setBounds(int x, int y, int w, int h)
|
|
void |
setBounds(Rectangle rect)
|
|
java.awt.Rectangle |
getBoundsRelativeToWindow()
|
|
java.awt.Point |
getEventCoordsLocalToWindow(MouseEvent evt)
|
|
int |
getWindow(java.awt.DrawingSurfaceInfo dsi)
|
get the native window handle as an int. |
java.awt.Rectangle |
getWindowBounds()
|
interface webclient.CurrentPage | ||
void |
copyCurrentSelectionToSystemClipboard()
|
|
void |
findInPage(java.lang.String stringToFind, boolean forward, boolean matchCase)
|
|
void |
findNextInPage(boolean forward)
|
|
java.lang.String |
getCurrentURL()
|
|
org.w3c.dom.Document |
getDOM()
|
Gain access the DOM for the currently loaded document for this BrowserControl instance. |
webclient.PageInfo |
getPageInfo()
|
|
java.lang.String |
getSource()
|
|
byte [] |
getSourceBytes()
|
|
void |
resetFind()
|
|
void |
selectAll()
|
webclient.EventRegistration See the listeners and events in the Events Section | |
void | addDocumentListener(webclient.DocumentListener documentListener) |
void | removeDocumentListener(webclient.DocumentListener documentListener) |
void | addDocumentLoadListener(webclient.DocumentLoadListener listener) |
void | removeDocumentLoadListener(webclient.DocumentLoadListener listener) |
DOM events are handled via the org.w3c.dom interfaces. | |
void | addJavaScriptListener(webclient.JavaScriptListener javaScriptListener) |
void | removeJavaScriptListener(webclient.JavaScriptListener javaScriptListener) |
void | addFocusListener(java.awt.event.FocusListener focusListener) |
void | removeFocusListener(java.awt.event.FocusListener focusListener) |
void | addKeyListener(java.awt.event.KeyListener keyListener) |
void | removeKeyListener(java.awt.event.KeyListener keyListener) |
void | addMouseListener(java.awt.event.MouseListener mouseListener) |
void | removeMouseListener(java.awt.event.MouseListener mouseListener) |
void | addWindowListener(java.awt.event.WindowListener windowListener) |
void | removeWindowListener(java.awt.event.WindowListener windowListener) |
webclient.ExtendedEventRegistration | |
void | addHyperLinkEventListener(javax.swing.event.HyperLinkEventListener hyperLinkEventListener) |
void | removeHyperLinkEventListener(javax.swing.event.HyperLinkEventListener hyperLinkEventListener) |
interface webclient.History | ||
boolean |
back()
|
|
boolean |
canBack()
|
|
webclient.HistoryEntry [] |
getBackList()
|
Get the copied list of previously visited pages from the history. |
void |
clearHistory()
|
|
boolean |
forward()
|
|
boolean |
canForward()
|
|
webclient.HistoryEntry [] |
getForwardList()
|
Get the copied list of previously visited pages from the history. |
webclient.HistoryEntry [] |
getHistory()
|
Return a copy of the entire history |
webclient.HistoryEntry |
getHistoryEntry(int historyIndex)
|
|
int |
getHistoryIndex()
|
returns the index of the currently viewed page in the history. |
boolean |
setHistoryIndex(int historyIndex)
|
cause the browser to navigate to the HistoryEntry at index historyIndex. |
int |
getHistoryLength()
|
|
java.lang.String |
getURL(int historyIndex)
|
A convenience method to return the url of a HistoryEntry at a given index. |
interface webclient.Navigation | ||
void |
loadURL(java.lang.String urlString)
|
|
void |
loadFromStream(java.io.InuptStream stream, String contentType)
|
|
void |
refresh()
|
|
void |
stop()
|
interface webclient.cache.NetDataCacheManager See nsINetDataCacheManager.idl | ||
static int | BYPASS_MEMORE_CACHE_MASK | |
static int | BYPASS_PERSISTENT_CACHE_MASK | |
boolean |
containsDataForURI(java.lang.String uri, java.lang.String secondaryKey, int flags)
|
|
webclient.cache.CachedNetData |
getCachedNetData(java.lang.String uri, java.lang.String secondaryKey, int flags)
|
|
webclient.cache.NetDataDiskCache |
getDiskCache()
|
|
int |
getHitRatio()
|
|
webclient.cache.NetDataCache |
getMemoryCache()
|
|
int |
getNumEntries()
|
|
java.util.Enumeration
|
newCacheEntryEnumerator()
|
|
void |
removeAll()
|
interface webclient.cache.CachedNetData extends webclient.cache.NetDataCacheRecord See nsICachedNetData.idl | ||
void
|
commit()
|
|
java.util.Date |
getExpirationTime()
|
|
java.util.Date |
getLastRetrievalTime()
|
|
int |
getNumRetrievals()
|
|
java.lang.String |
getSecondaryKey()
|
|
boolean |
isUpdateInProgress()
|
interface webclient.cache.NetDataCacheRecord See nsINetDataCacheRecord.idl | ||
void |
delete()
|
|
int |
getContentLength()
|
|
java.lang.String |
getKey()
|
|
java.lang.String |
getMetaData()
|
|
java.io.Reader
|
getReader()
|
|
int |
getRecordID()
|
|
java.io.Writer
|
getWriter()
|
interface webclient.cache.NetDataCache See nsINetDataCache.idl | ||
boolean |
containsDataForKey(java.lang.String key)
|
|
void
|
setCacheCapacity(int kiloByteSize)
|
|
int
|
getCacheCapacity()
|
|
webclient.cache.NetDataCacheRecord |
getCachedNetData(java.lang.String key)
|
|
webclient.cache.NetDataCacheRecord |
getCachedNetDataByID(int RecordID)
|
|
java.lang.String |
getDescription()
|
|
int |
getMaxEntries()
|
|
webclient.cache.NetDataCache
|
getNextCache()
|
|
int |
getNumEntries()
|
|
int
|
getStorageInUse()
|
|
boolean |
isEnabled()
|
|
boolean |
isReadOnly()
|
|
java.util.Enumeration |
newCacheEntryEnumerator()
|
|
void
|
removeAll()
|
interface webclient.cache.NetDiskDataCache extends webclient.cache.NetDataCache See nsINetDataDiskCache.idl | ||
java.lang.String |
getCacheLocation()
|
|
void |
setCacheLocation(java.lang.String absoluteFileName)
|
interface webclient.Preferences | ||
java.lang.String |
exportBookmarks()
|
|
java.lang.String |
exportCookies()
|
|
void |
setCharacterSet(java.lang.Character.Subset charSet)
|
|
java.lang.Character.Subset |
getCharacterSet()
|
|
void |
setDefaultOutgoingHttpHeader(java.lang.String headerName, java.lang.String headerValue )
|
|
java.lang.String [] |
getDefaultOutgoingHttpHeaders()
|
|
void |
clearDefaultOutgoingHttpHeader(java.lang.String headerName)
|
|
void |
setProperty(java.lang.String propertyName, java.lang.String propertyValue)
|
The following are valid values for propertyName. Valid values are indicated in parentheses where appropriate.
|
java.lang.String |
getProperty(java.lang.String propertyName)
|
|
void |
clearProperty(java.lang.String propertyName)
|
|
void |
importCookies(java.lang.String hotlistFileString)
|
|
void |
setPlainTextFont(java.awt.Font font)
|
|
java.awt.Font |
getPlainTextFont()
|
|
webclient.Security |
getSecurity() PENDING(edburns)
|
|
void |
setWebPageFont(java.awt.Font font)
|
interface webclient.PrintPENDING: Can someone who knows the Java2 Printing API rework this interface to conform to JDK? | ||
void |
print()
|
|
void |
setPaperSize(java.lang.String tbd)
|
|
void |
setPaperSource(java.lang.String tbd)
|
|
void |
setPageHeader(java.lang.String headerString)
|
|
void |
setPageFooter(java.lang.String footerString)
|
|
void |
setOrientation(java.lang.String orientation)
|
|
void |
setInchMargins(int left, int right, int top, int bottom)
|
interface webclient.WindowControl | ||
int |
getNativeWebShell()
|
returns the native pointer to the native browser as an int. |
void |
moveWindowTo(int x,
int y)
|
|
void |
removeFocus()
|
|
void |
repaint(boolean forceRepaint)
|
|
void |
setVisible(boolean newState)
|
|
void |
setFocus()
|
webclient.BrowserControlFactory
. This class is used
to create webclient.BrowserControl
instances, each of
which can vend out a webclient.BrowserControlCanvas
instance, as well as vending implementations of the interfaces
listed in the System Interfaces section.
webclient.EventRegistration
instance and uses it to
register/deregister for various events generated by webclient.
webclient.BrowserControlCanvas
instance event
registration. All one-time initialization automatically takes
place when the first webclient.BrowserControl
instance is placed in the display hierarchy. Subsequent
webclient.BrowserControlCanvas
instances will not
incur the cost of this one-time initialization. Event
registration is simply the act of allowing the custom app to
receive events from a webclient.BrowserControl
instance. Webclient is guaranteed not to generate any events
until the custom app starts calling
webclient.BrowserControl
methods. Thus it is
permissible to do the startup state in a separate Java thread.
webclient.Navigation
methods are invoked (other than stop()
), when the
currently loaded page programmatically causes another page to be
loaded, or when a javascript event causes something to be loaded.
Fetching state is exited when the loading is complete, or when the
stop()
method is invoked.
webclient.WebclientEventListener
:
interface webclient.DocumentLoadListener | Events relating to the loading of documents in this window |
interface webclient.DocumentListener | Events happening in the currently loaded document |
interface webclient.JavaScriptListener | Events relating to the loading of documents in this window. |
In addition to the above listeners, webclient also supports the following java listener types:
interface java.awt.event.FocusListener | Focus events in the BrowserControlCanvas. |
interface java.awt.event.KeyListener | Key events in the BrowserControlCanvas. |
interface java.awt.event.MouseListener | Mouse events in the BrowserControlCanvas. |
interface java.awt.event.WindowListener | Window events in the BrowserControlCanvas. |
interface javax.swing.event.HyperLinkEventListener | HyperLink events in the BrowserControlCanvas. |
interface javax.swing.event.HyperLinkEventListener | HyperLink events in the BrowserControlCanvas. |
webclient.WebclientEventListener
, but provide no
additional methods. The argument to eventDispatched()
is
a WebclientEvent
subclass. The different
WebclientEvent
subclasses are listed in the section WebclientEvent subclasses.
WebclientEvent
implements
webclient.WebclientEventInterface
, and thus instances can
be asked for the type and an eventData Object for the event. The type
is a long and its meaning depends on the WebclientEvent
subclass. The meaning of the eventData object also varies with the
type of event.
webclient.WebclientEventListener | ||
void | eventDispatched(webclient.WebclientEvent event) | invoked when an event is generated by webclient. |
class webclient.WebclientEvent extends java.util.EventObject implements webclient.WebclientEventInterface |
interface .WebclientEventInterface | ||
long |
getType()
|
|
Object |
getEventData()
|
Listeners must be attached to each BrowserControl instance. Multiple listeners can be attached to each BrowserControl instance.
The following is a listing of event classes for each of the above
event listener types, each of which inherit from
webclient.WebclientEvent
and therefore implement
webclient.WebclientEventInterface
:
webclient.DocumentLoadEvent extends webclient.WebclientEvent | ||
static int | START_DOCUMENT_LOAD_EVENT_MASK | notification before any connection established |
static int | END_DOCUMENT_LOAD_EVENT_MASK | notification after document loaded |
static int | START_URL_LOAD_EVENT_MASK | notification after DNS resolution and connection to server established |
static int | END_URL_LOAD_EVENT_MASK | notification that nsIURI finished loading |
static int | PROGRESS_URL_LOAD_EVENT_MASK | notification on progress of URL load |
static int | STATUS_URL_LOAD_EVENT_MASK | notification that status text available for URL being loaded |
static int | UNKNOWN_CONTENT_EVENT_MASK | notification when content of unknown type occurs |
static int | FETCH_INTERRUPT_EVENT_MASK | Called when a fetch is interrupted, as when the fetch requires authentication or cookies |
webclient.DocumentEvent extends webclient.WebclientEvent | ||
static int | TITLE_CHANGE_EVENT_MASK | The document's title has changed |
static int | STATUS_CHANGE_EVENT_MASK | There has been a change in the status of the document. |
webclient.JavaScriptEvent extends webclient.WebclientEvent See http://developer.netscape.com/docs/manuals/js/client/jsref/handlers.htm | ||
static int | ABORT_EVENT_MASK | |
static int | BLUR_EVENT_MASK | |
static int | CHANGE_EVENT_MASK | |
static int | CLICK_EVENT_MASK | |
static int | DOUBLE_CLICK_EVENT_MASK | |
static int | DRAG_DROP_EVENT_MASK | |
static int | ERROR_EVENT_MASK | |
Focus events are hanled with the java.awt.event.FocusListener interface and the associated FocusEvent class. | ||
Key events are hanled with the java.awt.event.KeyListener interface and the associated KeyEvent class. | ||
Mouse events are hanled with the java.awt.event.MouseListener interface and associated events. | ||
static int | MOVE_EVENT_MASK | |
static int | RESET_EVENT_MASK | |
static int | RESIZE_EVENT_MASK | |
static int | SELECT_EVENT_MASK | |
static int | SUBMIT_EVENT_MASK | |
static int | UNLOAD_EVENT_MASK |
For the java listener types, KeyListener, MouseListener,
FocusListener, and WindowListener, the argument KeyEvent, MouseEvent,
FocusEvent or WindowEvent will implement
webclient.WebclientEventInterface.
The custom app can then
obtain the eventData for this event.
Other areas that need to be addressed are the java console, and security.
The embedded native browser provides the HTML parser and rendering engine. Hence, it is expected that the Java application that embeds it through the WebClient API manifests the same parsing and rendering behavior.
Functional/Feature Requirements
The following table shows the expected supported functions or features for each properly implemented WebClient APIs.
|
|
interface webclient.Accessibility | Move focus to the next/previous elements in the page using the keyboard.
Overide the page color setting to black and white. Use default accessible font sizes and style. Format pages with given CSS stylesheet. |
nterface webclient.Bookmarks | Add, read and delete bookmarks entries. |
interface webclient.BrowserControlCanvas | Control the boundaries of the browser canvas.
Monitor actions inside the boundaries. |
interface webclient.Cookies | Set and delete cookies. |
interface webclient.CurrentPage | Copy selected text to clipboard.
Search text in Page. Get current page's URL, source, and other information. Access current document's DOM. |
interface webclient.EventRegistration | Listen to JavaScript, DOM, document, window, focus, events. |
interface webclient.ExtendedEventRegistration | Listen to hyper link event. |
interface webclient.History | Traverse back and forward on the history's entries.
Get the list of HistoryEntry and the length. |
interface webclient.Navigation | Load a document.
Do a refresh on the current document. Stop the loading of document. |
interface webclient.cache.NetDataCacheManager | Retrieve the cached network data, disk cache, memory cache, hit ratio,
and number of entries.
Add network data to cache. Delete all cached entries. Set and store the data for URI. |
interface webclient.cache.NetDataCacheRecord | Access the cache record's information like content length, primary
key, meta data, record id, writer and reader.
Delete a record from the cache. |
interface webclient.cache.CachedNetData | Access the cached document's information like expiration and last retrieval
time, retrievals frequency, secondary key for searching entries in the
cache and update progress indicator.
Add/update cached document's information. |
interface webclient.cache.NetDataCache | Set and get cache capacity.
Search and retrieve records in the cache. Delete all records from the cache. Set and store the data for the search key. |
nterface webclient.cache.NetDiskDataCache | Set the absolute cache location. |
interface webclient.PageInfo | Retrieve information about the currently displayed page. |
interface webclient.HistoryEntry | Add, retrieve, and delete history entries. |
interface webclient.Preferences | Export/import Bookmarks and Cookies.
Set and get proxies, home page, character set, plain text and web page font, history expiration, default outgoing HTTP header. Clear settings for default outgoing HTTP header and proxies, |
interface webclient.Print | Print the current loaded document and do necessary print settings, like paper size, source, margins, orientation, page header and footer. |
interface webclient.WindowControl | Move window to given location.
Set and remove window focus. Make window visible and not visible. Repaint the window. |
Responsiveness Requirements
|
(against "Gold" time) |
Image loading time | -5% or better |
Applet loading time | -5% or better |
Table loading time | -5% or better |
Repaint (window, screen) time | -5% or better |
Search text in Page time | -2% or better |
Large document loading time | -5% or better |
Parsing and Rendering Tests
|
Loading pages with bad syntax for the following: html, table, frame, javascript, plugin, etc. |
Loading pages with good syntax for the following: html, table, frame, javascript, plugin, etc. |
Functional/Feature Tests
|
|
Bookmarks | Adding, reading, and deleting bookmarks entry |
Caching | Document caching, image caching
Clearing the cache |
Cookies | Setting, reading and deleting cookie |
Copy/Paste | Copying and pasting text in documents |
DOM Access | Accessing document object, inserting/deleting nodes, adding attributes |
Document elements navigation | Selecting form elements using keyboard and mouse |
Event handling | Focus/unfocusing windows, widgets
Selecting links |
History | Navigating backward and forward on history URLs, adding history entry |
HTML | Loading html page with tables, forms, frames, style sheets, applets (class & jar files), plugins, etc. |
JavaScript | Using JavaScript host and core objects, event and event handlers, liveconnect |
Preferences setting | Setting proxies, exporting/importing cookies and bookmarks, setting CharacterSet |
Printing | Printing documents with text, images, tables, applets, etc.
Setup printing preferences. |
Protocols | Loading http, https, ftp, gopher, file, and other protocols supported by the native browser |
Search text in Page | Searching text in Page |
Window / Display manipulation | Resizing, moving, scrolling the window, reloading |
XML (if native browser supports) | Loading XML pages |
Responsiveness Tests
|
|
|
time |
Images loading | Load page with many large images. | . | . |
Classes loading | Load page with a huge jar/cab file or multiple jar/cab files. | . | . |
Table loading | Load a complex nested table. | . | . |
Resizing | Load a document with heavy contents and resize the window to the "full screen". | . | . |
Load a document with heavy contents, scroll to the bottom of the page and resize the window to the "full screen". | . | . | |
Make the window size small. Load a large document with images. Scroll the display screen up and down. | . | . | |
Large document loading | Load a large document, e.g. a journal, book, RFC, and the likes. | . | . |
View the source of the document. | . | . | |
Search in Page | Load a large document.
Find a text located at the bottom starting from the top of the document. |
. | . |
Ice Browser: http://www.icesoft.no/ICEBrowser/
HotJava bean: http://www.sun.com/software/htmlcomponent/index.html
Swing JEditorPane: http://java.sun.com/products/jfc/swingdoc-api-1.1/javax/swing/JEditorPane.html
System Entry Point
The current system requires the custom app developer to
use a webclient.BrowserControlCanvasFactory
static method to create
webclient.BrowserControlCanvas
instances, each
of which can be queried for their associated
BrowserControl
instance, which is then used to
navigate, etc.
The spec requires the custom app developer to use a
webclient.BrowserControlFactory
static method
to create webclient.BrowserControl
instances,
each of which can be queried for their associated
BrowserControlCanvas
instance, in addition to
being queriable for other
webclient.BrowserControl
interfaces.
Feature Paucity
The current implementation doesn't provide any events, Bookmarks, Preferences, CurrentPage, Accessibility features. It provides limited History and WindowControl features.
Here is a checklist for verifying that your requirements specification is complete: The requirements specification should: describe the flow and content of information elaborate all software functions describe all events that affect the system uncover design constraints show evidence and conclusions from research on prior projects that addressed the same problem as is being addressed in the specification. Specifically, the problems with each prior project should be listed. specify performance constraints serve as the basis for a Preliminary User's Manual. describe the design principles that will be adhered to, for example, design for maintainability describe the benefits of a successful implementation describe the environment in which the software is to run. be a cognitive model, that is, it must be described in the user domain, with user terms. separate functionality from implementation be useful for validating the correctness of an implementation be tolerent of incompleteness and be augmentable be modular and loosely coupled