Deleting from the Repository
Note: This tip contains descriptions of deletions from both versions of VisualAge for Java. Make sure you follow the directions for your version of the tool!
One of the most glaring omissions from version 1.0 of this great tool is that you cannot easily delete from the repository. Here's the only way I know of that you can clean things up!
The following procedure shrunk my repository from 36MB to 18MB! That's gotta help performance somewhere!
What is in the repository?
In the repository you have
- TWO versions of the JDK (one for PM, one for Win32)
- About 4MB of examples (more for Enterprise version)
- IBM UVM Class Libraries (used in the Visual Composition editor, mainly as property editors)
- Your code
What do you need to keep?
You need to keep:
- The version of the JDK that your platform uses
- Sun Class Libraries PM for OS/2
- Sun Class Libraries Win32 for Windows
- IBM UVM Class Libraries (used a lot by VAge)
- (for version 2.0) IBM IDE Utility Class Libraries (for tool integration)
- EAB Project (VisualAge Enterprise)
- (Thanks to Scott Wadler for pointing this out!)
- The example projects. You can delete these, but deleting them seems to cause some sort of problem in the VCE sometimes. Safer to just keep them.
- Any code you want to keep
The deletion procedure varies for version 1.x and 2.x of VisualAge for Java. Follow the section appropriate to the version of the tool that you are using.
Note: If you are running version 1.x of VisualAge for Java, see Deletion Procedure, VisualAge for Java Version 1.x. You cannot use the 2.x procedure for version 1.x.
V2.0 has three respository functions called "purge", "restore" and "compact."
"Purge" marks projects, packages, classes/interfaces and methods as "garbage". If you decide to get them back, you can "restore" these marked objects. They still exist in the repository. You cannot purge versions of objects that are referenced in your workspace.
"Compact" removes all purged items from the repository. They CANNOT be recovered. Note that you cannot compact unless _all_ objects in your workspace have been versioned. "Compact" also gets rid of "open" editions of methods. These are all those timestamped versions of methods that you can replace while working on methods.
There's a trick with "purge", though.
If you purge a project, you ONLY purge the project object from the repository. It _does_not_ affect any of the packages, class/interfaces or methods referenced in that project.
If you purge a _package_, all versions of objects referenced in that package are purged (as long as those versions aren't used somewhere else, like in a different version of the package.)
Deletion Procedure, 2.x
If you want to get rid of excess baggage in the repository, I recommend the following actions:
- add everything you want to keep to your workspace (this makes sure you don't accidently purge something you wanted, as its in the orkspace and VAJ won't let you purge it.)
- make sure everything in your workspace is versioned
- bring up repository explorer
- purge versions of projects you don't want any more (purge is on the popup menu for packages and projects in the repos explorer)
- purge versions of packages you don't want any more
- compact the repository (Admin->Compact repository)1
The compact may give you time to get that Columbian coffee DIRECT, so give it some time...
If you are running version 2.x STOP HERE! DO NOT follow any of the following text!
Note: If you are running version 2.x of VisualAge for Java, see Deletion Procedure, VisualAge for Java Version 2.x. Do not use the 1.x procedure for version 2.x!!!!!!!!!!!!!!
A BIG NOTE
The stuff you export in interchange file ONLY KEEPS THE LATEST VERSION! If you think you'll ever need older versions of your source, either DO NOT do this cleanup, or make sure you keep the ivj.dat.old file around somewhere safe.
Deletion Procedure, 1.x
WARNING: I cannot take responsibility is this procedure does not work for you! Make sure you back up your repository file (\IBMVJava\ide\repository\ivj.dat) before doing this!
To clean things up:
- Back up your repository (mentioned above) to some place safe.
- Make sure all of your projects in the workspace are versioned
- Make sure all projects (except the "wrong" JDK) that you want to keep are in your workspace. Add them from the repository if you want. (Just don't add whatever JDK they list -- It'll be either Sun Class Libraries PM (for OS/2) or Sun Class Libraries Win32 (for Windows))
- Make sure any projects you don't want are deleted from the workspace.
- Export all the JDK, BDK and IBM samples to some samples.dat file using Interchange format. This is just to keep them around if you want to use them someday. I kept all mine in the \IBMVJava\ide\repository dir. After this export is complete, delete these projects from your workspace.
- Export all the things you want to keep to a core.dat interchange file. Again, I stuck mine in the repository dir
- Make sure that the only things in your workspace are the things you exported to the core.dat file. And do not edit or even touch any files in the workspace until the repository switch is over. Otherwise you run the risk of getting consistency problems between the workspace and repository, which sometimes causes a few things to act funky.
- Exit VisualAge for Java
- Go into the \IBMVJava\ide\repository dir
- Rename ivj.dat ivj.dat.old to play it safe...
- Rename core.dat to ivj.dat
And you're done! Go into VisualAge and you'll only see the stuff that was in core.dat!
Further Deletions for version 1.x
Now that you have a clean repository and workspace, save a coy of each.
- Copy \IBMVJava\ide\repository\ivj.dat to base.dat.
- Copy \IBMVJava\ide\program\ide.icx to base.icx.
Further cleanups can follow this simpler procedure:
- Rename your repository (\IBMVJava\ide\repository\ivj.dat) file to all.dat.
- Copy your saved base.dat file to \IBMVJava\ide\repository\ivj.dat.
- Copy your saved base.icx file to \IBMVJava\ide\program\ide.icx. This will replace your workspace with the saved workspace (which corresponds to the saved repository.)
- Start VisualAge for Java.
- Import the code you want to keep from all.dat. Remember that repository files are interchange files, so you can do this by selecting "Interchange File" as the import format. You can select any projects or packages to import from the all.dat file, as well as which versions of those projects and packages to keep.
- Add the projects and packages to your workspace from the repository.
This procedure allows you to easily save multiple versions of code in your repository while removing those that you dont want to keep.
I know it's a bit of a pain to do this, but right now it's the only way to get garbage out of the repository.