cancel
Showing results for 
Search instead for 
Did you mean: 

Accesing Knowledge management data

Former Member
0 Kudos

Hi all,

I hope some one already worked on this.

Using content management we created Folder and some text files inside the folder.

Now we would like to access those Text files from web dynpro inshort showing knowledge management data using web dynpro UI.

I would like to know how i can access text files.

If any body has some source code already written , pls share with me.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If you are referring to accessing the documents uploaded in KM repository the code is as follows

create an user object from the current user

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser =

wdClientUser.getSAPUser();

// create an ep5 user from the retrieved user

IUser ep5User =

WPUMFactory.getUserFactory().getEP5User(sapUser);

// establish resource context using the ep5 user

IResourceContext resourceContext = new

ResourceContext(ep5User);

// get a resource factory

IResourceFactory resourceFactory =

ResourceFactory.getInstance();

// get a RID from the current path to display the according content

RID pathRID =

RID.getRID(wdContext.currentContextElement().getPath());

// get a Iresource object to work on

IResource resource = resourceFactory.getResource(pathRID,

resourceContext);

// cast the object to a Collection

ICollection collection = (ICollection) resource;

// get the Collection's children

IResourceList resourceList = collection.getChildren();

// and finally get an iterator to walk through the set of children

IResourceListIterator resourceListIterator =

resourceList.listIterator();

After this make an object of IResource for every element of resourceListIterator and access the files.For eg for accessing the names make an array and loop the iterator

String subarray[] = new String[20];

while (resourceListIterator.hasNext())

{

IResource tempResource = resourceListIterator.next();

subarray<b>= tempResource.getName();

}

Former Member
0 Kudos

Hi Srinivas

find below the document link where you can find information about accessing KM from webdynpro.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/us... knowledge management functionality in web dynpro applications.pdf

Kishore

Former Member
0 Kudos

hi nagakishore,

I already tried this option which displays the directory structure , what i want is how we can access the files (content inside the file)inside the directories. For my requirement i dont want to show any directories.

Thanks in advance.

Former Member
0 Kudos

Using JAVA PDK , we can access KM apis to display content inside the files. I would like to know how we can do that using web dynpro.

Thanks in advance.