12-01-2016 08:35 AM
Hi, Im Using alfresco community 5
my project config are : java 8,wildfly 8 ,
so will cmis will work on it, because i was trying since two days .i unable success on download any specific document . here follow some my code
String fileName = "abcd.docx";
String authURI = "http://127.0.0.1:8090/alfresco/service/api/login";
String username = "user1";
String password = "user1";
HttpUtils httpUtils = new HttpUtils();
String authTicket = ConstantsTemp.EMPTY;
try {
authTicket = httpUtils.getAuthTicket(authURI, username, password);
String url = "http://127.0.0.1:8090/alfresco/download/direct?path=/app:company_home/st:testuserone/cm:documentLibr..."
+ fileName + "?alf_ticket=" + authTicket;
System.out.println(url);
HttpClient client = new HttpClient();
GetMethod metodoGet = new GetMethod(url);
int status = client.executeMethod(metodoGet);
System.out.println(status);
byte[] file = metodoGet.getResponseBody();
metodoGet.releaseConnection();
} catch (Exception e) {
}
error :
500
Internal Server Error
Folder not found: /st:testuserone (in workspace://SpacesStore/329bbf25-9ebb-4f47-845c-ddb16dd15852)
commons-httpclient-3.1.jar
commons-io-2.4.jar
and let me know can possible to retrieve list of file(link to download) from any one directory(folder)
12-02-2016 02:07 AM
no use , it also getting same issue org/apache/chemistry/opencmis/client/api/TransientCmisObject
12-02-2016 02:41 AM
Which version of alfresco-opencmis-extension are you using ,TransientCmisObject is not used any more. You need to use the latest 1.0 version of alfresco-opencmis-extension
12-02-2016 02:44 AM
Or you can try to remove
params.put(SessionParameter.OBJECT_FACTORY_CLASS,
"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
from my exmple code.
12-02-2016 03:45 AM
thank you, now i getting input stream object but how to send browser for download the stream oject
12-02-2016 04:05 AM
The easiest way is to download the content into a temp folder under real path your webapp .
and redirect your request to that file.
12-02-2016 04:15 AM
i am getting like this http://127.0.01:8090/alfresco/api/-default-/public/cmis/versions/1.1/atom/content/vRegCoSS-DAM.docx?... please send the sample code for redirecting..
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.