List Info

Thread: Opera problem!




Opera problem!
user name
2006-11-22 23:22:45

andrewg_oz wrote:
> I just downloaded a fresh 2.1.3 and it saved OK with my
Opera 9.02 on
> WinXP. Have a look at the Java Console and see if there
are any
> messages there.

I've been trying to use TiddlySaver on GenToo Linux with
Opera 9.0 and
have had the same problem.

I started playing with the TiddlyWiki javascript directly,
tracking
down problems
with alerts and here's what I figured out:
  1.  It's not TiddlyWiki, it's a feature of trying to save
to a file
under 1.5.0
  2.  The problem relates to the need to change TiddlySaver
so that it
executes
       the file save operation inside of the run method of a
PrivilegedAction derivative.
      If you don't do this, you'll get exactly the
right-but-can't-read
behavior with ANY
      applet in the browser (I wrote a small, separate test
for
TiddlySaver and verified this,
      then wrapped the access in a privileged action class
executed
directly via
      AccessController.doPrivileged and my test suddenly
worked).
   3.  No amount of noodling with policy files will help
unless you do
the wrapping in step 2, something
        like:
   import java.io.*;
   import java.security.*;

   ... declare class, start method for saveFile and...
     AccessController.doPrivileged(new PrivilegedAction() {
                  public Object run() {
... write to file here...
                  }
              });

...rest of file...

I haven't integrated this stuff to a version of TiddlySaver
and tried
it but I've duplicated
the bug with a separate applet and a little html that loads
it.  By
allowing or revoking the right
java policy entry I can now make the write fail or not.

I've also noticed when testing:
   1.  Between testing you better open the java console and
tell it:
fgxl
       That's finalize, garbage collect, throw away class
loaders, list
class loaders (to make sure there are none).
        And close the page first.
   2.  Messing with policy seems to require me to close the
browser and
reopen... disabling and enabling java may or may not help
(I'm not
really sure, to be honest).

I'll give fixing this against a fresh 2.1.3, unmodified
empty.html a
try if I have time over the long weekend.

I've been wanting to do some light blogging using this thing
for a long
time but have had a lot of trouble up to now in opera9 and I
finally
decided to dig in and find the problem.

Thomas


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "TiddlyWiki" group.
To post to this group, send email to TiddlyWikigooglegroups.com
To unsubscribe from this group, send email to
TiddlyWiki-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Opera problem!
user name
2006-11-23 06:33:37
Whoops.  I was writing my last message from work at the end
of the day
and had to type quickly.  A couple of clarifications:
  1.  The separate test I said I wrote for TiddlySaver just
exercises
it from a separate java application that I manually ran in
the sandbox
to make it fail.  I then allowed the write via .java.policy
and it
worked for me.
2.  After doing #1 I changed the test application to a test
applet and
exercised it in the applet viewer and in Opera9.00.  It
worked (when I
had the policy file enstated) in the appletviewer, but not
in Java.
3.  Finally, I took some other file write code I found on
the net (it
just uses a FileWriter) and hooked that up to an applet and
duplicated
the "I can't write even with correct policy
condition".  I then wrapped
the write function in a PrivilegedAction as discussed in my
previous
post and was able to write.

I was also able to use TiddlySaver to write a *separate*
file from the
current tiddlywiki from saveFile where you normally write
the "revised"
local variable in the tiddlywiki javascript after I wrapped
the write
appropriately.

BUT!  I can't save the wiki because I'm using the really old
TiddlySaver source off of Andrew's web page and that doesn't
handle
UTF-8 (it's saveFile has one argument).
SO:  while playing with it, I modded my tiddlywiki (not in
source with
a rebuild, but the actual live copy I was using) to be
compatible with
that old version.  THAT was the copy I coaxed into writing a
separate
file.

Finally, I think just implementing wrapping of the
TiddlySaver's
saveFile method body PrivilegedAction or a class derived
from it (the
latter makes it much easier to move data in and out of its
run method)
should suffice to make the TiddlySaver work with jdk1.5.0.

I have no idea what happens with other browsers and
configurations, but
according the sun's documentation, this wrapping the of the
write
method is correct way of doing it.  I just don't know when
it became
the sanctioned method.

Sorry for two long ones.  Drop me a line if you want to see
anything
I've done.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "TiddlyWiki" group.
To post to this group, send email to TiddlyWikigooglegroups.com
To unsubscribe from this group, send email to
TiddlyWiki-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )