on 06-04-2011 5:40 AM
Hi.
I stored some documets(multiple documents) in KM those documents i have to display(multiple documents) inside table.
Regards,
mahesh
here you go
Navigate through Knowledge Management repositories and folders from a WebDynpro Application using KM API - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f02b492c-7d76-2a10-86aa-e11e8388f...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Iam using below code iam able to access only one document at a time.I want multile documents in table.
public void wdDoInit()
{
//@@begin wdDoInit()
wdThis.wdGetComp_Form_16Controller().executeZess_Form16_File_Details_Input();
wdThis.wdGetComp_Form_16Controller().executepersonalrfc();
wdContext.currentContextElement().setCa_pernr(wdContext.currentOutput12Element().getPernr());
wdContext.currentContextElement().setCa_name(wdContext.currentOutput12Element().getEmpname());
wdContext.nodeCa_node().invalidate();
try {
// Getting the useru2026u2026
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
// Getting the Resourceu2026u2026u2026
IResourceContext resourseContext = new ResourceContext(ep5User);
IResourceFactory resourseFactory = com.sapportals.wcm.repository.ResourceFactory.getInstance();
// execute RFC...
int size = wdContext.nodeIt_Files1().size();
//String a = size+"";
for(int i=0; i<wdContext.nodeIt_Files1().size(); i++)
{
IPrivateForm_16View.IIt_Files1Node node = wdContext.nodeIt_Files1();
IPrivateForm_16View.ICa_nodeElement ele = wdContext.createCa_nodeElement();
String file_path = wdContext.nodeIt_Files1().getIt_Files1ElementAt(i).getZfile_Name();
//String file_path = "knagakrishna";
//Get a RID for the file
RID file = RID.getRID("/documents/FORM16/" + file_path );
// RID file = RID.getRID("/documents/FORM16/");
//get the file itself from KM
IResource resource = resourseFactory.getResource(file, resourseContext);
//collections can not be opened, therefore we have to ignore them
if(!resource.isCollection())
{ byte[] bcontent = this.getByteArrayFromResource(resource);
//get resource type
WDWebResourceType resourceType = WDWebResourceType.getWebResourceTypeForFileExtension(resource.getRID().extension());
IWDResource iwdResource = null;
//resource type is known
if (resourceType != null)
{ iwdResource = WDResourceFactory.createResource(bcontent, resource.getName(), resourceType );
}
// resource type is not known
else
{ iwdResource = WDResourceFactory.createResource(bcontent, resource.getName(), WDWebResourceType.PDF);
}
// save resource in context
// wdContext.currentContextElement().setFileResource(iwdResource);
//
// wdContext.currentContextElement().setCa_path1(iwdResource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal())) ;
ele.setCa_path(iwdResource.toString());
ele.setCa_company(wdContext.nodeIt_Files1().getIt_Files1ElementAt(i).getButxt());
//ele.setCa_year(wdContext.nodeIt_Files1().getIt_Files1ElementAt(i).getZyear());
ele.setCa_year(wdContext.nodeIt_Files1().getIt_Files1ElementAt(i).getZyear());
ele.setCa_pernr(wdContext.nodeIt_Files1().getIt_Files1ElementAt(i).getPernr());
if( ""== ele.getCa_path())
{
// wdContext.currentContextElement().setCa_error("Letter Does not Exist!!") ;
ele.setCa_link( false);
}
else{
ele.setCa_link( true);
}
}
wdContext.nodeCa_node().addElement(i,ele);
//wdContext.nodeCa_node().add(ele);
// ele.node().invalidate();
}
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportWarning("No Form16 exist, please contact ASK-HR at .");
}
Edited by: Mahesh Shirke on Jun 8, 2011 10:24 AM
Edited by: Mahesh Shirke on Jun 8, 2011 10:24 AM
Hi,
You can use KM APIs to get document list. Please refer to this link: /thread/985916 [original link is broken]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.