P.S.: There's now a feature in SharePoint 2010 to address this: See http://blogs.technet.com/blairb/archive/2009/10/20/new-document-id-feature-in-sharepoint-2010.aspx
I'm currently working on a Microsoft Office SharePoint Server 2007 implementation at a large customer that uses LiveLink. They need a feature not currently available out-of-the-box in SharePoint, so these are some ideas on how we're planning to do it. Most of the concepts were already tested in a proof-of-concept environment, although we're still working towards the final implementation.
- Users need a URL for documents stored in SharePoint that continues to work even after the document is renamed or moved to another Document Library, Site or Site Collection. The document URL would need to look like http://sharepointurl/sharepointpage?docid=number instead of http://sharepointurl/site/documentlibrary/documentname.ext
- Documents are being migrated from LiveLink to SharePoint. The old LiveLink document URLs, which look like http://livelinkurl/livelinkpage?objid=number, need to continue to work after the migration.
- Document uploaded directly to SharePoint: End User uploads a document into SharePoint. SharePoint will automatically create a “Unique ID” for each document uploaded (this is implemented by using an event on the server). A “Unique URL” is automatically created based on the document “Unique ID”. Users are educated to use the “Unique URL” to refer to documents, instead of the regular URL that includes just the site collection name, document library name and document name.
- Document renamed or moved using SharePoint’s out-of-the-box “Send To” option: When we renamed the document or move the document using the “Send To” option in a SharePoint Document Library, the “Unique ID” for the document is properly preserved and the “Unique URL” for the document remains the same. This works for sending to the same site collection OR to another site collection.
- Document moved without SharePoint’s out-of-the-box “Send To” option: Documents moved manually (by using Explorer View or by copying to the local file and then re-uploading to another location) do not preserve their “Unique ID”. A new “Unique ID will be created upon document upload. User would have to be educated to fill in the previous “Unique ID” manually after the document upload to preserve that previous Unique ID and Unique URL.
- LiveLink Automated Migration: Migration code (develop by customer) copies documents from LiveLink to SharePoint. Code fills in a required “Unique ID” column for each document with the original LiveLink document ID, prefixed by “Livelink-“ to denote a migrated document. This value gets indexed and a specially crafted “Unique URL” can find the document using SharePoint’s search tools. Customer develops a special web application to be deployed at http://livelinkurl/livelinkpage to redirect the old LiveLink document URLs to the new SharePoint “Unique URL”.
- LiveLink Manual Migration: End User manually moves documents from LiveLink to SharePoint. Users would have to be educated to fill in the “Unique ID” manually after the upload so that the old LiveLink document URL is properly redirected.
- Document Library with Unique ID
- Create a special type of Document Library called “Document Library with Unique ID” that includes two additional columns
- “Unique ID” is a column of type “Single Line of Text” that will contain the a unique identifier for the document
- “Unique URL” is a calculated column that will provide the correct URL to use SharePoint search to find the document based on the “Unique ID”)
- Implement and deploy an event handler to automatically populate the “Unique ID” with a system-generated GUID after any “itemAdd” event.
- Search for Unique ID
- On the Document Library, Set the “Unique ID” column to be indexed
- Create a new scope that shows only documents (otherwise the search results will include two results for each Unique ID: document library and document itself)
- Create a new Search Results page to be used in the “Unique URL” queries which includes only the defined scope, possibly looking like http://sharepointurl/uniqueurl.aspx?k=id
- Package as a Feature
- Create a new “Document Library with Unique ID” definition as a feature
- Deploy this feature to the farm
- Disable the default Document Library
- Change the Customer site definitions to use this new “Document Library with Unique Id” instead of out-of-the-box Document Library.
- LiveLink migration
- In the LiveLink Automated Migration code, be sure to use the “Document Library with Unique ID” for all document libraries
- Include in the LiveLink Automated Migration code a step to update the “Unique ID” after uploading each document, populating that field with “LiveLink-“ plus LiveLink’s Object ID for the document
- This will should happen after the “itemAdd” event fired and will replace the event handler-generated “Unique ID”.
- Implement a web application that takes the LiveLink URL (http://livelinkurl/livelinkpage?func=ll&objId=11154969&objAction=Open), parses it to obtain the objId property and forward that to the custom Search Result’s page with the “LiveLink-“ prefix.
- Reconfigure DNS to point http://livelinkurl/livelinkpage to the server hosting this web application.
- The out-of-the-box “Send To” feature will automatically carry over the “Unique ID” property, assuming that column exists under the same name on both source and destination Document Libraries.
- We need to create a content type definition for the “Document Library with Unique ID”, packaging it as a feature to be deployed at the farm level. This should include the Event Handler for assigning a “Unique ID” to uploaded documents.
- The “Unique URL” for a document will take the user to a search results page at http://sharepointurl/uniqueurl.aspx?k=id, not to the document itself. This will likely provide a single search result, which would point to the current location of the document.