зеркало из https://github.com/mozilla/pjs.git
cadd94c8f8
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. |
||
---|---|---|
.. | ||
build | ||
config | ||
dom | ||
external | ||
pluggable-jvm | ||
plugins | ||
util | ||
webclient | ||
xpcom | ||
.cvsignore | ||
README | ||
README.commercial | ||
build.properties.sample | ||
build.xml | ||
changelo | ||
makefiles |
README
20040222 This README documents the Java Enhancers to the Mozilla web browser. Currently, the only active sub-project is the Webclient Java API to the Mozilla web browser. This project also leverages the JavaDOM sub-project. Requirements: * J2SDK 1.3.1 or later * Apache ant 1.4.1 or later. If running under J2SDK 1.4.2 or later, you need ant 1.6.1, due to javah issues. * Successfully built debug enabled Mozilla 1.6 tree How To Build: * cd to the directory above your top level mozilla directory and cvs checkout the Webclient module. * Modify mozilla/allmakefiles.sh and prepend the contents of the file "makefiles", in this directory, to add_makefiles section after the "Common makfiles used by everyone" comment. * re-run ./configure to generate the java makefiles * put the "mozilla/dist/bin" directory in your LD_LIBRARY_PATH on Unix, or PATH on Win32. * set the value of the environment var MOZ_JDKHOME to be your J2SDK directory. * Create a build.properties file in the mozilla/java directory with the following contents. ###### build.unix.classes=true build.win32.classes=false build.home=/home/edburns/Projects/mozilla/MOZILLA_1_4/mozilla/dist/classes compile.debug=true ###### Of course, set the values of the above properties correctly according to your system. * run "ant" in the mozilla/java directory. This will build webclient and all dependent libraries. How to run the Junit tests: * Make sure junit.jar is properly set in your mozilla/java/build.properties * Make sure junit.jar is installed in your $ANT_HOME/lib directory * Set the following variables in your environment NSPR_LOG_MODULES=webclient:4,webclientstub:4 NSPR_LOG_FILE=logfile.txt * cd to mozilla/java/webclient * Kill any running mozilla instances. These will mess up the profilemanager code. * run ant test How to run the test browser (broken as of this writing): * cd to mozilla/java/webclient/src_moz and run the "runem" batch file to run the test browser. Problems? * post to netscape.public.mozilla.java newsgroup