cancel
Showing results for 
Search instead for 
Did you mean: 

Link to Documents in KM Repository

Murali_Shanmu
Active Contributor
0 Kudos

Hi,

I was just following the Help Document - '<i><b>Using Knowledge Management Functionality in Web Dynpro Applications</b></i>'. Everything work fine. I am able to navigate the Folder structure in KM. Now I am trying to give one more link in the Table which will launch the document and enable the user to view the contents of the documents. Can anyone help me out on how we can generate a link that will open up the referred KM Docs.

Regards

Murali

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi,

Do the steps as given:

1 Create TableCellEditor of type LinkToAction.

2 onAction of the element create an Action, say ReadObj

3 Then write following code:

wdContext.currentContextElement().setCtx_va_path("/documents/<ur folder name>");

try {

ResourceContext ctx = new ResourceContext(usrEP5);

RID parent = RID.getRID(wdContext.currentContextElement().getCtx_va_path());

RID child = null;

child = RID.getRID( parent.getPath() + "/" + wdContext.currentCtx_vn_ResultElement().getCtx_va_object());

IResource res = ResourceFactory.getInstance().getResource(parent, ctx);

String CompPath = "http://<host>:<port>/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs" + child.getPath();

IWDWindow openwin = wdComponentAPI.getWindowManager).createExternalWindow(CompPath, "Resume", true);

openwin.open();

} catch (ResourceException e) {

// TODO Auto-generated catch block

e.printStackTrace();

wdComponentAPI.getMessageManager().reportException("Resource Exception : " + e.getLocalizedMessage(),true);

}

This will open the documet in new window and you can see the contents of it.

Hope it helps.

Regards:

Abhinav Sharma

Answers (0)