Bug 28249 - Error at file copy
Summary: Error at file copy
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: WebDAV Server (show other bugs)
Version: 2.0
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-07 07:59 UTC by Thomas Bernert
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Patch as announced (3.99 KB, patch)
2004-05-03 10:19 UTC, Stefan L
Details | Diff
testcase for copy with updated displayname (2.90 KB, text/plain)
2004-05-03 10:20 UTC, Stefan L
Details
testcase for move with updated displayname (3.38 KB, text/plain)
2004-05-03 10:21 UTC, Stefan L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bernert 2004-04-07 07:59:05 UTC
Hi,
when I copy a file, the file will be copied physical but the 
property "displayname" of the new file is still unchanged. Therefor you can't 
see the new file within the windows explore.
Comment 1 Ingo Brunberg 2004-04-07 08:15:35 UTC
This is more a problem of Windows Explorer than of Slide. Explorer, like any
other client, should not rely on the displayname property, but the actual URI of
the resource.

Moreover the COPY operation should preserve the values of the not live
properties, so I think Slide behaves absolute correctly.
Comment 2 Stefan L 2004-05-03 10:17:17 UTC
Hi, I reopen this issue because I want to add a patch that allows to 
configure whether the displayname is maintained while copy/move.
The patch only changes MacroImpl.java.

The patch introduces a namespace parameter "maintain-displayname".
If the parameter is set to "true" than the displayname property is
updated to the new filename if the displayname before the copy/move
action was the filename. If the parameter is not "true" the displayname
is not changed.

The patch also adds the regeneration of the etag property as requested
by bug 3925.

Wich the patch all functional testcases work. 
I also add to testcases, one for copy, one for move. Both will fail without
the patch, because of unexpected displayname value, and will path with
the patch.

Hopefully this met your approval. Stefan.
Comment 3 Stefan L 2004-05-03 10:19:34 UTC
Created attachment 11412 [details]
Patch as announced
Comment 4 Stefan L 2004-05-03 10:20:50 UTC
Created attachment 11413 [details]
testcase for copy with updated displayname
Comment 5 Stefan L 2004-05-03 10:21:15 UTC
Created attachment 11414 [details]
testcase for move with updated displayname
Comment 6 Stefan L 2004-06-03 16:59:19 UTC
I'have now fixed this, but I have changed the approach.

I have written a lister using the new event features of slide.
The listener is org.apache.slide.macro.MacroPropertyUpdater.

To enable this you have to add something like the following to
the events section of yout domain.xml. 

  <event classname="org.apache.slide.event.MacroEvent" enable="true"/>

  <listener classname="org.apache.slide.macro.MacroPropertyUpdater">
    <configuration>
      <update-displayname>true</update-displayname>
      <update-etag>true</update-etag>
      <update-owner-on-move>false</update-owner-on-move>
      <update-owner-on-copy>true</update-owner-on-copy>
    </configuration>
  </listener>

As you can see the DAV: properties displayname, etag and owner are
updated (The sample shows the default parameters)

Two testcases are added to verify the solution.
  functional\copy\copyChangedProperties.xml
  functional\move\moveChangedProperties.xml

Regards, Stefan