gecko-dev/java/webclient
edburns%acm.org 8484d431af This checkin implements a response header listener feature.
I have changed the usage contract of the DocumentLoadListener slightly.
Prior to this checkin, calling getEventData() on the DocumentLoadEvent
passed in to your eventDispatched() method returned the URI to which the
event applies.

Now the getEventData() returns a Map.  You must look up the "URI" key to
find the URI to which the event applies.  If your listener is an
instance of PageInfoListener, and your event mask is
END_URL_LOAD_EVENT_MASK, your Map will have an additional entry under
the key "headers".  This entry is another Map representing the response
headers.

DocumentLoadListener:

 * <p>The <code>eventDispatched()</code> method is passed a {@link
 * DocumentLoadEvent} instance.  The <code>type</code> property of the
 * event will be one of the types defined as a <code>public static final
 * int</code> in <code>DocumentLoadEvent</code>.</p>
 *
 * <p>The <code>eventData</code> property of the
 * <code>DocumentLoadEvent</code> instance will be a
 * <code>java.util.Map</code>.  For all <code>EVENT_MASK</code> types in
 * <code>DocumentLoadEvent</code> the map will contain an entry under
 * the key "<code>URI</code>" without the quotes.  This will be the
 * fully qualified URI for the event.</p>
 *
 * <p>For the <code>PROGRESS_URL_LOAD_EVENT_MASK</code> there will be an
 * entry in the map for the key "<code>message</code>".  This will be
 * the progress message from the browser.</p>

PageInfoListener:

 * <p>This {@link DocumentLoadListener} subclass adds the ability to get
 * detailed information on each event. </p>
 *
 * <p>The <code>eventDispatched()</code> method is passed the same thing
 * as in the {@link DocumentLoadListener}.</p>
 *
 * <p>The <code>eventData</code> property of the
 * <code>DocumentLoadEvent</code> instance will be a
 * <code>java.util.Map</code>.  For the
 * <code>END_URL_LOAD_EVENT_MASK</code> type in
 * <code>DocumentLoadEvent</code> the map will contain an entry under
 * the key "<code>URI</code>" without the quotes.  This will be the
 * fully qualified URI for the event.  The map will also contain an
 * entry under the key "<code>headers</code>".  This entry will be a
 * <code>Map</code> of all the response headers.</p>


The next step will be to allow the same procedure to work to discover
the request headers.

Ed

A classes_spec/org/mozilla/webclient/PageInfoListener.java

- marker class for listenening for high fidelity page information.

A src_moz/EventRegistrationImpl.cpp

- add boolean property, capturePageInfo to turn on or off high fidelity
  page information collection.

M build-tests.xml

- add new test, DocumentLoadListenerTest

M build.xml

- added new JNI class, EventRegistrationImpl

M classes_spec/org/mozilla/webclient/CurrentPage2.java
M classes_spec/org/mozilla/webclient/impl/wrapper_native/CurrentPageImpl.java

- rollback previous API for headers discovery

M classes_spec/org/mozilla/webclient/impl/wrapper_native/EventRegistrationImpl.java

- pass thru the capturePageInfo property

- add URIToStringMap, currently not working.

M classes_spec/org/mozilla/webclient/test/EMWindow.java

- call toString() on the eventData, don't cast it to a String.

M src_moz/EmbedProgress.cpp
M src_moz/EmbedProgress.h

- leverage the nsIHttpHeaderVisitor interface to discover the response
  headers.

- add boolean property capturePageInfo

A src_moz/HttpHeaderVisitorImpl.cpp
A src_moz/HttpHeaderVisitorImpl.h

- copy the headers to a Properties object.

M src_moz/Makefile.in

- compile two new files:

+	EventRegistrationImpl.cpp \
+	HttpHeaderVisitorImpl.cpp \

M src_moz/NativeBrowserControl.cpp
M src_moz/NativeBrowserControl.h

- pass the NativeWrapperFactory to our Init() method

- add wrapperFactory getter.

M src_moz/WrapperFactoryImpl.cpp

- pass the nativeWrapperFactory to the NativeBrowserControl's Init method.

M src_share/jni_util.cpp
M src_share/jni_util.h

- new constants: URI, headers

R test/automated/src/classes/org/mozilla/webclient/CurrentPageTest.java

- not yet time for this one
A test/automated/src/classes/org/mozilla/webclient/DocumentLoadListenerTest.java

- exercise bare minimum functionality of PageInfoListener

M test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java

- print out headers.
2004-09-09 20:17:18 +00:00
..
bal Make it so BAL_INTERFACE=1 compiles on Solaris. 2000-08-12 01:08:04 +00:00
bal_test Update makefile to pull JNI includes from src_share. 2000-08-11 21:35:29 +00:00
classes_spec/org/mozilla/webclient This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
config Bug=82189 2001-05-24 21:13:50 +00:00
import build_with_ant 2002-10-02 22:23:47 +00:00
src_ie Make webclient compile with Mozilla 1.6. Unit tests still don't run. 2004-02-23 06:26:54 +00:00
src_moz This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
src_share This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
test This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
README
build-tests.xml This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
build.xml This checkin implements a response header listener feature. 2004-09-09 20:17:18 +00:00
changelo

README

Here lies the MozWebShell java wrapper to mozilla M8.

Authors: Kirk Baker <kbaker@eb.com>
         Ian Wilkinson <iw@ennoble.co>

Build hacking and packaging: Ed Burns <edburns@acm.org>

Unix port: Mark Lin <mark.lin@eng.sun.com>

========================================================================
Win32 Build Directions:
========================================================================
Requirements:

* built mozilla with source code from after 10/5/99

* JDK1.1.7 or greater

* built org.mozilla.util java classes (see NOTE_UTIL)

* Perl 5 perl.exe must be in your path

How To Build:

* Follow the directions in ..\README

* type "nmake /f makefile.win all" and hope for the best

How to Run:

* once the build has successfully completed, run this batch file:

  .\src\WIN32_D.OBJ\runem.bat <opt: YOUR_URL>

  Note that YOUR_URL is probably necessary since firewall support wasn't
  working in M8.


Problems:

* clobber_all doesn't remove the .class files from dist\classes.  You
  have to do this manually.

* post to netscape.public.mozilla.java newsgroup

========================================================================
Unix Build Directions (currently only Linux, 
Solaris support is coming soon):
========================================================================
Requirements:

* built mozilla tree for some variant of Linux

* JDK1.2 with native threads support from http://www.blackdown.org 
(JDK1.1 doesn't seem to work)

* built org.mozilla.util java classes (see NOTE_UTIL)

How To Build:

* Follow the directions in ../util/README

* set JDKHOME to where your JDK install directory resides 
	-> setenv JDKHOME /usr/local/jdk1.2

* cd to 'classes' and type "make -f makefile.unix" and hope for the best
	-> cd classes; make -f Makefile.unix

* then cd to 'src' and type "make -f makefile.unix" and hope for the best
	-> cd src; make -f Makefile.unix

How to Run:

* once the build has successfully completed, run 'runem.unix' in your
'src' directory:
	-> cd src; ./runem.unix <YOUR_URL>

  Note that YOUR_URL is probably necessary since firewall support wasn't
  working in M8.

Problems? Email mark.lin@eng.sun.com or post to netscape.public.mozilla.java.

========================================================================
NOTE_UTIL:
========================================================================
* this package depends on the org.mozilla.util classes, which can be
  found in the mozilla tree under mozilla\java\util.  They are a
  separate checkout and build.  Once you check out the org.mozilla.util
  classes, see the README in the mozilla\java\util\README.

General notes:

* Please update the ChangeLog (changelo) when you make changes.