You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Pill, Juergen" <Ju...@softwareag.com> on 2001/07/25 18:11:23 UTC

Dates are not displayed in MS file manager

Hello,

Anyone wondered, that the dates are not displayed at the MS FileManager
properties dialog window (for created, modified, accessed)?

Here is the reason (thus the solution seams not obvious to me):


WebDAV defined that dates are stored/transported for 

1) Creationdate
Creationdate will be stored in the format: ISO 8601, e.g.
SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'")
2) Getlastmodified
Getlastmodified will be stored in either RFC 1123, RFC 850 or ANSI C's
asctime() format.

Slide stores creationdate in ISO 8601 and getlastmodified in RFC 1123.
delivering these dates in the defined formats causes the MS file manager not
to display the dates. If the dates are formatted into the default pattern
for the default locale of Windows, causes at least the MS file manager to
display created and modified, but Office still will not display the dates.

The "Accessed" property is not transported to the server by a proppatch
command (to my experience) at all.

Enclosed is the ugly hack to display the dates, but performing this hack
might cause additional interoperability problems with different tools
obeying the standard.

Does someone have a bright idea?

Best regards

Juergen Pill


				while (propertyList.hasMoreElements()) {
					NodeProperty currentProperty =
						(NodeProperty)
propertyList.nextElement();
					if (currentProperty != null) {
						String namespace =
currentProperty.getNamespace();
	
generateNamespaceAbbreviation(namespace);
						String namespaceAbbrev =
							(String)
namespaces.get(namespace);
						Object currentPropertyValue
= currentProperty.getValue();
						if ((currentPropertyValue ==
null) ||
	
(currentPropertyValue.toString().equals(""))) {
	
generatedXML.writeElement
	
(namespaceAbbrev, namespace,
	
currentProperty.getName(),
	
XMLPrinter.NO_CONTENT);
						} else {
	
generatedXML.writeElement
	
(namespaceAbbrev, namespace,
	
currentProperty.getName(),
	
XMLPrinter.OPENING);
							
							if
(currentProperty.getName().equals("creationdate"))  {
								String
dateString = currentPropertyValue.toString();
	
System.out.println("creationdate " + dateString);
								try
								{
								dateString =
new SimpleDateFormat().format(
									new
SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'").parse(dateString));
									
								}
								catch
(Exception e)
								{
	
e.printStackTrace();
								}
	
generatedXML.writeText(dateString);
							} else 	if
(currentProperty.getName().equals("getlastmodified")) {
								String
dateString = currentPropertyValue.toString();
	
System.out.println("getlastmodified " + dateString);
								try
								{
								dateString =
new SimpleDateFormat().format(
									new
SimpleDateFormat("EEE, d MMM yyyy hh:mm:ss z").parse(dateString));
									
								}
								catch
(Exception e)
								{
	
e.printStackTrace();
								}
	
generatedXML.writeText(dateString);
							} else {
	
generatedXML.writeText(currentPropertyValue.toString());
							}
	
generatedXML.writeElement
	
(namespaceAbbrev, namespace,
	
currentProperty.getName(),
	
XMLPrinter.CLOSING);
						}
					}
				}