on 10-16-2012 11:03 AM
Hi,
i have functionality to upload document into KM. I am uploading the document successfully, but when I am uploading a document with same name (of the existing document in KM), I am getting the below Error
Error: com.sapportals.wcm.repository.NameAlreadyExistsException
example:
I had uploaded RequestID.jpg from WebDynpro Java to KM
the uploaded document is present in KM
Now I want to update/upload another (new) document with the same name (RequestID.jpg) but I am getting the Error message that "NameAlreadyExistException).
My Requirement is, if I upload a new doucment with the name (already exist in KM folder) then it has to replace the new doucment).
ie. old document should be deleted & new document should be stored with the name..
How to achive it??????
any configuration at KM level or fromcodig level????
Regards,
NS
From Coding Side, you can perform this action.
Whenever a document is uploaded, check in the KM, if there is any document with the same name, if so delete that document by using KM Java API, then on success, call the already existing functionality of uploading document to KM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Resolved...
public void storeCertificateIntoKM( ) {
try{
....................
string document into KM
....................
}
catch (NameAlreadyExistsException e){
wdThis.deleteCertificateFromKM();
// calling the same method within the catch
wdThis.storeCertificateIntoKM();
}
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException("storeCertificateIntoKM" + e);
}
}
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.