on 09-24-2007 8:04 AM
Hi,
I have been trained in Netweaver XI and now my project needs to develop applications in webdynpro.I have some idea related webdynpro, Now i need to upload and download documents in to KM through webdynpro. Could any one of you please help me out how to upload and download documents to KM through webdynpro.
Thank you
Regards
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Pl go through this blog
/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis
REgards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
check the following code to upload files in km.
String actualFileName=null;
try
{
/*Get an object of current Portal user */
IWDClientUser clientUser=WDClientUser.getCurrentUser();
IUser sapUser=clientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User=WPUMFactory.getUserFactory().getEP5User(sapUser);
ResourceContext context=new ResourceContext(ep5User);
/*Give the path to KM in the variable path */
String path="/documents/Public Documents";
RID rid=RID.getRID(path);
IResourceFactory factory=ResourceFactory.getInstance();
ICollection folder=(ICollection)factory.getResource(rid,context);
/*Using the upload element we can upload the files to a location in the server drive
/*temporary location for writing */
IWDResource res=wdContext.currentContextElement().getFResource();
InputStream ist=res.read(true);
byte b[]=new byte[ist.available()];
ist.read(b);
ist.close();
actualFileName=res.getResourceName();
File f=new File("
"+actualFileName);
FileOutputStream fos=new FileOutputStream(f);
fos.write(b);
fos.close();
/From the temporary location read the file using an input stream/
FileInputStream is = new FileInputStream(f);
/*Using this input stream we can write to the repository
String fileName=res.getResourceName();
Content con = new Content(is, wdContext.currentContextElement().getFResource().getResourceType().getHtmlMime(), -1);
IResource newResource = folder.createResource(fileName, null, con);
is.close();
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException("1 "+e,true);
}
finally
{
File f=new File("
"+actualFileName);
f.delete();
}
regards,
krishnaveni
Hi
Check the blog
<a href="/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis
also you can see
/thread/327964 [original link is broken]
Regards
Abhijith YS
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.