Page 1 of 1
User Interface API
PostPosted:Mon Sep 24, 2012 7:04 am
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
Re: User Interface API
PostPosted:Tue Sep 25, 2012 6:06 pm
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 allString token = JcrSessionManager.getInstance().getSystemToken();
OKMRepository.getInstance().hasNode(token, path)
After you complete it we will advande on create folder if not exists.
Re: User Interface API
PostPosted:Thu Sep 27, 2012 12:32 am
by b1nd
Hey,
Thanks for the quick reply.
I had already created the JSP to create a folder:
Code: Select allString 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

Re: User Interface API
PostPosted:Thu Sep 27, 2012 6:02 pm
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 ? )
Re: User Interface API
PostPosted:Mon Oct 01, 2012 11:33 pm
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
Re: User Interface API
PostPosted:Wed Oct 03, 2012 9:59 pm
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