* {@link org.nuxeo.ecm.webengine.model.WebContext}.
*/
public String computeDocumentURL(DocumentModel doc) {
DocumentLocation docLoc = new DocumentLocationImpl(
doc.getRepositoryName(), new IdRef(doc.getId()));
DocumentView docView = new DocumentViewImpl(docLoc, doc.getAdapter(
TypeInfo.class).getDefaultView());
DocumentViewCodecManager documentViewCodecManager = Framework.getLocalService(DocumentViewCodecManager.class);
String documentLinkBuilder = (String) ctx.getProperty("documentLinkBuilder");
String codecName = isBlank(documentLinkBuilder) ? documentViewCodecManager.getDefaultCodecName()
: documentLinkBuilder;