Skip to Content
avatar image
Former Member

Target URL of resource in KM API

Hi,

I am working on KM API in EP 7.3, and i want to get the target URL of the resource fetched. I tried to use the resource.getTargetURL(), but it returns null.

Please suggest the solution.

Message was edited by: Ankur Goyal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 02, 2015 at 06:44 AM

    Hi Ankur,

    Go through the below link, hope it helps.

    Regards,

    Prithviraj.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I have got my answer through below code:

      IURLGeneratorService ug =(IURLGeneratorService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.URLGENERATOR_SERVICE);

      IHierarchicalUri uri = ug.getAbsoluteUri(PathKey.CONTENT_ACCESS_PATH);

                          IHierarchicalUri uriRef = uri.appendPath(resource.getRID().toExternalForm());

                          uriString = uriRef.toExternalForm();