• Issue while deleting a document

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #15464  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.
 #15481  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.