Welcome
Wednesday, June 08, 2005
+Document Workspace: Multiple Documents
The problem:
So you have a project that needs to update/modyfy multiple documents. On top of that, they are in various libraries. Do you really want to create a workspace for each one? Definitely not. Need to configure security, possibly event handlers fot the libraries, etc. Unless you have an application to automate this, it's a pain. regardless, it's a pain cause you need multiple workspaces.
Here's a trick: (Note, this is just the idea. I will leave the details of coding to you...)
You need to create a small application - maybe a webpart) to build a list of available files in a given site.
a) The app should be called from the target library. For example, using a new button in the library toolbar that can pass the target url to the application.
b) The App should allow selection from multiple libraries and be able to navigate subfolders to allow the user access to all the files in the current site.
c) for each selected file, you will need to store the full url.
d) Once all files are selected and the user clicks 'ok', the files are copied to the desired Workspace library. At the time of copying the files, you must set the _SourceUrl field to match the origin url. like so:
item.Item("Source Url") = "http://server/sites/site/library/folder/filename.ext"
where item is an SPListItem object, meaning a file in a document library in this case.
if you use an SPFile object, just substitute
file.Item.Item("Source Url") = "http://server/sites/site/library/folder/filename.ext"
So now you have a bunch of files from different sources in one central workspace for editing, and they are all connected to their respective parent objects.
NB: don't forget to check-out the source files when you do this...