• Which event called When we upload a new doc ?

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #46385  by mamad
 
hi guys,
From development point of view :
I want to open a form (like a dialog with input fields) to get some extra informations about the doc from user, when document is uploaded.
so my question has two part:
1- What event called when a new documents is uploaded and how handle that ?
2- how make a new form (with GWT) and show it to get some extra information from user ?
I know my question is very total but i will appreciate if you give me at least some useful link to learn about it
 #46387  by lnovoa
 
Hi!,
here are links to your questions.
With automation, you can develop your scripts and there is also a list of actions implemented.
scripts
https://docs.openkm.com/kcenter/view/ok ... ation.html
list automations
https://docs.openkm.com/kcenter/view/ok ... ation.html

For frontend development, this can help you.
https://docs.openkm.com/kcenter/view/ok ... pment.html

There is a development of the environment for Openkm. It is ready to develop.
This is the link:
https://www.openkm.com/en/download.html
 #46406  by mamad
 
ok, thank you, i will explain my full requiremens now:
i want to open a form(like a jframe in swing, actually a UI Panel with some textboxes and a button) every time user upload a document in openKM. This form should get some string data from the text boxes in that form and store this information in openKM database by clicking a confirm button inside form.this info will holds for future use.
so to be more clear my requirements include :
1- Set a Handler to handle uploading document's event
2- when the event called,i mean after user uploaded the document,open a form
3- get information from user by some text boxes inside the form
4- Connect to openKm database(preferably with JDBC)
5- Store these data in the corresponding table
6- Retrieve that data from database by executing the proper query every time i need
Is it clear enough now ? :wink:
Thanks in advance
 #46417  by mamad
 
yes , great
i want a new window opens after uploading docs( like what happend in the video )but i want to design this window by myself (i want it have a couple of labels and text boxes and also a button for confirm) so after pressing the button i want to save data of textboxes in database
my requirements are very simple and i can design this form and handle the inputs with html or swing in less than one minutes but i dont know how do it in openkm and It 's really driving me crazy :cry: :shock: :(
 #46420  by jllort
 
You should use an action named "AddPropertyGroupToWizard" and there indicate what is the chosen property group ( this action might be linked with document creation event ). The property group is stored in OpenKM database.

If you also want to save in your own database then should intercept the "Set metadata group" event and from there get the metadata values - for it should create your own action an capture data - and do what you wish ( take a look at line 503 of DbPropertyGroupModule.java for better understanding about how are passed the metadata values into the automation action class ). Data is stored into OKM_NODE_PROPERTY table.

This is the way what comes by default with OpenKM, the easiest if you are interested in how it works the wizard should debug FancyFileUpload.java class in combination with WizardPop.java ( what is called into FancyFileUpload class ).
 #46440  by mamad
 
Hi jllort , thank you again for your time
I readed the documentation and now i know how make my own action and run it when documen uploaded
The database part is ok too .
But i still have problem with the UI part of my question .
I don't know how simply create a new UI panel and show it with my desired design ( include some text box , check box , label and button ) and give data from the textboxes .
would you please give me just a simple example about how create a simple UI panel and get data from that ? ( FancyFileUpload.java is about 1000 lines of codes and i don't have enough time to read all of that :cry: )

for example , this is my action that will be run when document is created :
Code: Select all
public class MyAction implements Action {
    
    @Override
    public void executePre(HashMap<String, Object> env, Object... params) {
    }
    
    @Override
    public void executePost(HashMap<String, Object> env, Object... params) {
        
        // => open a ui panel with three textboxes and a button
        // => when user pressed button store textboxes values in Variables TB1,TB2,TB3
    }
}
would you please help me fill the commented part inside executePost method ???
every help will be appreciate .
 #46451  by jllort
 
Create a metadata group, configure automation with AddPropertyGroupToWizard and then check what happens.

1- In the current development version this steps https://docs.openkm.com/kcenter/view/ok ... tions.html is not necessary for enabling automation.
2- Register metadata definition what shown below:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.3//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.3.dtd">
<property-groups>
  <property-group label="Consulting" name="okg:consulting">
    <input label="Input label" name="okp:consulting.input1" />
    <separator label="Separator label" name="okp:consulting.separator" /> 
    <input label="Input label" name="okp:consulting.input2" />
  </property-group>
</property-groups>
3- In the automation action set AddPropertyGroupToWizard with group okg:consulting

From automation you fire metadata to be shown, the fields you are looking for.
When you success on it, link the automation with your action and debug the values into HashMap -> you will see everything no need there ( node uuid, etc... ) from there with API call you can retrieve metadata etc... https://docs.openkm.com/kcenter/view/ok ... group.html

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.