public String getDocumentURL(String repositoryName, String documentId) {
DocumentLocation docLoc = new DocumentLocationImpl(repositoryName,
new IdRef(documentId));
DocumentView docView = new DocumentViewImpl(docLoc,
"view_social_document");
URLPolicyService urlPolicyService = Framework.getLocalService(URLPolicyService.class);
return VirtualHostHelper.getContextPathProperty()
+ "/"
+ urlPolicyService.getUrlFromDocumentView("collaboration",
docView, null);
}