Skip to Content
author's profile photo Former Member
Former Member

How to get Content Link in Access Links tab for Web Content

Hi,

I'm writing custom resource renderer to render resources in some folder. I'm using it in my web pages built with Web Page Composer.

In my code I have resource and it's RID, I need to get the url for that resource, the one that is visible if you are in KM Web Content in the Details->Settings->Properties->Access Links tab, Content Link, that looks like below:

Content Link: /irj/servlet/prt/portal/prtroot/docs/guid/00281348-f2d7-2a10-cc9b-f65cd88eca58

Any way I can get that?

Thanks in advance

Ruslan

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Mar 29, 2008 at 10:18 AM

    There is a URLGeneratorService that will help you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 29, 2008 at 04:21 PM

    Hi,

    Thanks for the hint, could you please be more specific and give me the exact method (or perhaps code snippet) that would return url in this form , as I couldn't find that in IURLGeneratorService api.

    .../guid/00281348-f2d7-2a10-cc9b-f65cd88eca58

    Thanks again

    Ruslan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 03:02 AM

    Hi,

    I thought I'd share my research results for other ones like myself looking for answers.

    IMetaName metaName= null;
    IPropertyConfigurationService pcs = (IPropertyConfigurationService)ResourceFactory.getInstance().
    	  getServiceFactory().getService("PropertyConfigurationService");
    
    metaName = pcs.getMetaModel().searchById("rnd:contentlink");
    		
    if(metaName !=  null)
    {
    	  PropertyName CONTENTLINK_PROPERTYNAME = new 	  PropertyName(metaName.getNamespace(),metaName.getName());
    
    	  if (resource.getProperty(CONTENTLINK_PROPERTYNAME) != null)
    	contentlink = resource.getProperty(CONTENTLINK_PROPERTYNAME).getStringValue();
    
    } 
    

    I'm using NW 2004S SP14 and new PropertyName()... is deprecated but it works. With little effort you could probably find the correct replacement.

    This 'contentlink' property returns exactly what is displayed in 'Content Link' field in properties tab.

    Thanks

    Ruslan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.