Drag & Drop of _PDFs_ no longer working?

14 views
Skip to first unread message

Bernard

unread,
Jun 3, 2011, 11:25:00 AM6/3/11
to Open Wonderland Forum
Anyone else having this problem? If I drag and drop a PDF I get an
exception on the client (see below), even though the cell opens, and
the PDF has successfully uploaded to the webdav. I can insert the PDF
using the content browser with no problem. I suspect some kind of race
condition with Nigel's amazing multi-threaded document loading
framework (which makes my head hurt).

This is with a Mac client, on a Mac server, running rev 4692 from
source.

cheers

Bernard
-----------
03-Jun-2011 16:09:57 org.jdesktop.wonderland.client.input.InputManager
drop
WARNING: Drop: 27 items
03-Jun-2011 16:09:57
org.jdesktop.wonderland.client.jme.dnd.DragAndDropManager
$GlobalDropListener drop
WARNING: In global listener: 3
03-Jun-2011 16:09:57
org.jdesktop.wonderland.modules.webdav.common.WebdavContentCollection
getChild
WARNING: In path +Spaces_D1.1.1_V1.0.pdf element
+Spaces_D1.1.1_V1.0.pdf not found
03-Jun-2011 16:09:57
org.jdesktop.wonderland.modules.webdav.common.WebdavContentCollection
getChild
WARNING: In path +Spaces_D1.1.1_V1.0.pdf element
+Spaces_D1.1.1_V1.0.pdf not found
03-Jun-2011 16:09:58
org.jdesktop.wonderland.client.assetmgr.content.WlContentAssetRepository
openAssetStream
WARNING: Unable to open URL for asset
http://192.168.1.88:8080/webdav/content/users/bernard/+Spaces_D1.1.1_V1.0.pdf
response 404
03-Jun-2011 16:09:58
org.jdesktop.wonderland.modules.pdfviewer.client.PDFDocumentLoader run
WARNING: failed to open: wlcontent://us...@192.168.1.88:8080/bernard/+Spaces_D1.1.1_V1.0.pdf:
java.lang.NullPointerException
java.lang.NullPointerException
at
org.jdesktop.wonderland.modules.pdfviewer.client.PDFDocumentLoader.getDocumentData(PDFDocumentLoader.java:
97)
at
org.jdesktop.wonderland.modules.pdfviewer.client.PDFDocumentLoader.run(PDFDocumentLoader.java:
118)
at java.lang.Thread.run(Thread.java:680)
03-Jun-2011 16:09:58
org.jdesktop.wonderland.modules.pdfviewer.client.PDFViewerPanel$2
documentLoadStateChanged
WARNING: failed to load: wlcontent://us...@192.168.1.88:8080/bernard/+Spaces_D1.1.1_V1.0.pdf:
java.lang.NullPointerException
03-Jun-2011 16:09:58
org.jdesktop.wonderland.client.cell.CellChannelConnection
$CellMessageDelivery deliver
WARNING: Delaying messages for cell 4

Ric Moore

unread,
Jun 4, 2011, 5:03:39 PM6/4/11
to openwon...@googlegroups.com
On Fri, 2011-06-03 at 08:25 -0700, Bernard wrote:
> Anyone else having this problem? If I drag and drop a PDF I get an
> exception on the client (see below), even though the cell opens, and
> the PDF has successfully uploaded to the webdav. I can insert the PDF
> using the content browser with no problem. I suspect some kind of race
> condition with Nigel's amazing multi-threaded document loading
> framework (which makes my head hurt).
>
> This is with a Mac client, on a Mac server, running rev 4692 from
> source.
>
> cheers
>
> Bernard
> -----------
> 03-Jun-2011 16:09:57 org.jdesktop.wonderland.client.input.InputManager
> drop
> WARNING: Drop: 27 items
> 03-Jun-2011 16:09:57
> org.jdesktop.wonderland.client.jme.dnd.DragAndDropManager
> $GlobalDropListener drop
> WARNING: In global listener: 3
> 03-Jun-2011 16:09:57
> org.jdesktop.wonderland.modules.webdav.common.WebdavContentCollection
> getChild
> WARNING: In path +Spaces_D1.1.1_V1.0.pdf element
> +Spaces_D1.1.1_V1.0.pdf not found

