• User Interface API

  • 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.
 #18523  by b1nd
 
Hey guys,
I have been integrating my third party application with OpenKM and everything is great.
Essentially, i have a JSP which takes arguments from URL and creates folders with permissions accordingly.
However, i am also required to navigate to this folder if it already exists.
I was wondering how this would be achieved?

Kind Regards
b1nd
 #18531  by jllort
 
build your jsp step by step:
First you need to know is path exists:

You need to use administrator grants in jsp for it you need to get the system token and always operate with it:
JcrSessionManager
http://doxygen.openkm.com/5.1.x/dd/d28/ ... nager.html

OKMRepository ( method hasNode ) to know if path exists or not
http://doxygen.openkm.com/5.1.x/d7/d6c/ ... itory.html
Code: Select all
String token = JcrSessionManager.getInstance().getSystemToken();
OKMRepository.getInstance().hasNode(token, path)
After you complete it we will advande on create folder if not exists.
 #18546  by b1nd
 
Hey,
Thanks for the quick reply.

I had already created the JSP to create a folder:
Code: Select all
String w = request.getParameter("id");
String token = JcrSessionManager.getInstance().getSystemToken();
Folder f = new Folder(); //Create our folder
String path = "/okm:root/" + w; 
f.setPath(path);  //Set our path (always under root for POC)

/* Folder does not exist already. Create a new folder at root */
if (!OKMRepository.getInstance().hasNode(token, path))
{
   OKMFolder okmFolder = OKMFolder.getInstance();
   okmFolder.create(token, f);
}
/* Folder exists, therefore navigate to the path */
else
{
   //navigate to the specific path in DOMWindow
}
As you can see, i require instruction on how to get the OpenKM API to navigate to the path (that already exists).
Workflow would be:

1. User navigates to vettrak.jsp?id=1234
2. JSP creates folder 1234 under root.
3. User navigates to vettrak.jsp?id=1234 (again)
4. JSP redirects the User to the DOM window at path: okm:root/1234

Thanks heaps
:)
 #18555  by jllort
 
For what I understand you create the folder if not exist, that's ok in your code.

but I do not understand the points 3,4
User navigates to vettrak.jsp?id=1234 (again)
JSP redirects the User to the DOM window at path: okm:root/1234 -> what do you have in mind explain with some example ( what use see on screen ? )
 #18586  by b1nd
 
Hey Jllort,
Thanks for the reply!

You're right those points were a bit ambiguous. Essentially, i would to navigate to a specific folder in the OpenKM folder structure, from outside the system.
Similiar to the 'find a folder' feature in OpenKM, but would like to use this navigate functionality from outside of the sytem.

Workflow example:
1. User enters directory path into browser: "?id=xxx"
2. User is redirected to the OpenKM window at the specific folder location okm:root/xxx
 #18599  by jllort
 
Basically you simply should forward to some link like : http://your_openkm_url/OpenKM/frontend/index.jsp?fldPath=/okm:root/etc
Should be good idea encode url ( /okm:root/etc )
Aditionally docPath=/okm:root/etc... if you want to link with a document or mail

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.