Bug 187427 - Check Search Archive Files when Click Search from folder in Archive
Summary: Check Search Archive Files when Click Search from folder in Archive
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-16 19:36 EDT by Kevin Doyle CLA
Modified: 2011-05-25 07:48 EDT (History)
1 user (show)

See Also:
mober.at+eclipse: review? (xuanchen)


Attachments
Checks Search Archive's checkbox when selecting an archive or file in an archive (3.78 KB, patch)
2007-06-28 17:43 EDT, Kevin Doyle CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-05-16 19:36:54 EDT
To search in archive files you need to check the check box for Search Archive Files.  If I right click on a folder inside an archive already and select "Search" it would be nice if the check box was already checked for me.
Comment 1 Martin Oberhuber CLA 2007-05-17 15:43:27 EDT
Kushal, you are doing archive support and search... sounds like this is yours
Comment 2 Kevin Doyle CLA 2007-06-28 17:43:52 EDT
Created attachment 72742 [details]
Checks Search Archive's checkbox when selecting an archive or file in an archive

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 3 Martin Oberhuber CLA 2007-07-12 08:29:52 EDT
Xuan there is a patch from Kevin attached - but you've been dealing most with archives, could you have a look? Dave could you commit it?
Comment 4 Xuan Chen CLA 2007-07-12 10:32:11 EDT
I will review it.  Thanks.
Comment 5 Xuan Chen CLA 2007-07-12 13:23:17 EDT
The patch looks good in general.

Just a couple suggestions:
. Maybe we could move the checking for virtual file "absPath.indexOf(ArchiveHandlerManager.VIRTUAL_SEPARATOR)" to a method, probably in ArchiveHandlerManager.  This way we could make the code cleaner, and could deal with checking null point in a place. 
. right now, the code takes care of the case when search Folder is an archive file or a virtual folder.  It will be nice if we could also detect the file name pattens, and check the checkbox if it contains .zip, .jar, etc.
Comment 6 David McKnight CLA 2007-07-12 14:01:20 EDT
It would be good to move the checking to a method in ArchiveHandlerManager however, since it's API that would have to wait for a future release.  Are we okay with committing the code as is for now?
Comment 7 Kevin Doyle CLA 2007-07-12 14:33:19 EDT
Xuan, we don't need to check the extensions to determine if a file is an archive.

This line of code does it and for folders under it:
isPartOfArchive = supportsSearch && supportsArchiveManagement && (remoteFile.isArchive() || (absPath.indexOf(ArchiveHandlerManager.VIRTUAL_SEPARATOR) > 0));

remoteFile.isArchive() will return true on zip, tar, and jar files.  Checking the path is for files under the archive.
Comment 8 Xuan Chen CLA 2007-07-12 14:44:46 EDT
It is fine with me.

Kevin, could you please open an enhancement for also recognizing some zip file patterns if user changed/add something in the File name patterns field?  Thanks.
Comment 9 Kevin Doyle CLA 2007-07-12 16:33:48 EDT
Xuan, bug #196378 has been opened for checking "Search Archive files" when entering an archive handler extension in the file name patterns text box.
Comment 10 David McKnight CLA 2007-07-12 17:06:36 EDT
I've committed the fix to cvs.
Comment 11 Martin Oberhuber CLA 2007-07-13 06:36:22 EDT
(In reply to comment #7)
> remoteFile.isArchive() will return true on zip, tar, and jar files.

The way that RemoteFile.isArchive() is implemented, it check with the (client's) ArchiveHandlerManager whether the file is an archive.

I find that problematic since different archive handlers may be installed on the (dstore) server than on the client. How would we treat the case where an extender contributed some tgz, or tar.bz2 archive handlers on the client only but not on the dstore server? Should we file a new bug for handling this properly?
Comment 12 Kushal Munir CLA 2007-07-13 10:35:05 EDT
Martin, I think a separate bug would be a good idea. Ideally, if an archive handler is registered on the client or the server, it would automatically send to the other side if it's not there. Currently, there are two separate registration mechanisms for the client and server because we did not resolve this issue.

For the time being though, the implementation of RemoteFile.isArchive() could be changed. 

Comment 13 Kevin Doyle CLA 2007-07-15 15:44:38 EDT
Verified fixed with I20070713-0605 and opened bug #196578 for isArchive() issue.