What you're describing should be working. It looks like the WebDAV
servlet thinks that your file is a collection. I don't know how it
determines this, but a GET request to a collection will result in the
kind of response that you're getting.

The only thing I can suggest is to add some debugging output to try to
find out why the servlet thinks the file is a directory.

-James

>>> [EMAIL PROTECTED] 6/30/2004 3:50:31 PM >>>
I am continuing to try and create my own content store to eventually
hook
into an existing Content Management Application that has an exposed
API.  I
have gotten as far as given a URI like "/slide/files/1234" I return
that
it's a collection and it contains a Word document named
"1234Document.doc".
Opening a Windows XP network place to http://host/slide/files/1234 
<http://host/slide/files/1234>  results in a Word icon with the
correct
name.  My goal is that when I click on the Word icon on the network
place to
open the document in Word, the contents of the document will simply be
"File
ID = 1234".  (I call setContent method on NodeRevisionContent object
to
manipulate the data).  However, when I click to open the Word document
now,
its contents are the HTML that would result if you were to browse
http://host/slide/files/1234 <http://host/slide/files/1234>  using a
non
WebDAV client like IE.  It doesn't appear that my
retrieveRevisionContent()
method is ever being called.

1.  What determines with retrieveRevisionContent() should be called?
2.  Collections are identified as resourceType = <collection/>.  How
should
actual files be identified?  Does that matter?

Here are some code details

When retrieveObject(Uri uri) is called for a uri like "/files/1234"
==================
UriPath uriPath = new UriPath(uri.toString());
Vector children = new Vector();
String childFileName = uriPath.lastSegment() + Document.doc"  //Make
containing file like "1234Document.doc"
children.add(0,childFileName);
Vector links = new Vector(); //Empty links vector
return new SubjectNode(uri.toString(), children, links);


When retrieveObject(Uri) is called for a uri like
"/files/1234/1234Document.doc"
==================
return new SubjectNode(uri.toString());


When retrieveRevisionDescriptor(Uri uri, NodeRevisionNumber
revisionNumber)
is called
==================
If(revisionNumber == null){revisionNumber = new
NodeRevisionNumber("1.0");}
String branchName = "main";
Vector labels = new Vector(); //Empty labels vector
Hashtable properties = new Hashtable();
NodeRevisionDescriptor nrd = new
NodeRevisionDescriptor(revisionNumber,
branchName, labels, properties);
------------then-------------
When the uri is like "/files/1234"
-------------------------------
nrd.setResourceType("<collection/>");
nrd.setSource("");
nrd.setContentLength("0");
-----------but---------------
When the uri is like "/files/1234/1234Document.doc"
------------------------------
nrd.setResourceType("");
nrd.setSource("");
nrd.setContentLanguage("en");
nrd.setContentLength("24064");
nrd.setContentType("application/msword");
nrd.setName(uriPath.lastSegment()); //Sets the name to
"1234Document.doc"


The final bit when retrieveRevisionContent(Uri uri,
NodeRevisionDescriptor
revisionDescriptor) is called for a uri like
"/files/1234/1234Document.doc"
====================
String s = new String("File ID = " + uriPath.lastSegment()); // "File
ID =
1234"
NodeRevisionContent result = new NodeRevisionContent();
result.setContent(s.toCharArray());
return result;

When I double click on the Word Icon labeled "1234Document.doc" in the
Network Place", instead of a Word opening the document with the content
I
placed in the result using setContents() method when the GET request
comes
through, the content of the Word Document is HTML as if I was browsing
using
IE.

<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" >
</meta>
<title>Directory listing for /files/1234/1234Document.doc</title>
</head>
<body bgcolor="white">
<table width="90%" cellspacing="0" cellpadding="5" align="center">
<tr><td colspan="3"><font size="+2">
<strong>Directory listing for /files/1234/1234Document.doc</strong>
</font></td></tr>
<tr><td colspan="5" bgcolor="#ffffff">
<a href="/slide/files/1234">Up To /files/1234</a>
</td></tr>
<tr><td colspan="5" bgcolor="#ffffff">&nbsp;</td></tr>
<tr bgcolor="#cccccc">
<td align="left" colspan="3"><font
size="+1"><strong>Filename</strong></font></td>
<td align="center"><font size="+1"><strong>Size</strong></font></td>
<td align="right"><font size="+1"><strong>Last
Modified</strong></font></td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="3" bgcolor="#cccccc"><font size="-1">Jakarta Slide
2.0</font></td>
<td colspan="2" align="right" bgcolor="#cccccc"><font size="-1">
4c
Wed, 30 Jun 2004 17:30:29 EDT</font></td></tr>
</table>
</body>
</html>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to