on 02-01-2013 11:42 AM
Hi All,
Here i am facing an issue i am having a form with Km Document uploading functionality here user will enter all the details and upload the document and clicks on submit button here if file is already there in Km it is giving Exception com.sapportals.wcm.repository.NameAlreadyExistsException here my issue is i am executing Rfc before uploading document in Km so again i uplaod document which is not there in km and clicks on submit it will take but here Rfc is executing two times for that i have to check condition whether the document is there or not before executing rfc can anyone tell me how to check whether the document is there or not in km before executing rfc or is there anyway to overwite existing document.
please help me.........
Regards,
Rahul
HI,
You can achieve through versioning in KM!
Refer the below document
http://scn.sap.com/docs/DOC-2666
Regards,
Manivannan P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manivannan,
Thanks for your reply i have followed your document in catch block i am writing versioning code but at this line of code i am getting same exception com.sapportals.wcm.repository.NameAlreadyExistsException
IResource new_resource = resourseFactory.getResource(pathRID,resourseContext);
Please suggest...
Regards,
Rahul.
Hi,
Please follow the document with stepbystep. it should work.
for versioning find the below sample code.
Note: This document based on NWDS 2.0.14 version
if (resource.isVersioned()) {
// if yes check out it if not done already
if (!resource.isCheckedOut()) {
com.sapportals.wcm.repository.ICheckOutInfo outInfo =
resource.checkOut();
}
Regards,
Manivannan P
Hi,
Initially PathRID should be
RID pathRID = RID.getRID("/documents/SDN/");
If you pass same PathRID in the catch block the exception will occur com.sapportals.wcm.repository.NameAlreadyExistsException
To avoid the above exception use below PathRID
In the catch block (in the time of versioning) Path id should be
RID pathRID = RID.getRID("/documents/SDN/"+Version);
Where Version is name of the file.
Hope you are understood the version concept.
Regards,
Manivannan P
Hi Manivannan,
This is Working!!!!! but one more thing my requirement is also to display old version documents aswell as new versions can you also help me how to display old vesioned documents also because my old documents are disappearing if i create a version and new document is appearing.
Regards,
Rahul.
Hi,
I don't have exact code to retrieve the version files
You can refer the below link for KM API
http://help.sap.com/javadocs/NW04S/SPS09/km/index.html
Regards,
Manivannan P
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.