You have a "+" sign in the file name? Ric

--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
Linux user# 44256

Bernard

unread,
Jun 6, 2011, 11:15:15 AM6/6/11
to Open Wonderland Forum
Ric, nice catch!

If I use a filename that doesn't have chars that need URL encoding,
then it seems to be fine.

so, does this mean the filenames should be URL escaped?

Smells like a bug to me, but I'm not sure if it's in the webdav or in
the PDFViewer module. Anyone?

cheers

Bernard

Jonathan Kaplan

unread,
Jun 6, 2011, 12:04:17 PM6/6/11
to openwon...@googlegroups.com
Bernard,

I agree this seems like a bug.  I can see at least three places that need investigating:

1. the webdav repository should automatically URL encode the names of children.  I'm not sure if the HttpURL constructor does or not:


If that code is working, you should see your file in the content repository, even though the PDF doesn't render.


2. the content repository uploader generates URLs for filenames in two places:


These values need to be encoded. Note that the badly named URLEncoder won't do the encoding you want (for example, it will replace ' ' with '+' instead of '%20'.  The proper way to do it seems to be using the URI constructor:

String encPath = new URI(null, null, "users/" + loginInfo.getUsername() + "/" + fileName, null).toASCIIString();
return "wlcontent://" + encPath;


3. For models, there is extra work to upload textures, etc. The model loader needs similar changes to the generic uploader at least here:


There may be some other tweaks needed in the rest of the class.

Ric Moore

unread,
Jun 6, 2011, 5:17:50 PM6/6/11
to openwon...@googlegroups.com
On Mon, 2011-06-06 at 08:15 -0700, Bernard wrote:
> Ric, nice catch!
>
> If I use a filename that doesn't have chars that need URL encoding,
> then it seems to be fine.
>
> so, does this mean the filenames should be URL escaped?
>
> Smells like a bug to me, but I'm not sure if it's in the webdav or in
> the PDFViewer module. Anyone?

Best bet is to not have anything weird going on with directory /
filenames. :) Life is so much easier! It's just an old habit of mine to
not have spaces or strange chars floating around... but MS seems to
encourage it to users who are exploring launching Internet services. (c:
\Windows Users <--prime example) The use of the space char is reserved
for old time UNIX /etc/host file usage, that specifies aliases, from
what I recall. It's legacy, but still in use. I use it, as I'm too lazy
to setup DHCP for just a couple of machines on my local net. So, a space
or any other forbidden character, just gums up the works for now.

"Illegal filename characters: \ (backslash), / (forward slash), :
(colon), * (asterisk), ? (question mark), " (double quotes), < (left
angle bracket), > (right angle bracket), | (pipe). Most of these are
Windows OS constraints; Mac allows all except a colon (though a forward
slash, /, can cause issues for POSIX paths). The aim here is to allow
problem-free cross-platform use. An all-Windows or all-Mac organization
may need to interact with others using different OSs, so the safe method
is to observe both OS' limitations, even if you mostly/always work on
only one OS."
Check this: http://www.portfoliofaq.com/pfaq/FAQ00352.htm

So, best bet, consider all paths/filenames to be handled as URL's, which
OWL/Java seems to handle everything as. Follow those rules, keep paths
and filenames clean and lower case, everything is dandy.

"Anyway, don't feel compelled to apply all of the above rules. Rather,
be aware of them and apply them as appropriate. If you are starting a
new collection or re-ordering old content you're at the right point to
get some discipline into the naming. If some or all of your new content
comes in from external sources and is poorly named, sit down with your
partners make sure good naming rules are in the contract. Then, if it's
wrong, they can rename files at their time/expense - a good
encouragement for them to adopt good practice from outset."

There's plenty else to worry with. My database refuses to open and I'm
on that witch hunt. But, I do know it's not because of a directory /
filename problem. <grins hugely> Ric

Reply all
Reply to author
Forward
0 new messages