Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-vcm-dev] Move Delete Hooks problem


All,

I am working on move delete hooks for a repository provider plug-in. It seems like the navigator view and the package explorer view handle moving resources differently.

Let us assume my package structure is defined as the following:

Navigator View:
+ src
  + com
       + ibm
           + package1
                     Test1.java
                     Test2.java
                     + innerPackage
                              Test3.java  

Package Explorer View:
+ src
      + com.ibm.package1
               Test1.java
               Test2.java
      + com.ibm.package1.innerPackage
                Test3.java  

If I try to rename the folder package1 inside navigator view, a moveFolder is called on package1 which seems to make sense. But if we try to rename the package package1 to package2 in package explorer, the jdt does a real good job of calling the moveFile(Test1.java) and moveFile(Test2.java) rather than renaming outer and inner package com.ibm.package1.innerPackge. ( This seems to make sense because jdt does not want to rename all the inner package structures).

To acomplish the above mentioned scenario, jdt does the following:
1. Create a package com.ibm.package2
2. Move the filesTest1.java and Test2.java from package1 to package2.
3. Since the move did not happen in the repository, being a pessimistic provider, I cancel the local move operation after getting the users input on the cancel operation. User had requested to cancel the operation and hence I set the status to IStatus.OK.
4. Since the source package com.ibm.package1 is not empty, jdt tries to delete the file Test1.java and Test2.java from com.ibm.package1. ( Interestingly jdt does not check whether the move operation  was successful or not... Does it mean I need to set the status to ERROR or error rather than OK to make jdt realize that move delete hooks were called but the move did not happen ( setting it to INFO does not change the behavior. setting it to ERROR will abort the operation which I don't need. I want to provide users with an option to rename all the files under the package in the repository and if successful want to mirror the operation locally) ).

Should the jdt not check the return codes ( or atleast the existense of the resource in source package ) and do the operations appropriately. if I cancel my individual renames of all files and the deletes on all the files, I get a internal error exception "Resource Test1.java not found in package com.ibm.package2". The package com.ibm.package2 is not deleted too after the operation is completed.

Thanks
Balaji
     
 

Back to the top