Page 1 of 2

Integrating with other Java Applications

PostPosted:Thu Jul 16, 2009 7:50 am
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

Re:Integrating with other Java Applications

PostPosted:Thu Jul 16, 2009 9:33 am
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 ).

Re:Integrating with other Java Applications

PostPosted:Thu Jul 16, 2009 11:35 am
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

Re:Integrating with other Java Applications

PostPosted:Fri Jul 17, 2009 9:55 am
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]

Re:Integrating with other Java Applications

PostPosted:Fri Jul 17, 2009 10:00 am
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

Re:Integrating with other Java Applications

PostPosted:Tue Jul 28, 2009 12:40 pm
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

Re:Integrating with other Java Applications

PostPosted:Tue Aug 04, 2009 9:10 am
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.

Re: Integrating with other Java Applications

PostPosted:Tue Feb 28, 2023 10:37 am
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...

Re: Integrating with other Java Applications

PostPosted:Tue Feb 28, 2023 10:52 am
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

Re: Integrating with other Java Applications

PostPosted:Mon Mar 06, 2023 9:40 am
by jllort

Re: Integrating with other Java Applications

PostPosted:Fri Mar 10, 2023 5:09 am
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

Re: Integrating with other Java Applications

PostPosted:Mon Mar 27, 2023 2:03 pm
by jllort
Here have all the API rest classes https://github.com/openkm/document-mana ... penkm/rest if you wish to connect directly without our Java SDK that will help you

Re: Integrating with other Java Applications

PostPosted:Thu Mar 30, 2023 5:24 am
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?

Re: Integrating with other Java Applications

PostPosted:Mon Apr 03, 2023 8:47 am
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.

Re: Integrating with other Java Applications

PostPosted:Tue May 16, 2023 4:52 am
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