[kepler-dev] Re: kepler/src/util/Browser.java

Bertram Ludaescher ludaesch at sdsc.edu
Wed Feb 11 11:10:42 PST 2004


Christopher:

Thanks very much for looking further into this. 

Efrat and/or Ilkay: when you get a chance, why don't you chase some of 
those leads further.

The standard "deal" for writing an actor should also include some
documentation (in the case of the browserUI actor, some of the strange 
design decisions we've made would probably be at least explained ;-)

ciao

Bertram

>>>>> "CHB" == Christopher Hylands Brooks <cxh at eecs.berkeley.edu> writes:
CHB> 
CHB> I took a look at this, and it is a bit of a mess.
CHB> What we would like to do is to have it so that BrowserLauncher
CHB> will optionally open a URL in a separate browser, and
CHB> the browser will be the user's selected browser.
CHB> 
CHB> The short answer is that it would not be easy.
CHB> 
CHB> The longer answer is that ptolemy/actor/gui/BrowserLauncher.java
CHB> is from http://browserlauncher.sourceforge.net/
CHB> and under Windows NT and later, it calls Runtime.exec() with
CHB> 
CHB>     cmd /c start "" http://ptolemy
CHB> 
CHB> This seems to bring up the web page in the browser, replacing the
CHB> current page.
CHB> 
CHB> I found various references to people wanting to bring up a separate
CHB> browser, but no good code.
CHB> 
CHB> There are mentions of running
CHB>     rundll32 url.dll,FileProtocolHandler http://www.microsoft.com
CHB> but there are various issues.
CHB> 
CHB> http://www.jsiinc.com/SUBI/tip4100/rh4162.htm says
CHB> 
CHB> --start--
CHB> How can I open a URL from the Windpws 2000 command line?
CHB> 
CHB> 
CHB> rundll32.exe url.dll,FileProtocolHandler http://www.jsiinc.com
CHB> 
CHB> OR
CHB> rundll32.exe url.dll,FileProtocolHandler
CHB> http://www.jsiinc.com/reghack.ht%6D
CHB> 
CHB> OR
CHB> start www.jsiinc.com
CHB> 
CHB> OR
CHB> start www.jsiinc.com/reghack.htm
CHB> 
CHB> NOTE: Rundll32 doesn't like .htm or .html files, which is why .ht%6D
CHB> works, %6D is the hexidecimal code for m.
CHB> 
CHB> NOTE: The above commands will use an existing browser window if one
CHB> exists.
CHB> 
CHB> To always open a new browser window:
CHB> 
CHB> "C:\Program Files\Internet Explorer\IEXPLORE.EXE" www.jsiinc.com
CHB> 
CHB> OR
CHB> "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
CHB> www.jsiinc.com/reghack.htm
CHB> 
CHB> To open the browser window at a fixed location and size:
CHB> 
CHB> "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
CHB> javascript:window.resizeTo(1194,960);window.moveTo(80,5);location.href="http://www.jsiinc.com/reghack.htm"
CHB> 
CHB> NOTE: rundll32.exe url.dll,FileProtocolHandler www.jsiinc.com also works.
CHB> --end--
CHB> 
CHB> However
CHB> http://support.microsoft.com/default.aspx?scid=kb;en-us;283225
CHB> says that the above is obsolete
CHB> 
CHB> The Microsoft article discusses querying the registry and getting the
CHB>       HKEY_CLASSES_ROOT\http\shell\open\command
CHB> key, which for me is set to
CHB>       C:\PROGRA~1\MOZILLA.ORG\MOZILLA\MOZILLA.EXE -url "%1"
CHB> 
CHB> When I execute the above command, I get a new browser each time!
CHB> 
CHB> However, I'm not sure how we can get the registry key while
CHB> using Sun's JVM. The code example uses classes from com.ms.*.
CHB> We could probably overcome this, perhaps by using a small
CHB> native function.  
CHB> 
CHB> The following was also useful:
CHB> http://forum.java.sun.com/thread.jsp?thread=28192&forum=17&message=69226
CHB> 
CHB> There is a GPL'd implementation at
CHB> http://ostermiller.org/utils/Browser.html
CHB> that looks interesting and might meet our needs.  However, because
CHB> it is GPL'd, I'd rather not include it in the core part of Ptolemy.
CHB> 
CHB> I'll poke around at this somemore at some point.
CHB> 
CHB> -Christopher
CHB> 
CHB> --------
CHB>     
CHB>     This was actually written quite some time ago when I encountered some
CHB>     problems using the BrowserLauncher. I was just reorganizing the repository
CHB>     to avoid code duplication (in Kepler).
CHB>     
CHB>     The BrowserLauncher class displays all URLs in the same browser window. I
CHB>     need to display several URLs in different windows during the workflow
CHB>     execution. Is it possible to extend this class to fit these needs?
CHB>     
CHB>     Thanks,
CHB>     
CHB>     Efrat
CHB>     
CHB>     ----- Original Message ----- 
CHB>     From: "Christopher Hylands Brooks" <cxh at eecs.berkeley.edu>
CHB>     To: "Efrat Jaeger" <jaeger at ecoinformatics.org>
CHB>     Cc: <kepler-dev at ecoinformatics.org>
CHB>     Sent: Monday, February 09, 2004 10:21 AM
CHB>     Subject: kepler/src/util/Browser.java
CHB>     
CHB>     
>> I noticed a cvs log message for kepler/src/util/Browser.java
>> 
>> Just in case you do not know, Ptolemy II has a Browser invoker at
>> ptII/ptolemy/actor/gui/BrowserLauncher.java
>> 
>> You can find the source code online at
>> 
CHB>     http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII/ptolemy/actor/gui/B
CHB>    rowserLauncher.java
>> 
>> The Javadoc is at
>> 
CHB>     http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII3.0/ptII/doc/codeDoc/ptolemy
CHB>    /actor/gui/BrowserLauncher.html
>> 
>> See also
>> http://www.javaworld.com/javaworld/javatips/jw-javatip66.html
>> 
>> I'm not sure if the BrowserLauncher would meet your needs.
>> BrowserLauncher does try to support MacOS.
>> 
>> If need be, we could further abstract the code so that you could use
>> it.
>> 
>> -Christopher
>> 
CHB> --------
CHB> _______________________________________________
CHB> kepler-dev mailing list
CHB> kepler-dev at ecoinformatics.org
CHB> http://www.ecoinformatics.org/mailman/listinfo/kepler-dev



More information about the Kepler-dev mailing list