Hello everybody, I'am new at forum, but in the past I have read a lot of topics very interesting, I Congratulate you and go ahead.
In this moment i have a little problem. I am doing a proyect and i have to copy a folder to OpenKm Repository from a path in my pc for example(C:\\Users\\hello), but I want to copy this folder with all its contents, sub-folders, documents (whathever type), and the contents of its sub-folders etc... I developed a software on Netbeans(Java) and I am trying to consume the webservice OpenKM. I read about topics that could help me to Authenticate (OKMAuth), and copy a document from a path (OKMDocument), but its looks like you dont have any example of how I can create a Folder or in this case copy a folder from a path (OKMFolder) or may be I haven't found it.
I have this example: to copy a Document from my path to OpenKM Repository. It works pretty good.
These are my question:
1. Can you provide me an example to create a folder on OpenKM Repository using java Client. (Consuming the webservice OKMFolder)?
2. Can I copy a Folder with all its contents from a path in Windows to OpenKMRepository or I can only copy a folder empty?
This are my System information:
--OpenKM-5.0.3_JBoss-4.2.3GA (I am using this one, beacuse I found it implemented in jboss, if you can help me to get an actual version of OpenKM implemented at Jboss that would be helpful)
--Google Chrome and Mozilla Firefox
--Windows 7 Ultimate
--Netbeans IDE 7.4 (Java)
--jdk1.6.0_45 and jre 6
Please help me. I really need to do this work. because I have to give it very soon. Thank you very much!!
In this moment i have a little problem. I am doing a proyect and i have to copy a folder to OpenKm Repository from a path in my pc for example(C:\\Users\\hello), but I want to copy this folder with all its contents, sub-folders, documents (whathever type), and the contents of its sub-folders etc... I developed a software on Netbeans(Java) and I am trying to consume the webservice OpenKM. I read about topics that could help me to Authenticate (OKMAuth), and copy a document from a path (OKMDocument), but its looks like you dont have any example of how I can create a Folder or in this case copy a folder from a path (OKMFolder) or may be I haven't found it.
I have this example: to copy a Document from my path to OpenKM Repository. It works pretty good.
Code: Select all
But I think that it's different to create or copy a folder. because if I try to use this code to create a folder it doesn't work. (Obviously I addapt the code to a folder)String file = "C:\\Users\\usuario\\Documents\\archive\\hello.txt";
try
{
OKMAuthService oKMAuthService = new OKMAuthService();
OKMAuth oKMAuth = oKMAuthService.getOKMAuthPort();
OKMDocumentService oKMDocumentService = new OKMDocumentService();
OKMDocument oKMDocument = oKMDocumentService.getOKMDocumentPort();
//Login
String token = oKMAuth.login("okmAdmin", "admin");
System.out.println("Token: "+token);
Document doc = new Document();
doc.setPath("/okm:root/"+file.substring(file.lastIndexOf('\\')));
FileInputStream fis = new FileInputStream(file);
byte[] content = new byte[fis.available()];
int size = fis.read(content);
System.out.println("File Size: "+size);
fis.close();
Document newDoc = oKMDocument.create(token, doc, content);
System.out.println("[DOCUMENT] PATH: "+newDoc.getPath()+", Author: "+newDoc.getAuthor()+
", Size: "+newDoc.getActualVersion().getSize());
//Logout
oKMAuth.logout(token);
}
catch(Exception e)
{
e.printStackTrace();
}
These are my question:
1. Can you provide me an example to create a folder on OpenKM Repository using java Client. (Consuming the webservice OKMFolder)?
2. Can I copy a Folder with all its contents from a path in Windows to OpenKMRepository or I can only copy a folder empty?
This are my System information:
--OpenKM-5.0.3_JBoss-4.2.3GA (I am using this one, beacuse I found it implemented in jboss, if you can help me to get an actual version of OpenKM implemented at Jboss that would be helpful)
--Google Chrome and Mozilla Firefox
--Windows 7 Ultimate
--Netbeans IDE 7.4 (Java)
--jdk1.6.0_45 and jre 6
Please help me. I really need to do this work. because I have to give it very soon. Thank you very much!!