• Integrating with other Java Applications

  • 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.
 #2926  by samtiku
 
Hi,

Actually we are analysing some tools which can be used as Document Managament System and we need to integrate the DMS with our Java Application which will be like an Expert Systems from where user can directly upload/download any file. The uploaded/download file will be managed by DMS. Could you please let me know how is it possible by using Open KM. Actually I am analysing DMS tools for the first time.

Regards,
Sameer
 #2927  by jllort
 
Yes you can.

OpenKM comes by default with API exposed with webservices. Via webservices you can integrate OpenKM with other Apps ( java or others there\'s no problem on it ).
 #2930  by samtiku
 
Hi jllort,

Thanks for the response.
I have seen that section which tells than we can use the Web Services exposed by OpenKM for interacting with the Java Applications.

But exactly I am not able to figure out how to make use of the Web Services code
OR
how should I upload/download a document directly from my Java Application(jsp file).
If you have any sample code for this which I can refer, that will be of great help.

Regards,
Sameer
 #2931  by jllort
 
You can do all operations, including uplading documents and downloading using webservices.

I\'ll attache some php and perl demo files with webservices.

Josep [file name=ws.zip size=4473]http://www.openkm.com/images/fbfiles/files/ws.zip[/file]
 #2933  by samtiku
 
Hi jllort,

Thank you for some demo files.
Atleast it will give me some idea regarding my approach.
We are going to start integrating with OpenKM our Java Application from monday onwards.

Will let you know once We are done.

Regards,
Sameer
 #2965  by samtiku
 
Hi jllort,

Do you have any sample file in java jsp. I am not quite aware of php files. If you have some files in Java and JSP, that will be great for me...

Regards,
Sameer
 #2979  by jllort
 
Sorry but I\'ve not any example in java files. Really is the same than php, perl or mysql.

Simply create some WS instance and make the calls in order that you see in php example files.
 #54083  by swati
 
Hi,

Actually we are analysing some tools which can be used as Document Managament System and we need to integrate the DMS with our Java Application with spring boot which will be like an Expert Systems from where user can directly upload/download any file. The uploaded/download file will be managed by DMS. Could you please let me know how is it possible by using OpenKM. Actually I am analysing DMS tools for the first time.

I have seen that section which tells than we can use the Web Services exposed by OpenKM for interacting with the Java Applications.

Do you have any sample file in java jsp. I am not quite aware of php files. If you have some files in Java and JSP, that will be great for me...
 #54084  by swati
 
Code: Select all
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;

public class OpenKMClient {
    public static void createFolder(String path, String folderName) throws Exception {
     	String url="http://localhost:8080/openkm/folder/create";
    	String auth="admin:admin";       
    	String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes());

        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();

        // Set HTTP request headers
        con.setRequestMethod("POST");
        con.setRequestProperty("Authorization", "Basic " + encodedAuth);
        con.setRequestProperty("Content-Type", "application/json");

        // Set HTTP request body
        String jsonBody = "{\"path\":\"" + path + "\",\"name\":\"" + folderName + "\",\"properties\":{}}";
        con.setDoOutput(true);
        OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream());
        out.write(jsonBody);
        out.flush();
        out.close();

        // Get HTTP response
        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine
        }
        in.close();
        
        // Print HTTP response
        System.out.println(response.toString());
    }
}
this is my code how to integrate with openkm with rest api can you please help me
Last edited by swati on Mon Jun 05, 2023 12:12 pm, edited 1 time in total.
 #54113  by swati
 
Thank you jillort.
but i have some query
We are going to start integrating with OpenKM our Java Application can you give me java code or rest api that integrate with openkm .it is very helpfull for us

Thank you
 #54142  by arshi
 
What are the key features and benefits of OpenKM that make it a suitable choice for integrating as a Document Management System with a Java Application for uploading and downloading files?
 #54147  by jllort
 
The same as a CRM to manage invoices. The DMS is a specialized application to manage files, history of versions, security etc... integrating with a DMS you inherit these features directly without implementing in your application.
 #54197  by swati
 
Hello jillort,
now i successfully integrate openkm in our java application but i have some query
1)when we create folder on openkm it is created (it is hardcoded ) but now i want to create folder dynamically.
ex if employee upload his documents in openkm then the folder is created with empid and in that if employee upload his profile,qualification ,marksheets then seperate folder is created and document is saved in that specific folder.
how to do that can you help me.
Thank you
Swati

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.