• Configuring CallBack.

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #43036  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
 #43051  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 all
private FileUploadForm addSubmitCompleteHandler(final FileUploadForm uploadForm) {
 #43062  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 all
private 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"
 #43076  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.
 #43085  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?
 #43104  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.
 #43108  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?
 #43117  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 )

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.