Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Creating a Link in KM Problem

Hi,

I am trying to create a simple object link from within a Web Dynpro app but am having a small problem.

To get it back to basics I have now created a simple project with this code:

try

// Retreive User

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

IUser epUser = WPUMFactory.getUserFactory().getEP5User(sapUser);

// Create Resource Context

IResourceContext resourceContext = new ResourceContext(epUser);

// Retrieve the folder in which we are going to work

RID rid = RID.getRID("/documents");

ICollection parent = (ICollection) ResourceFactory.getInstance().getResource(rid, resourceContext);

//Creates a resource in the folder

IResource resource = parent.createResource("file", null, null);

//Create a link to the new resource we just created

ILink link = parent.createLink("link", "/documents/file", LinkType.INTERNAL, null);

}

catch (Exception ex)

{

}

But this will not complile, I get the error message;

The method createLink(String, URL, LinkType, IPropertyMap) in the type ICollection is not applicable for the arguments (String, String, LinkType, null)

Which is odd, I've read all the help files and other forum entries and this looks like it should work

Can anyone help me ?

Kind regards

Richard

Former Member
Not what you were looking for? View more on this topic or Ask a question