|
From: Rinalldo Y. <ry...@cs...> - 2004-10-24 05:36:17
|
Sorry, a bit lenghty mail here...
On Sat, 23 Oct 2004, Christoph Froehlich wrote:
> Hi Rinalldo
>
> Am Sonntag, den 24.10.2004, 00:44 +1000 schrieb Rinalldo Yasahardja:
>> Hi, I sent msgs previously regarding extending tmnav so it works on
>> applet. It is now working until i clicked on the close button from the
>> window (the cross shaped button). The applet closes but also closes the
>> browser (which is NOT intended).
>>
> Congratulations. I would be very interested to hear how you have done
> it. And, maybe there is a chance to see it running in public?
>
for what I did, in summary:
create an Applet class (called TMNavApplet in my case), then override
the init() function. That class should extends Applet. Inside the init()
function, you then do what you normally do in your main function, that is,
in case of TMNav, just move the content of main function inside the init()
function. As you know, TMNav can be run with several options such as -f
(which perform factory startup), etc. You then create a html page similar
like this:
<html>
<applet code="org/tm4j/tmnav/app/TMNavApplet.class" archive="all.jar"
height=200 width=200
alt="if this run, u see tmnav">
<param name=option value="-f">
<!-- put the path to the server here (URL)
example: http://www.cse.unsw.edu.au/~ryas138/index.xtm -->
<param name=filename value="pattern_v1.xtm">
Your browser is completely ignoring the <APPLET> tag!
</applet>
</html>
you then call the getParameter function inside your TMNavApplet class to
access the value passed by parameter (in this case,
getParameter("option") would return "-f")
the filename is for testing so TMNav can grab the file from the server.
you should also modify the logging.properties file path so that it is
grabbed from the server (rather than the client, like the current TMNav
behaviour), that way you remove all security issues that took me 2 weeks
to solve... =)
I would love to let you see it works on public but I would have to ask
permission first. Currently, since this is only for internal use, I doubt
connection outside the working environment will be allowed. But I can
always send you the development so you can play around with your own
server. But I didnt do the integration with the server bit, so I wont have
a clue about it. Let me fix this issue first though... =)
> As consequence to clicking the window closing button, TMNav calls
> System.exit(int). Maybe this is an overkill when running as an applet>
I did searches and found that Applet does not normally allow
System.exit(int) to be called. But I am still confused about this and will
look into it this week. Do you implement window closing button with your
custom listener ? If you do, do you know in which file ?
>
>
>> Since my teammates are supposed to access TMNav when connected to the
>> server, closing the browser would then force them to re-open browser and
>> log in back to the server manually.
>>
>> Also, when starting TMNav, if I got msg saying "Node Removed" then TMNav
>> doesnt launch, anyone know what is going on ?
>>
> Is it exactly what TMNav says? I searched the source code, but can't
> find that string, neither in tmnav nor in panckoucke.
>
> Maybe it's not comming from TMNav but from third-party code, called by
> tmnav. One thing which comes to my mind is, that TMNav stores session
> data with the help of java.util.prefs-package (this package uses the
> notion of a node as well). I don't know how the implementations react,
> when called from an applets context.
could be but I doubt it though. In my case, there are times when I close
TMNav applet but it doesnt crash the browser. However, when I tried to
invoke the applet again, it says Node Removed (may be it caught an
exception or something). However, I am a little bit suspicious with the
clearSessionData() in TMNav.java . In my case, I force TMNav to
always run
using "-f" parameter, which calls clearSessionData(). However, something
just prevent of running TMNav more than once. There is also a chance that
when the window close button is closed, the applet might not free the
resources used properly, but I dont know about it too...
but my suspicion is in the line that says TMNavRootNode.removeNode()
in clearSessionData() since
the msg said Node Removed and TMNav failed to start.
In other words, users can now log in to the server, then run TMNav once,
and hope that when they close TMNav, it doesnt crash the browser...
>
> Do you have more hints?
>
> c
>
>> thanks heaps in advance
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
>> Use IT products in your business? Tell us what you think of them. Give us
>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
>> http://productguide.itmanagersjournal.com/guidepromo.tmpl
>> _______________________________________________
>> Tm4j-tmnav-dev mailing list
>> Tm4...@li...
>> https://lists.sourceforge.net/lists/listinfo/tm4j-tmnav-dev
> --
> Christoph Froehlich <cf...@fo...>
>
|