cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to display content in a KM folder

Former Member
0 Kudos

I need to develop a component which will accept a KM folder name as an input field from UI (for eg : \documents\folder1) and will display all the subfolders and files inside that KM folder along with its details. Need info on how i can implement this and if anyone has already done something similar please help.

Regards

Shabeer

Edited by: Mohammed Shabeer on Mar 18, 2009 5:31 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi

You can achieve this using KM API's.

Assuming your folder location is /documents/xxx. chekc the sample code below.

IUser user = request.getUser(); //You can use cmadmin service as alternate option//

String location = "/documents/xxx";

IResourceContext resourceContext = new ResourceContext(user);

RID rid = RID.getRID(location);

IResource resource = ResourceFactory.getInstance().getResource(rid,resourceContext);

ICollection collection = (ICollection) resource;

IResourceList resourceList = collection.getChildren(); //Gives list of files and folders inside the KM location//

for(int i=0;i<resourceList.size();i++) {

IResource res = resourceList.get(i);

//Get the required info from the resource object and display

}

For further details, check the link below

http://help.sap.com/javadocs/NW04S/current/km/index.html

Regards,

Yoga