Page 1 of 1

Issue while deleting a document

PostPosted:Fri May 04, 2012 10:45 am
by Krishna Shiva
Hello,

We have a web application which communicates with OpenKM 5.1.9 for document management. MySQL, an external DB is configured for OpenKM repository. Webservice clients for OpenKM 5.1.9 are generated using axis 2.0

Also, customized JAAS mechanism is being employed which authenticates access request coming from web application to OpenKM 5.1.9. Hence, these web users don't exist with OpenKM database.

Issue:
"OKMDocumentServiceStub.delete" method has been used to delete a document. When any user logs into the application and tries to delete a document, the user gets the "PathNotFoundExceptoin" with the message "okm:trash/user" not found. (user is the user id which the user logs into OpenKM from web application).
When I debugged the OpenKM code, I found the following:
Code: Select all
Class: com.openkm.module.direct.DirectDocumentModule
Method:public void delete(String token, String docPath) throws AccessDeniedException, RepositoryException,PathNotFoundException, LockException, DatabaseException 

Node documentNode = session.getRootNode().getNode(docPath.substring(1));
Node parentNode = documentNode.getParent();
Node userTrash = session.getRootNode().getNode(Repository.TRASH+"/"+session.getUserID());
From the above code snippet, came to know that the Node - userTrash, expects a folder to be created against userid under trash. eg: okm:trash/user1. As it does not find the "user1" under "okm;trash" it throws PathNotFoundException.

Is my approach for document deletion is correct? Should I make any other calls while logging into OpenKM to ensure the user folder gets created under trash?

Please help me out.

Thanks in advance.

Re: Issue while deleting a document

PostPosted:Sat May 05, 2012 2:50 pm
by jllort
ok:trash/user not exists no ? that is caused because some folder structure is created first time user is logged and if user is never logged you experiment this kind of problems. You should create this folder structure with some administrator user with correct grants ( simply login with one user and take a look which folder structure is created okm:personal and okm:trash.