Linking to KM Documents
https://myportal.wdf.sap.corp:50003/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/public%20documents/john%20doe/important%20stuff/my%20favorite%20pubs.txt
This looks pretty cool and proves that you are able to get along with even the most advanced IT systems. Your friends will be proud of you. Message sent.
But wait: more people than just your friends might browse through your important documents, see your list and crowd your favorite pubs. So since you share documents with your friends normally through an ACL-protected folder, you move your list into that one and everything is fine. But too bad: you forgot to update your friends with the even more fantastic URL
https://myportal.wdf.sap.corp:50003/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/public%20documents/john%20doe/important%20stuff/just%20for%20my%20friends/my%20favorite%20pubs.txt
…and in the end you might sit alone and have a beer, while your friends are upset about a broken link.
After you read this weblog and have installed at least NW04 SPS12, this does not have to happen again. When you open Details > Settings > Properties > Access Links you will see this:
This so-called Short ID that was introduced with SPS12 is the address of your document in a special Repository Manager called /guid. A virtual entry exists for every document that is stored in any of the existing repositories. And as you might have guessed already, this name stands for the Globally Unique Identifier that each document has internally in KM. And as long as you don’t tear it into pieces and burn it, it will keep it inside of that system, even if you move it around in a folder hierarchy or between repositories or if you rename it. It is basically a stable reference to that document.
So here you go with the almost ever-lasting link to the list of your favorite pubs:
https://myportal.wdf.sap.corp:50003/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/guid/d0510964-df25-2810-22aa-e0290eb4505f
Of course it is not so impressive like the URLs from above. But isn’t small also beautiful? You want it even smaller? Here you go:
https://myportal.wdf.sap.corp:50003/irj/go/km/docs/guid/d0510964-df25-2810-22aa-e0290eb4505f
This is currently the smallest complete link you can use to address your document.
You can also use the GUID-address for creating links inside of KM. They will benefit from the same advantage of being stable.
You don’t have to enter a name. In this case it will be drawn from the target, which is probably exactly what you want. Now the referenced document can wander around without breaking this link! Why isn’t this done by default? I don’t know — it might change in the future. So now roll back your sleeves and link…


From the end users perspective, wouldnt it be better if all these internal ids are abstracted by a hyperlink with text "Link to the document"? whic h could simply be copied to clipboard? This would also obviate the need for remembering all the complex prefixes in the URL like /go/km/docs etc..
Refer to: http://maps.google.com, search for a location, you would see a "Link to this page" link. It is pretty cool, you dont need to care about constructing the URL yourself manually.
public RID getGuidRIDFromRID(RID rid)from the UriMapperService
UriMapperServiceFactory.getInstance()
I based some webDynpro functionality on a stable Guid of a KM-document.
But I came at a situation where the Guid is changed:
I have attached a FS-repository to KM. My WebDynpro looks into that folder via KM-API's. When a document is processed the document is moved to another location within KM (tempResource.move(targetRID, copyParameter)). The Guid is changed during that action.
When I perform the same action from within KM by selecting a document and perform the command 'move' then the Guid is also changed.
Before move-action:
Pad = Inbox_FS
ID = CAF Questions and Problems.doc
Korte ID /guid/30e1415d-9b4f-2810-ab89-cfce2ea390bb
After move-action:
Pad = documents > InBehandeling
ID = CAF Questions and Problems.doc
Korte ID /guid/31411f5d-9f4f-2810-d995-d83f216acd32