Skip to Content
1
Former Member
Jul 03, 2007 at 10:48 AM

URLGeneratorService - Hostname not resolved

7 Views

We are developing a Portal Page that contains file attachments. These attachments are stored on the KM directory and will be displayed as hyperlinks on the portal page. I am using the following code to get the URL of the files in order to display them as hyper links.

IURLGeneratorService ug = (IURLGeneratorService)ResourceFactory.getInstance().getServiceFactory().getService("URLGeneratorService");

UriReference uriRef = ug.getResourcePageUri(PathKey.CONTENT_ACCESS_PATH, res.getRID(), null);

IHierarchicalUri uri = ug.createAbsoluteUri(uriRef);

String uriString = uri.toExternalForm();

After execution, uriString contains the value

"http://<%hostname%>/irj/go/km/docs/documents/MM-Workflow/(J2EE6711000)ID1626578250DB01128272384091381158End/Book1.xls"

The value of the hostname is not resolved and so the link doesnt work. But if I hardcode the url in the program then the link works.

Please help on how to resolve the <%hostname%>.

Regds

Thiru