on 05-17-2005 2:38 PM
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.
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();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.