Page 1 of 1
Configuring CallBack.
PostPosted:Thu Jan 19, 2017 3:01 am
by PSHREYASHOLLA
Hi,
How to configure a call back, that should get invoked with document details, whenever Documents are uploaded/Deleted from OpenKM UI.
Need help
Re: Configuring CallBack.
PostPosted:Fri Jan 20, 2017 7:18 pm
by jllort
After document had been uploaded you want to execute something from UI, is that ? Take a look at class named FancyFileUpload.java and look for this method into the class:
Code: Select allprivate FileUploadForm addSubmitCompleteHandler(final FileUploadForm uploadForm) {
Re: Configuring CallBack.
PostPosted:Mon Jan 23, 2017 5:17 am
by PSHREYASHOLLA
jllort wrote:After document had been uploaded you want to execute something from UI, is that ? Take a look at class named FancyFileUpload.java and look for this method into the class:
Code: Select allprivate FileUploadForm addSubmitCompleteHandler(final FileUploadForm uploadForm) {
Hi,
Thanks for the reply.
My question was, whenever a user uploads a document from OpenKM UI(http://IP**:PORT**/OpenKM/frontend/index.jsp), I want to store the document details (Like UUID, Document Path etc..).
So where can I configure my Handler class, so that it gets called, everytime a document is uploaded?
I am using "sdk4j-1.1.jar"
Re: Configuring CallBack.
PostPosted:Wed Jan 25, 2017 7:54 am
by jllort
First of all, take in consideration with SDK what is a API wrapper. The API only accepts incoming calls it doesn't make outgoing calls, the API are thought to accept only outgoing calls.
Better if you have started explained the problem you trying to solve, rather the idea you got in mind. Seems - correct me if I'm wrong - you want to get the information of documents have been changed in openkm ( creation or update ) to store outside for some use. Is it ? confirm this point.
Re: Configuring CallBack.
PostPosted:Wed Jan 25, 2017 8:48 am
by PSHREYASHOLLA
jllort wrote:First of all, take in consideration with SDK what is a API wrapper. The API only accepts incoming calls it doesn't make outgoing calls, the API are thought to accept only outgoing calls.
Better if you have started explained the problem you trying to solve, rather the idea you got in mind. Seems - correct me if I'm wrong - you want to get the information of documents have been changed in openkm ( creation or update ) to store outside for some use. Is it ? confirm this point.
Seems - correct me if I'm wrong - you want to get the information of documents have been changed in openkm ( creation or update ) to store outside for some use. Is it ? confirm this point
Answer to your question : Yes, requirement is to store the document details in our Database.
Let me explain my requirement,
From my Web Applications web page, we will be opening the openKM web page for the user. If the user Uploads/Deletes a document in the OpenKM, I want the document details returned back to my application, where I want to store these informations.
How Can I achieve this?
Re: Configuring CallBack.
PostPosted:Thu Jan 26, 2017 6:13 pm
by jllort
OK, then you do not need a callback, really you need follow the logic:
1- When user create document from your website, you are using the ws methods createSimple() what returns an Document Object.
2- With Document object ( getUuid() ->unique object id ) you can retrieve any kind of information ( metadata, document info etc... ) You can show this information to the end user, or connect with your application and store there.
Re: Configuring CallBack.
PostPosted:Fri Jan 27, 2017 12:54 pm
by PSHREYASHOLLA
jllort wrote:OK, then you do not need a callback, really you need follow the logic:
1- When user create document from your website, you are using the ws methods createSimple() what returns an Document Object.
2- With Document object ( getUuid() ->unique object id ) you can retrieve any kind of information ( metadata, document info etc... ) You can show this information to the end user, or connect with your application and store there.
createSimple() will do if a WebService call is made from our application.
My question is, "Everytime a document is uploaded from OpenKM UI", how will I get uploaded documents information in our application?
Re: Configuring CallBack.
PostPosted:Sat Jan 28, 2017 5:31 pm
by jllort
With automation events (
https://wiki.openkm.com/index.php/Automation ). Each time a document is created or updated you can do something linking "create document" or "update document" events to some java code.
Take a look here for enabling automation:
https://wiki.openkm.com/index.php/Enable_automation
You should create your own action, take addKeyword as an example:
https://sourceforge.net/p/openkm/code/H ... yword.java
The idea is do something ( add record into database in the middle, call some API method in your application etc... ) to transmit that a new document has been created / updated ( are several ways for doing it, all it depends on how can you communicate to this application )
Re: Configuring CallBack.
PostPosted:Tue Jan 31, 2017 12:53 pm
by PSHREYASHOLLA
Tried implementing as suggested, this was what we wanted. Thanks for the help
